1 /* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ 2 3 #include <stdio.h> 4 #include "unity.h" 5 #include "Defs.h" 6 7 TEST_SOURCE_FILE("some_file.c") 8 9 /* Notes about prefixes: 10 test - normal default prefix. these are "always run" tests for this procedure 11 spec - normal default prefix. required to run default setup/teardown calls. 12 */ 13 14 /* Include Passthroughs for Linking Tests */ putcharSpy(int c)15void putcharSpy(int c) { (void)putchar(c);} flushSpy(void)16void flushSpy(void) {} 17 18 /* Global Variables Used During These Tests */ 19 int CounterSetup = 0; 20 int CounterTeardown = 0; 21 int CounterSuiteSetup = 0; 22 setUp(void)23void setUp(void) 24 { 25 CounterSetup = 1; 26 } 27 tearDown(void)28void tearDown(void) 29 { 30 CounterTeardown = 1; 31 } 32 custom_setup(void)33void custom_setup(void) 34 { 35 CounterSetup = 2; 36 } 37 custom_teardown(void)38void custom_teardown(void) 39 { 40 CounterTeardown = 2; 41 } 42 test_ThisTestAlwaysPasses(void)43void test_ThisTestAlwaysPasses(void) 44 { 45 TEST_PASS(); 46 } 47 test_ThisTestAlwaysFails(void)48void test_ThisTestAlwaysFails(void) 49 { 50 TEST_FAIL_MESSAGE("This Test Should Fail"); 51 } 52 test_ThisTestAlwaysIgnored(void)53void test_ThisTestAlwaysIgnored(void) 54 { 55 TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); 56 } 57 spec_ThisTestPassesWhenNormalSetupRan(void)58void spec_ThisTestPassesWhenNormalSetupRan(void) 59 { 60 TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); 61 } 62 spec_ThisTestPassesWhenNormalTeardownRan(void)63void spec_ThisTestPassesWhenNormalTeardownRan(void) 64 { 65 TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); 66 } 67