JLospinoso / ccc

Companion Code for C++ Crash Course

Home Page:https://ccc.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typo: Page 332 DoubleEq

michaeldperez opened this issue · comments

There is a typo in the section Google Mock: Putting It All Together on page 332. In the AlertWhenImminent test there is the call to

EXPECT_CALL(bus, publish(Field(&BrakeCommand::time_to_collision_s, DoubleEq{ 1L }))).Times(1);

I believe the typo is in the call DoubleEq{ 1L } which should be DoubleEq( 1L ).

That is, there is a call to a function and not an initialization.

Hi @michaeldperez, thanks for the note. DoubleEq is a class so you can use either. Since we've stuck with braced initialization, that's what I've used here. But it's really down to personal preference.