summaryrefslogtreecommitdiff
path: root/test/vendor/ceedling/plugins/fake_function_framework/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-06-10 16:18:27 +0700
committerhathach <[email protected]>2019-06-10 16:18:27 +0700
commit97c5c7a937f03af08b88fd64c6d0540f53eec5f3 (patch)
treebb8bc502513cf3d16a4935cfe670825b28e99b5e /test/vendor/ceedling/plugins/fake_function_framework/src
parent579f468d388a35149a4fa5100d7701e9ac914dbe (diff)
adding new ceedling test project
Diffstat (limited to 'test/vendor/ceedling/plugins/fake_function_framework/src')
-rw-r--r--test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h b/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h
new file mode 100644
index 000000000..de3db44aa
--- /dev/null
+++ b/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h
@@ -0,0 +1,33 @@
+#ifndef fff_unity_helper_H
+#define fff_unity_helper_H
+
+/*
+ FFF helper macros for Unity.
+*/
+
+/*
+ Fail if the function was not called the expected number of times.
+*/
+#define TEST_ASSERT_CALLED_TIMES(times_, function_) \
+ TEST_ASSERT_EQUAL_MESSAGE(times_, \
+ function_ ## _fake.call_count, \
+ "Function " #function_ " called the incorrect number of times.")
+/*
+ Fail if the function was not called exactly once.
+*/
+#define TEST_ASSERT_CALLED(function_) TEST_ASSERT_CALLED_TIMES(1, function_)
+
+/*
+ Fail if the function was called 1 or more times.
+*/
+#define TEST_ASSERT_NOT_CALLED(function_) TEST_ASSERT_CALLED_TIMES(0, function_)
+
+/*
+ Fail if the function was not called in this particular order.
+*/
+#define TEST_ASSERT_CALLED_IN_ORDER(order_, function_) \
+ TEST_ASSERT_EQUAL_PTR_MESSAGE((void *) function_, \
+ fff.call_history[order_], \
+ "Function " #function_ " not called in order " #order_ )
+
+#endif \ No newline at end of file