aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-23 16:07:46 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-23 16:09:42 +0100
commit8687e1b807393a152f32f6573c19cb97f509cb5c (patch)
tree9ba775a980b5ea4090321cc1c6eefebdd4473735 /example
parentc154b2166173446df59b864ca997ba5ad6fd6c8e (diff)
downloadcmocka-8687e1b807393a152f32f6573c19cb97f509cb5c.tar.gz
cmocka-8687e1b807393a152f32f6573c19cb97f509cb5c.tar.xz
cmocka-8687e1b807393a152f32f6573c19cb97f509cb5c.zip
tests: Add test_fixtures.
Diffstat (limited to 'example')
-rw-r--r--example/CMakeLists.txt6
-rw-r--r--example/fixture_test.c37
2 files changed, 0 insertions, 43 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 7152a1e..0e7b0de 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -19,12 +19,6 @@ target_link_libraries(simple_test ${CMOCKA_SHARED_LIBRARY})
add_test(simple_test ${CMAKE_CURRENT_BINARY_DIR}/simple_test)
-### Test different fixture setups
-add_executable(fixture_test fixture_test.c)
-target_link_libraries(fixture_test ${CMOCKA_SHARED_LIBRARY})
-
-add_test(fixture_test ${CMAKE_CURRENT_BINARY_DIR}/fixture_test)
-
add_executable(calculator_test calculator.c calculator_test.c)
target_link_libraries(calculator_test ${CMOCKA_SHARED_LIBRARY})
diff --git a/example/fixture_test.c b/example/fixture_test.c
deleted file mode 100644
index 757394a..0000000
--- a/example/fixture_test.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdarg.h>
-#include <stddef.h>
-#include <setjmp.h>
-#include <cmocka.h>
-
-#include <stdlib.h>
-
-static void setup_only(void **state)
-{
- *state = malloc(1);
-}
-
-static void teardown_only(void **state)
-{
- free(*state);
-}
-
-static void malloc_setup_test(void **state)
-{
- assert_non_null(*state);
- free(*state);
-}
-
-static void malloc_teardown_test(void **state)
-{
- *state = malloc(1);
- assert_non_null(*state);
-}
-
-int main(void) {
- const UnitTest tests[] = {
- unit_test_setup(malloc_setup_test, setup_only),
- unit_test_teardown(malloc_teardown_test, teardown_only),
- };
-
- return run_tests(tests);
-}