meekrosoft / fff

A testing micro framework for creating function test doubles
Other
761 stars 167 forks source link

Readme describes nested function example as standard conforming #34

Closed gsauthof closed 6 years ago

gsauthof commented 7 years ago

This statement from the README isn't accurate:

In case your project uses a C99 compliant C compiler you can even combine all this in a single unit test function so you can easily oversee all details of the test.

in the context of the code example that follows the paragraph:

// ...
TEST_F(FFFTestSuite, when_value_custom_fake_called_THEN_it_returns_custom_output)
{
    Time t;
    Time getTime_custom_now;
    void getTime_custom_fake(Time *now) {
        *now = getTime_custom_now;
    }
   // ...
}

ISO C99 doesn't specify nested functions. Nested functions aren't included in C11, as well. They are a GCC extension.

Perhaps you want to change this sentence to something like: In case your project uses a C compiler that supports nested functions (e.g. GCC) you can even combine all this in a single unit test function so you can easily oversee all details of the test.

meekrosoft commented 6 years ago

Thanks for the clarification @gsauthof !