Errata for Test Driven Development for Embedded C
We try to keep our books accurate, but sometimes mistakes creep in. This page lists the errors submitted by our astute readers. If you've found a new error, please submit it.
The latest version of the book is P2.0, released about 1 year ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| 0 |
#49686: BookCode/SandBox/unity/LedDriver/LedDriverTest.c:44
/* TEST_FAIL("Start here"); */
TEST_FAIL macro does not exist for Unity. Should b...more...
|
P2.0
15-Aug-12 |
||
| 1 | 1 |
#49531: Fix Unity IGNORE test. See prag topics topics/10126#30451--James Grenning |
P2.0
16-Jul-12 |
|
| 7 |
#50063: "...cause for to celebrate!"
|
P2.0
26-Oct-12 |
||
| 7 |
#50084: Sometimes it’s a cause for to celebrate!
|
P2.0
29-Oct-12 |
||
| 18 |
#50470: you'll see It'ss instead of It's
Page:
-----
18 • Chapter 2. Test-Driving Tools and Conventions
Section:
--------
Installing Unity ...more...
|
P2.0
16-Jan-13 |
||
| 18 |
#50062: Middle of the page "It'ss" |
P2.0
26-Oct-12 |
||
| 19 |
#49451: In TEST_SETUP, you write to the space to which "expected" points. (One byte is written: the null terminator for the empty string.) However, no...more...
|
P1.0
22-Jun-12 |
||
| 26 |
#49452: Judging by the CppUTest output (on pp. 26-27), "checks" appears to refer to the number of checks that failed--not the number of condition chec...more...
|
P1.0
22-Jun-12 |
||
| 39 |
#50064: (wrong) It’ss done with another macro,
|
P2.0
27-Oct-12 |
||
| 50 |
#50944: The following sentences are little bit misleading. You said "there is no failing test, as expected" first but later said "It fails." No failin...more...
|
P2.0
03-Mar-13 |
||
| 59 |
#50124: Data type of many parameters in sample are "int" like as below.
ex) LedDriver_TurnOn(int ledNumber)
I think you should "uint16_t" instea...more...
|
P2.0
03-Nov-12 |
||
| 65 |
#50298: All helper function names for Led Driver start with a lower case except for IsLedOutOfBounds(). It should follow the naming rule and become is...more...
|
P2.0
06-Dec-12 |
||
| 68 |
#50302: In the book, the implementation for LedDriver_IsOn is as follows:
return ledsImage & (convertLedNumberToBit(ledNumber));
But it seem...more...
|
P2.0
06-Dec-12 |
||
| 70 |
#51140: Console output missing: ">> make" before compiling LedDriver.c--Akiyuki TAKOSHIMA |
P2.0
26-Mar-13 |
||
| 88 |
#50211: The book says "This is a common pattern for
solving platform-independence problems." But it seems "platform-dependence" to be correct since p...more...
|
P2.0
26-Nov-12 |
||
| 91 |
#50061: "We discussed the need to isolating hardware dependencies"
|
P2.0
26-Oct-12 |
||
| 96 |
#50351: "Does code like this change very often?"
|
P2.0
09-Dec-12 |
||
| 107 |
#50336: LedAddress should be written in camel case: ledAddress.--Akiyuki TAKOSHIMA |
P2.0
08-Dec-12 |
||
| 108 |
#49211: Section 6.4, paragraph two reads "... and load tests should help determine whether the system can meets its design limit".
-Either drop the...more...
|
P1.0
26-Apr-12 |
||
| 110 |
#50938: In Figure 11, one dotted line is missing - from Test to the second right TDOC.--Akiyuki TAKOSHIMA |
P2.0
02-Mar-13 |
||
| 112 |
#49212: Last sentence of section 6.8 reads "Simulating a sequence of interactions is much less complex than a simulation of the whole and very effecti...more...
|
P1.0
27-Apr-12 |
||
| 113 |
#50354: "If a DOC is difficult to set up and get into one or more desired states, it
may be best to substitute a test double." should read "... subst...more...
|
P2.0
10-Dec-12 |
||
| 114 |
#49588: In the description of 'Test spy', there are three 'CUT's but second one should be 'DOC'.
"so the test can verify that the correct parameter...more...
|
P2.0
26-Jul-12 |
||
| 116 |
#50357: "Identify collaborations that you expect to make automated tests difficult." collaborations should be "collaborators" by any chance?--Akiyuki TAKOSHIMA |
P2.0
11-Dec-12 |
||
| 117 |
#50384: "Depended Upon Component" should be "Depended On Component."--Akiyuki TAKOSHIMA |
P2.0
16-Dec-12 |
||
| 119 |
#50385: "Time is wrong, day is wrong" should be "Day is wrong, time is wrong" to match the order of words with other test case descriptions.--Akiyuki TAKOSHIMA |
P2.0
16-Dec-12 |
||
| 121 |
#50939: The title for Figure 16 - The light scheduler should be LightScheduler.--Akiyuki TAKOSHIMA |
P2.0
02-Mar-13 |
||
| 126 |
#49716: I think that one line is missing in section 8.5.
"You get a shot of testability with a portability chaser.
needed for the TimeService is k...more...
|
P2.0
20-Aug-12 |
||
| 126 |
#49723: The start of the first sentence in the third paragraph of section 8.5 is missing.--Andrew Cammell |
P2.0
22-Aug-12 |
||
| 126 |
#50400: Beginning of sentence lost in creation of 2nd printing.
"needed for the TimeService is kind of the opposite of the LightControllerSpy."
...more...
|
P2.0
20-Dec-12 |
||
| 132 |
#50391: static void scheduleEvent(int id, Day day, int minuteOfDay, int event) function is missing a substitution for scheduledEvent.day: scheduledEve...more...
|
P2.0
18-Dec-12 |
||
| 134 | 147 |
#50782: Test case ScheduleWeekEndItsMonday under the section Refactor the Tests cannot pass until the logic added in the Complex Conditional Logic sec...more...
|
P2.0
10-Feb-13 |
|
| 135 |
#50431: In the following sentence, did you happen to mean "complex day-matching conditional logic?" I thought so because the title of the paragraph is...more...
|
P2.0
03-Jan-13 |
||
| 138 |
#49589: In the third line of the first paragraph of 'Test the Wiring',
|
P2.0
26-Jul-12 |
||
| 138 |
#49369: You wrote "TimeService_Set-
|
P2.0
23-May-12 |
||
| 139 |
#50406: void LightScheduler_Create(void) has a loop variable 'i' but it is not required yet at this point.--Akiyuki TAKOSHIMA |
P2.0
22-Dec-12 |
||
| 141 |
#50405: Test description should be ScheduleTwoEventsAtTheSameTime for TEST(LightScheduler, ScheduleTwoEventsAtTheSameTIme).--Akiyuki TAKOSHIMA |
P2.0
22-Dec-12 |
||
| 149 |
#50430: The text and the code do not match. You say you set the loop counter 225 but it is 300 in the code. Which one is correct?--Akiyuki TAKOSHIMA |
P2.0
03-Jan-13 |
||
| 153 |
#49590: In the third paragraph (not counting code sections).
"If you are using printf() directly, you can do the same thing, initializing FormatOut...more...
|
P2.0
26-Jul-12 |
||
| 159 |
#50940: Quotations for expectedOutput in the both tests are incorrect:
"Circular buffer content:\n"
"<31, 41, 59, 26, 53>\n";
should be
"Cir...more...
|
P2.0
02-Mar-13 |
||
| 166 |
#50942: In Flash memory program flowchart, the description for the while loop "i || d" should be "b7 == 1". Paper book (1st print) does not have this problem.--Akiyuki TAKOSHIMA |
P2.0
03-Mar-13 |
||
| 166 |
#50943: In Flash memory program flowchart, the first action is to write x0 to offset address 0x40. However, the vendor's manual says "Write 40h or 10h...more...
|
P2.0
03-Mar-13 |
||
| 167 |
#49471: On the top line of the page, there should be a space between "a" and "printf()-like". |
P1.0
29-Jun-12 |
||
| 168 |
#50451: It's a minor but the text body says "Figure 23, Flash_Write sequence chart—success case, on page 167" but the title for the figure has () f...more...
|
P2.0
09-Jan-13 |
||
| 168 |
#50452: Then the call to MockIO_Expect_ReadThenReturn(0, 1<<7); tells the mock to expect a read from location 0x0 and that the mock should return a 1 ...more...
|
P2.0
09-Jan-13 |
||
| 169 |
#49591: Two test outputs say the name of test is "TEST(Flash, ProgramSucceedsReadyImmediately)" but the name is "TEST(Flash, ProgramSucceedsReadyImmed...more...
|
P2.0
26-Jul-12 |
||
| 169 |
#49592: In the middle, "The Flash_Write() call has the parameters reversed; we get this error:" --> "The IO_Write() call has the parameters reversed;...more...
|
P2.0
26-Jul-12 |
||
| 178 |
#50443: The term "RTC tic" is unfamiliar with me. Should it be "RTC tick?"--Akiyuki TAKOSHIMA |
P2.0
06-Jan-13 |
||
| 178 |
#49783: In the code says: "FakeMicroTime_Init(0, 50);"
In the text at the begin of the next page: "First, we initialize FakeMicroTime to start at 0 ...more...
|
P2.0
05-Sep-12 |
||
| 182 |
#50448: In page 181, the name for a test is WriteSuccessImmediately but the error message says WriteSucceedsReadyImmediately. Error massage seems correct.--Akiyuki TAKOSHIMA |
P2.0
08-Jan-13 |
||
| 198 |
#50628: You say "As I mentioned earlier, it is critical to allocate a LightDriverStruct dynamically. You can see that we have by the struct dereferenc...more...
|
P2.0
01-Feb-13 |
||
| 202 |
#50578: TEST(LightController, AddingDriverDestroysPrevious ), both text and code, have unnecessary space between Previous and ).--Akiyuki TAKOSHIMA |
P2.0
25-Jan-13 |
||
| 210 |
#49597: In the first code snippet, it is simply wrong because the .Destroy initializer missed the comma at the end of the line.
However, the referenc...more...
|
P2.0
30-Jul-12 |
||
| 210 |
#49598: In the second code snippet, the 'brightness' function pointer is better named like 'SetBrightness' to be consistent with others (TurnOn, TurnO...more...
|
P2.0
30-Jul-12 |
||
| 226 |
#50498: The code snippets say "LightScheduler_WakeUp" but the text says "LightScheduler_Wakeup." The codes are correct.--Akiyuki TAKOSHIMA |
P2.0
20-Jan-13 |
||
| 232 |
#49195: This test:
TEST(LightController, AddingDriverDestroysPrevious )
{
LightDriver spy = LightDriverSpy_Create(1);
LightController_Add(1,...more...
|
P1.0
25-Apr-12 |
||
| 240 |
#50955: In the first code snippet, findUnusedEvent function has unnecessary void for its parameter.--Akiyuki TAKOSHIMA |
P2.0
04-Mar-13 |
||
| 241 |
#50970: void LightDriver_SetBrightness(LightDriver self, int level)
{
if(isValid(self) && self->brightness)
self->brightness(self, level);
}...more...
|
P1.0
07-Mar-13 |
||
| 244 |
#49602: In the code snippet 'isEventDueNow', daysMatch() should take today and day as its parameters because it takes (Day, Day) here. 'daysMatch(Time...more...
|
P2.0
31-Jul-12 |
||
| 246 |
#50583: In the following sentences, the numbers do not match.
To mimic the concept of a partial abstraction in C and a
link-time test double, we ...more...
|
P2.0
26-Jan-13 |
||
| 248 |
#50508: In TEST(Time, NotWeekendDays), CheckThatTimeDoesNotMatch(WEEKEND); is missing after givenThatItIs(FRIDAY);
The online code has the same prob...more...
|
P2.0
22-Jan-13 |
||
| 250 |
#50509: Regarding email discussion with Dr. Newcomer, " and ' matching is incorrect.--Akiyuki TAKOSHIMA |
P2.0
22-Jan-13 |
||
| 268 |
#50966: considerStartingANewTestGroup();
exit(SUCCESS);
|
P2.0
06-Mar-13 |
||
| 271 |
#50643: In the sentence above LegacyFlashtest.cpp, MockIO_Expect_Read() should be MockIO_Expect_ReadThenReturn).--Akiyuki TAKOSHIMA |
P2.0
02-Feb-13 |
||
| 273 |
#50660: NUL should be NULL in the following sentence:
It makes sense that giving strtok() a pointer to a literal string causes a segmentation fault...more...
|
P2.0
02-Feb-13 |
||
| 275 |
#50662: In the following sentence, principle should be principal:
We’ll start to pay down some of the principle on the technical debt and reduce th...more...
|
P2.0
02-Feb-13 |
||
| 277 |
#49601: From page 277, all instances of "LightScheduler_WakeUp" should be consistent with earlier part of the book. --> "LightScheduler_Wakeup" ('u' i...more...
|
P2.0
31-Jul-12 |
||
| 279 |
#50756: In 14.2 Copy-Paste-Tweak-Repeat Antipattern, there are some cut-paste-tweak, which should be copy-paste-tweak.--Akiyuki TAKOSHIMA |
P2.0
06-Feb-13 |
||
| 281 |
#50959: same to #50940--Akiyuki TAKOSHIMA |
P2.0
05-Mar-13 |
||
| 283 |
#49639: I found that BDD section(14.6) seems contain the wrong code snippet.
It the page 283 of pdf(2.0), BDD sections shows two code snippets,
1)...more...
|
P2.0
11-Aug-12 |
||
| 297 |
#52019: In the Unity test file sample a semicolon is missing after the declaration of the test group's name. This leads to an error during compilation...more...
|
P2.0
17-Jun-13 |
||
| 299 |
#50728: The GroupName and TestName() pairs must be unique in the test build.
|
P2.0
05-Feb-13 |
||
| 300 |
#50779: The explanation for TEST_ASSERT_FLOAT_WITHIN macro is wrong. Compares two doubles should be compare two floats.--Akiyuki TAKOSHIMA |
P2.0
09-Feb-13 |
||
| 313 |
#50777: In the 3rd paragraph, there is unnecessary "we".
"These two operating systems are important because
we our product ships in two configurat...more...
|
P2.0
08-Feb-13 |
||
| 316 |
#50980: Thread_Destroy(Thread self) does not have a link to the online code.--Akiyuki TAKOSHIMA |
P2.0
07-Mar-13 |
||
| 320 |
#49815: In the second paragraph, 'ThreadResume()' should be 'ResumeThread()'
|
P2.0
17-Sep-12 |
||
| 331 |
#49462: Omitted #endif from include guards in D.3.
|
P1.0
25-Jun-12 |
||
| 2007 | ohkJh |
#51013: Learning a ton from these neat atrciles.--GiLhosNPryoi |
P2.0
13-Mar-13 |

