Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cJSON/blob/master/tests/unity/test/expectdata/testsample_mock_run2.c # cJSON [Ported from github.com/DaveGamble/cJSON] Fix: heap-use-after-free in merge_patch when patch is subtree of target (#1065) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `cJSON / tests / unity / test / expectdata / testsample_mock_run2.c` 89 lines ยท 1705 bytes Raw Blame History 1 /* AUTOGENERATED FILE. DO NOT EDIT. */ 2 3 /*=======Test Runner Used To Run Each Test Below=====*/ 4 #define RUN_TEST(TestFunc, TestLineNum) \ 5 { \ 6 Unity.CurrentTestName = #TestFunc; \ 7 Unity.CurrentTestLineNumber = TestLineNum; \ 8 Unity.NumberOfTests++; \ 9 CMock_Init(); \ 10 UNITY_CLR_DETAILS(); \ 11 if (TEST_PROTECT()) \ 12 { \ 13 setUp(); \ 14 TestFunc(); \ 15 } \ 16 if (TEST_PROTECT() && !TEST_IS_IGNORED) \ 17 { \ 18 tearDown(); \ 19 CMock_Verify(); \ 20 } \ 21 CMock_Destroy(); \ 22 UnityConcludeTest(); \ 23 } 24 25 /*=======Automagically Detected Files To Include=====*/ 26 #include "unity.h" 27 #include "cmock.h" 28 #include 29 #include 30 #include "funky.h" 31 #include 32 #include "Mockstanky.h" 33 34 /*=======External Functions This Runner Calls=====*/ 35 extern void setUp(void); 36 extern void tearDown(void); 37 extern void test_TheFirstThingToTest(void); 38 extern void test_TheSecondThingToTest(void); 39 40 41 /*=======Mock Management=====*/ 42 static void CMock_Init(void) 43 { 44 Mockstanky_Init(); 45 } 46 static void CMock_Verify(void) 47 { 48 Mockstanky_Verify(); 49 } 50 static void CMock_Destroy(void) 51 { 52 Mockstanky_Destroy(); 53 } 54 55 /*=======Suite Setup=====*/ 56 static int suite_setup(void) 57 { 58 a_custom_setup(); 59 } 60 61 /*=======Suite Teardown=====*/ 62 static int suite_teardown(int num_failures) 63 { 64 a_custom_teardown(); 65 } 66 67 /*=======Test Reset Option=====*/ 68 void resetTest(void); 69 void resetTest(void) 70 { 71 CMock_Verify(); 72 CMock_Destroy(); 73 tearDown(); 74 CMock_Init(); 75 setUp(); 76 } 77 78 79 /*=======MAIN=====*/ 80 int main(void) 81 { 82 suite_setup(); 83 UnityBegin("testdata/mocksample.c"); 84 RUN_TEST(test_TheFirstThingToTest, 21); 85 RUN_TEST(test_TheSecondThingToTest, 43); 86 87 CMock_Guts_MemFreeFinal(); 88 return suite_teardown(UnityEnd()); 89 }