interplane.Get Omega
Read in your language

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

branch master Branches Tags History

cJSON / tests / unity / test / expectdata / testsample_mock_cmd.c

80 lines · 1649 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 CEXCEPTION_T e; \
14 Try { \
15 setUp(); \
16 TestFunc(); \
17 } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
18 } \
19 if (TEST_PROTECT() && !TEST_IS_IGNORED) \
20 { \
21 tearDown(); \
22 CMock_Verify(); \
23 } \
24 CMock_Destroy(); \
25 UnityConcludeTest(); \
26}
27
28/*=======Automagically Detected Files To Include=====*/
29#include "unity.h"
30#include "cmock.h"
31#include <setjmp.h>
32#include <stdio.h>
33#include "CException.h"
34#include "funky.h"
35#include <setjmp.h>
36#include "Mockstanky.h"
37
38/*=======External Functions This Runner Calls=====*/
39extern void setUp(void);
40extern void tearDown(void);
41extern void test_TheFirstThingToTest(void);
42extern void test_TheSecondThingToTest(void);
43
44
45/*=======Mock Management=====*/
46static void CMock_Init(void)
47{
48 Mockstanky_Init();
49}
50static void CMock_Verify(void)
51{
52 Mockstanky_Verify();
53}
54static void CMock_Destroy(void)
55{
56 Mockstanky_Destroy();
57}
58
59/*=======Test Reset Option=====*/
60void resetTest(void);
61void resetTest(void)
62{
63 CMock_Verify();
64 CMock_Destroy();
65 tearDown();
66 CMock_Init();
67 setUp();
68}
69
70
71/*=======MAIN=====*/
72int main(void)
73{
74 UnityBegin("testdata/mocksample.c");
75 RUN_TEST(test_TheFirstThingToTest, 21);
76 RUN_TEST(test_TheSecondThingToTest, 43);
77
78 CMock_Guts_MemFreeFinal();
79 return (UnityEnd());
80}