Errata

Unit Test Frameworks

Errata for Unit Test Frameworks

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date Submitted
Other Digital Version 16
1st sentence, last paragraph

It currently reads: '... to writing flawless code on the first tryin other words, "code once."'

The "tryin" should be "try, in" and the full stop should be outside the quotes, not inside.

(This is in the EPub version)

Paul Walker  May 04, 2012 
Other Digital Version 13
2nd paragraph

The sentence "These tests should avoid dependencies on the results of other tests (called test coupling ), ..." has an extraneous space before the closing bracket

Paul Walker  May 04, 2012 
Other Digital Version 74
Middle of page, under Example 4-2.

"With the additional message, the rest results provide better information about the cause of the test failure" should read "With the additional message, the test results provide better information about the cause of the test failure"
Notice, rest should be test.

David Baucum  Nov 28, 2011 
Printed Page 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.

Anonymous   
Printed Page 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 ...

Anonymous   
Printed Page 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.

Anonymous   
Printed Page 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:TempUnitTestCDexampleschapter7 est.cpp(7) : error C2664:
'CppUnit::AutoRegisterSuite<TestCaseType>::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

Anonymous   
Printed Page 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.

Anonymous