[Cppunit-devel] Problems with CppUnit cookbook
Brought to you by:
blep
From: markd <ma...@bo...> - 2004-02-05 15:11:09
|
Greetings, Apologies in advance if this seems rant-like. I've actually been enjoying CppUnit so far and am looking forward to using it. If you'd like me to make edits / improve the cookbook, I'd be glad to do it. I downloaded CppUnit 1.8.0 and the docs, and had problems working through the Cookbook. As it stands, you can't really work through it like a tutorial, which is how I wanted to use it - to type in the code for each step, get it to run, then move on to the next one. (and it seems to have started out that way, with "ok, now compile and run" here and there) At each step along the way I've got a working test that I can then monkey-see monkey-do when making new tests on my own. A couple of examples: the class being tested starts out as "class Complex". Then, right before "TestFactoryRegistry", it becomes ComplexNumber. New methods on Complex[Number] are used, but not defined. When registering the suite with CPPUNIT_TEST_SUITE_REGISTRATION( ComplexNumber ); I had to use ComplexNumberTest instead to make it work. In TestFactoryRegistry, the two pitfalls the registry was created to solve aren't really elaborated. such as "# compilation bottleneck caused by the inclusion of all test case headers (see previous example)", even though the previous example didn't include anything except the helper macros. Also, none of the examples show which headers to actually include. (granted, the spelunking, g++ -E, and debugging helped me work through all the problems and ended up with a couple different working tests, but I got frustrated and discouraged along the way) Also, the very last item says "To do that, the application must returns a value different than 0 to indicate that there was an error.", although the code included returns 0 to indicate an error and 1 to indicate non-error, which is opposite from the sentence, plus opposite from what unix shells are expecting for a program return value. Thanks for your time. Cheers, ++Mark Dalrymple, ma...@bo... http://borkware.com |