Unit Test Frameworks by Paul Hamill The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated April 19, 2007. UNCONFIRMED errors and comments from readers: {24} Example 3-7; import java.util.*; This is unnecessary. I would guess this was placed there because the class Library uses the java.util.vector class. Example 3-7 is the source for LibraryTest, which merely tests the class Library, but isn't the class Library itself. No where in LibraryTest source does any code involve java.util.* classes. (26) Fourth paragraph, first line; r: One way to take care of the code duplication is to make the test Library a member of LibraryTest ... w: One way to take care of the code duplication is to make the class Library a member of LibraryTest ... (29) 1st paragraph; The first sentence of this paragraph starts with the words: "The interface Test contains the run() method". Test is an abstract base class, not an interface. The text even states this one paragraph prior. {78} Example 7-13; When I tried this with VC++7.1 with the Chapter 7 example source from the CD (same as written in the book), I get an error on the CPPUNIT_UNIT_TEST_SUITE_REGISTRATION() line: c:\Temp\UnitTestCD\examples\chapter7\test.cpp(7) : error C2664: 'CppUnit::AutoRegisterSuite::AutoRegisterSuite(const std::string &)' : cannot convert parameter 1 from 'long' to 'const std::string &' with [ TestCaseType=BookTest ] Reason: cannot convert from 'long' to 'const std::string' No constructor could take the source type, or constructor overload resolution was ambiguous No such problem with gcc 3.4.3 (in Cygwin). Oddly, with VC++7.1, moving the declaration up three lines -- out of main() -- [into file scope] makes the compilation succeed. I found the same thing with cppunit 1.10.2, and someone on the web is doing it this way independently: http://www.gamesfromwithin.com/articles/0412/000061.html {119} Just before "Step 2: Add a Book to a Library" header; I did not get the third line of the test results. I believe this is because the UnitTest::assertTrue shown on page 114 exits when a condition is false.