[sword-devel] lex driver unit test

Troy A. Griffitts sword-devel@crosswire.org
Sat, 27 Jul 2002 18:53:36 -0700


Hey guys.  Lots of new engine code in cvs.  I think I have the empty 
initial entry problem fixed.  At least my little test program runs fine 
with both the RawLD and RawLD4 drivers.  Will be working in utf8 support 
for keys later tonight.

I did some other major cleanup work in the engine.  Hope I didn't break 
anything.  Not much new code, but lots of relocation of logic.  Off to 
Church.  Looking for bug reports when I get back to the grind this evening.

	-Troy.



Troy A. Griffitts wrote:
> OK guys,
>     I'm trying to get around to fixing all these lexicon issues.  I have 
> added a simple lextest unit test file in sword/tests, and have attached 
> the file as well.  If you guys could give me something like this that I 
> can just compile and bring up in a debugger that demonstrates your 
> problems, I would really appreciate it.
> 
>     Even imp2ld data files I could try that don't seem to produce what 
> you'd expect would be great.  Thanks tons!
> 
>     -Troy.
> 
> 
> ------------------------------------------------------------------------
> 
> #include <rawld.h>
> 
> void main(int argc, char **argv) {
> 
> 	RawLD::createModule("tmp/lextest");
> 	RawLD lex("tmp/lextest");
> 
> 	lex.SetKey("a");
> 	lex << "aaa";
> 
> 	lex.SetKey("c");
> 	lex << "ccc";
> 
> 	lex.SetKey("b");
> 	lex << "bbb";
> 
> 	for (lex = TOP; !lex.Error(); lex++) {
> 		cout << lex.KeyText() << ":\n";
> 		cout << lex << "\n------------------\n";
> 	}
> 	return 0;
> }