Merge pull request #25 from stephan-cr/fix-typos-in-readme
Fix typos in README
diff --git a/fakegen.rb b/fakegen.rb
index 2b1f842..79169b5 100644
--- a/fakegen.rb
+++ b/fakegen.rb
@@ -355,8 +355,9 @@
end
def define_fff_globals
+ putd "typedef void (*fff_function_t)(void);"
putd "typedef struct { "
- putd " void * call_history[FFF_CALL_HISTORY_LEN];"
+ putd " fff_function_t call_history[FFF_CALL_HISTORY_LEN];"
putd " unsigned int call_history_idx;"
putd "} fff_globals_t;"
putd ""
@@ -373,7 +374,7 @@
putd ""
putd "#define REGISTER_CALL(function) \\"
putd " if(fff.call_history_idx < FFF_CALL_HISTORY_LEN) \\"
- putd " fff.call_history[fff.call_history_idx++] = (void *)function;"
+ putd " fff.call_history[fff.call_history_idx++] = (fff_function_t)function;"
end
def extern_c
diff --git a/fff.h b/fff.h
index 85db589..6154ca1 100644
--- a/fff.h
+++ b/fff.h
@@ -108,8 +108,9 @@
}
/* -- END INTERNAL HELPER MACROS -- */
+typedef void (*fff_function_t)(void);
typedef struct {
- void * call_history[FFF_CALL_HISTORY_LEN];
+ fff_function_t call_history[FFF_CALL_HISTORY_LEN];
unsigned int call_history_idx;
} fff_globals_t;
@@ -126,7 +127,7 @@
#define REGISTER_CALL(function) \
if(fff.call_history_idx < FFF_CALL_HISTORY_LEN) \
- fff.call_history[fff.call_history_idx++] = (void *)function;
+ fff.call_history[fff.call_history_idx++] = (fff_function_t)function;
#define DECLARE_FAKE_VOID_FUNC0(FUNCNAME) \
FFF_EXTERN_C \
diff --git a/test/c_test_framework.h b/test/c_test_framework.h
index ce7ad89..297a33a 100644
--- a/test/c_test_framework.h
+++ b/test/c_test_framework.h
@@ -8,7 +8,7 @@
/* Test Framework :-) */
void setup();
#define TEST_F(SUITE, NAME) void NAME()
-#define RUN_TEST(SUITE, TESTNAME) printf(" Running %s.%s: \n", #SUITE, #TESTNAME); setup(); TESTNAME(); printf(" SUCCESS\n");
+#define RUN_TEST(SUITE, TESTNAME) do { printf(" Running %s.%s: \n", #SUITE, #TESTNAME); setup(); TESTNAME(); printf(" SUCCESS\n"); } while (0)
#define ASSERT_EQ(A, B) assert((A) == (B))
#define ASSERT_TRUE(A) assert((A))