diff options
author | Teus Benschop <teusjannette@gmail.com> | 2018-11-10 21:10:09 +0700 |
---|---|---|
committer | Teus Benschop <teusjannette@gmail.com> | 2018-11-10 21:10:09 +0700 |
commit | 2a58bdf9b682f462b63be719fc441a679f7d52f3 (patch) | |
tree | 4b8fce727ab045eef1a846659bb90f18719477e6 /tests/ldtest.cpp | |
parent | 018216c25c73b221df0810e6c909623abd46c321 (diff) | |
parent | 70090da73f95ee90e15650d853744526b5f47e68 (diff) |
Record sword (1.8.1+dfsg-7) in archive suite sid
Diffstat (limited to 'tests/ldtest.cpp')
-rw-r--r-- | tests/ldtest.cpp | 32 |
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; +} |