diff --git a/README.md b/README.md index 0b10627..c3566f8 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ you want to create a fake for: ```c // UI.c ... -void DISPLAY_init(); +void DISPLAY_init(void); ... ``` @@ -119,7 +119,7 @@ TEST_F(UITests, write_line_outputs_lines_to_display) char msg[] = "helloworld"; UI_write_line(msg); ASSERT_EQ(DISPLAY_output_fake.call_count, 1); - ASSERT_EQ(strncmp(DISPLAY_output_fake.arg0_val, msg, 26), 0); + ASSERT_EQ(strncmp(DISPLAY_output_fake.arg0_val, msg, strlen(msg)), 0); } ``` @@ -140,8 +140,8 @@ When you want to define a fake function that returns a value, you should use the ```c // UI.c ... -unsigned int DISPLAY_get_line_capacity(); -unsigned int DISPLAY_get_line_insert_index(); +unsigned int DISPLAY_get_line_capacity(void); +unsigned int DISPLAY_get_line_insert_index(void); ... ``` @@ -187,7 +187,7 @@ call counts. It is good practice is to call the reset function for all the fakes in the setup function of your test suite. ```c -void setup() +void setup(void) { // Register resets RESET_FAKE(DISPLAY_init); @@ -209,7 +209,7 @@ You might want to define a macro to do this: FAKE(DISPLAY_get_line_capacity) \ FAKE(DISPLAY_get_line_insert_index) -void setup() +void setup(void) { /* Register resets */ FFF_FAKES_LIST(RESET_FAKE); @@ -639,7 +639,6 @@ Look under the examples directory for full length examples in both C and C++. There is also a test suite for the framework under the test directory. ------------------------- - ## Benefits So whats the point? @@ -647,7 +646,6 @@ So whats the point? * It is simple - just include a header file and you are good to go. * To work in both C and C++ test environments - ## Under the Hood * The fff.h header file is generated by a ruby script * There are tests under _./test_ @@ -663,3 +661,15 @@ So whats the point? | FAKE_VOID_FUNC_VARARG(fn [,arg_types*], ...); | Define a fake variadic function returning void with type return_type taking n arguments and n variadic arguments | FAKE_VOID_FUNC_VARARG(fn, const char*, ...) | | FAKE_VALUE_FUNC_VARARG(return_type, fn [,arg_types*], ...); | Define a fake variadic function returning a value with type return_type taking n arguments and n variadic arguments | FAKE_VALUE_FUNC_VARARG(int, fprintf, FILE*, const char*, ...) | | RESET_FAKE(fn); | Reset the state of fake function called fn | RESET_FAKE(DISPLAY_init); | + +------------------------- +## Getting (and Giving) Help + +If you've found a bug or want to suggest an improvement, +[create an issue](https://github.com/meekrosoft/fff/issues) and possibly +[generate a pull request] +(https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). +If you want help from the fff community, the best bet at present is to +[ask a question on Stack Overflow](https://stackoverflow.com/questions/ask) +and tag the question with `fake-function-framework`. Using that tag also makes it +easy to [find other fff questions on Stack Overflow](https://stackoverflow.com/questions/tagged/fake-function-framework).