summaryrefslogtreecommitdiff
path: root/tests/introtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/introtest.cpp')
-rw-r--r--tests/introtest.cpp110
1 files changed, 110 insertions, 0 deletions
diff --git a/tests/introtest.cpp b/tests/introtest.cpp
new file mode 100644
index 0000000..162b960
--- /dev/null
+++ b/tests/introtest.cpp
@@ -0,0 +1,110 @@
+#include <swmgr.h>
+#include <iostream>
+#include <versekey.h>
+#include <rawtext.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ SWMgr mymgr;
+
+ RawText::createModule(".");
+ RawText mod(".");
+
+ VerseKey vk;
+ vk.Headings(1);
+ vk.AutoNormalize(0);
+ vk.Persist(1);
+ mod.setKey(vk);
+
+ vk.Verse(0);
+ vk.Chapter(0);
+ vk.Book(0);
+ vk.Testament(0);
+
+ mod << "Module heading text";
+
+ vk.Verse(0);
+ vk.Chapter(0);
+ vk.Book(0);
+ vk.Testament(1);
+
+ mod << "OT heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ mod << "Gen heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(0);
+
+ mod << "Gen 1 heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(1);
+
+ mod << "Gen 1:1 text";
+
+
+ vk.Testament(0);
+ vk.Book(0);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "Module heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(0);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "OT heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "Gen heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(0);
+
+ std::cout << "Gen 1 heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(1);
+
+ std::cout << "Gen 1:1 text ?= " << (const char*)mod << std::endl;
+
+ /* old introtest
+ SWModule *mhc = mymgr.Modules["MHC"];
+
+ if (mhc) {
+ VerseKey vk;
+ vk.Headings(1);
+ vk.AutoNormalize(0);
+ vk.Persist(1);
+ vk = "jas 0:0";
+ std::cout << vk << ":\n";
+ mhc->setKey(vk);
+ std::cout << (const char *) mhc->Key() << ":\n";
+ std::cout << (const char *) *mhc << "\n";
+ }
+ */
+ return 0;
+}
+
+