summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerje Runde <terje.runde@gmail.com>2016-12-03 19:14:18 (GMT)
committerAndreas Schneider <asn@cryptomilk.org>2016-12-17 17:13:04 (GMT)
commit481be0e2215eeb00ef0ff3eb6a1a61ae1e64ef1c (patch)
tree4f522ff564e7d0e2de54f5354ac741de027e3723
parent7ef5267f3f658f96bba2beaa08f1efc35cf4526a (diff)
downloadcmocka-481be0e2215eeb00ef0ff3eb6a1a61ae1e64ef1c.zip
cmocka-481be0e2215eeb00ef0ff3eb6a1a61ae1e64ef1c.tar.gz
cmocka-481be0e2215eeb00ef0ff3eb6a1a61ae1e64ef1c.tar.bz2
Remove dangling unit test source file.
-rw-r--r--test_ordering_fail.c95
1 files changed, 0 insertions, 95 deletions
diff --git a/test_ordering_fail.c b/test_ordering_fail.c
deleted file mode 100644
index 652f5ad..0000000
--- a/test_ordering_fail.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "config.h"
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <setjmp.h>
-#include <cmocka.h>
-#include <cmocka_private.h>
-
-static void mock_test_a_called(void)
-{
- function_called();
-}
-
-static void mock_test_b_called(void)
-{
- function_called();
-}
-
-static void mock_test_c_called(void)
-{
- function_called();
-}
-
-static void test_does_fail_for_unexpected_call(void **state)
-{
- (void)state;
- expect_function_call(mock_test_a_called);
- expect_function_call(mock_test_a_called);
-
- mock_test_a_called();
- mock_test_a_called();
- mock_test_a_called();
-}
-
-static void test_does_fail_for_unmade_expected_call(void **state)
-{
- (void)state;
- expect_function_call(mock_test_a_called);
- expect_function_call(mock_test_a_called);
-
- mock_test_a_called();
-}
-
-static void test_ordering_fails_out_of_order(void **state)
-{
- (void)state;
- expect_function_call(mock_test_a_called);
- expect_function_call(mock_test_b_called);
- expect_function_call(mock_test_a_called);
-
- mock_test_b_called();
-}
-
-static void test_ordering_fails_out_of_order_for_at_least_once_calls(void **state)
-{
- (void)state;
- expect_function_call_any(mock_test_a_called);
- ignore_function_calls(mock_test_b_called);
-
- mock_test_b_called();
- mock_test_c_called();
-}
-
-/* Primarily used to test error message */
-static void test_fails_out_of_order_if_no_calls_found_on_any(void **state)
-{
- (void)state;
- expect_function_call_any(mock_test_a_called);
- ignore_function_calls(mock_test_b_called);
-
- mock_test_a_called();
- mock_test_c_called();
-}
-
-static void test_fails_if_zero_count_used(void **state)
-{
- (void)state;
- expect_function_calls(mock_test_a_called, 0);
-
- mock_test_a_called();
-}
-
-int main(void) {
- const struct CMUnitTest tests[] = {
- cmocka_unit_test(test_does_fail_for_unexpected_call)
- ,cmocka_unit_test(test_does_fail_for_unmade_expected_call)
- ,cmocka_unit_test(test_does_fail_for_unmade_expected_call)
- ,cmocka_unit_test(test_ordering_fails_out_of_order)
- ,cmocka_unit_test(test_ordering_fails_out_of_order_for_at_least_once_calls)
- ,cmocka_unit_test(test_fails_out_of_order_if_no_calls_found_on_any)
- ,cmocka_unit_test(test_fails_if_zero_count_used)
- };
-
- return cmocka_run_group_tests(tests, NULL, NULL);
-}