summaryrefslogtreecommitdiff
path: root/tests/ldtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ldtest.cpp')
-rw-r--r--tests/ldtest.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ldtest.cpp b/tests/ldtest.cpp
new file mode 100644
index 0000000..369984f
--- /dev/null
+++ b/tests/ldtest.cpp
@@ -0,0 +1,32 @@
+#include <swmodule.h>
+#include <swmgr.h>
+#include <iostream>
+#include <stdio.h>
+
+using namespace sword;
+using namespace std;
+
+int main(int argc, char **argv) {
+
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s <lexdict_name>\n", *argv);
+ exit(-1);
+ }
+
+ SWMgr library;
+ SWModule *module = library.getModule(argv[1]);
+ if (!module) {
+ cerr << "\nCouldn't find module: " << argv[1] << "\n" << endl;
+ exit(-2);
+ }
+ int i = 0;
+ for ((*module) = TOP; !module->popError(); module->increment()) {
+ cout << module->getKeyText() << ": " << module->stripText() << "\n";
+ if (++i > 10) {
+ cout << "ERROR: more than 10 iterations. stopping.\n";
+ break;
+ }
+
+ }
+ return 0;
+}