[sword-devel] BUG: libSword hangs again

Bobby Nations sword-devel@crosswire.org
Fri, 02 Aug 2002 16:42:04 -0500


Troy A. Griffitts wrote:
> Bobby,
>     Not sure what CppUnit would give us.  I'm sure it has benefits, I 
> just don't know what they are.  We have a tests directory.  I would LOVE 
> to be able to standardize them all to exit with an error code if they 
> fail, and to write a script that cycles thru them all and runs them.

Troy,

CppUnit is a port of JUnit, and as such it gives you everything you just 
asked for.  The framework makes it very straightforward to add unit 
tests (one method for each one), and when you compile your class it will 
  run them and report the results.

I'll knock one out this weekend and send you the source for it so that 
you can see what it does.  BTW, who's knowledgeable about autoconf and 
automake?  I'd like to have them check for the libcppunit and change the 
  appropriate Makefiles so that the CppUnit unit tests would get 
compiled only if the user had libcppunit.

Thanks,

Bobby

> 
>     Currently, they don't check their own output, but we could do 
> something like: test1 > test1.good
> then in the script, diff the output with the .good file.  What do you 
> think?
> 
>     -Troy.
> 
> 
> 
> Bobby Nations wrote:
> 
>> Troy,
>>
>> These small programs would be great candidates for unit tests for each 
>> of these bugs.  I've used CppUnit before and could start setting them 
>> up if you'd like.  That way, we could begin accumulating a suite of 
>> test cases that could be the basis for future regression test 
>> checkpoints.
>>
>> Cheers,
>>
>> Bobby
>>
>>
>> Troy A. Griffitts wrote:
>>
>>> ok, this should be fixed.
>>>
>>> porton@narod.ru wrote:
>>>
>>>> Now libSword hangs on the following test:
>>>>
>>>> #include <iostream>
>>>> #include <rawld.h>
>>>>
>>>> void main(int argc, char **argv)
>>>> {
>>>>     RawLD::createModule("tmp/lextest");
>>>>     RawLD lex("tmp/lextest");
>>>>
>>>>     lex.SetKey("a");
>>>>     lex << "x";
>>>>
>>>>     lex.SetKey("a");
>>>>     lex.deleteEntry();
>>>>         lex.SetKey("a");
>>>>     lex << "y";
>>>>
>>>>     lex = BOTTOM;
>>>> }
>>>>
>>>