testsample_mock_yaml.c 1.7 KB
Newer Older
1
/* AUTOGENERATED FILE. DO NOT EDIT. */
2 3 4 5 6 7 8 9 10

//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
  Unity.CurrentTestName = #TestFunc; \
  Unity.CurrentTestLineNumber = TestLineNum; \
  Unity.NumberOfTests++; \
  if (TEST_PROTECT()) \
  { \
M
mvandervoord 已提交
11 12
    CEXCEPTION_T e; \
    Try { \
13 14 15 16
      CMock_Init(); \
      setUp(); \
      TestFunc(); \
      CMock_Verify(); \
M
mvandervoord 已提交
17
    } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
18 19 20 21 22 23 24 25 26 27
  } \
  CMock_Destroy(); \
  if (TEST_PROTECT() && !TEST_IS_IGNORED) \
  { \
    tearDown(); \
  } \
  UnityConcludeTest(); \
}

//=======Automagically Detected Files To Include=====
28 29
#include "unity.h"
#include "cmock.h"
M
mvandervoord 已提交
30 31 32
#include "two.h"
#include "three.h"
#include <four.h>
33 34
#include <setjmp.h>
#include <stdio.h>
M
mvandervoord 已提交
35
#include "CException.h"
36 37
#include "Mockstanky.h"

38
//=======External Functions This Runner Calls=====
39 40 41 42 43
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);

44 45

//=======Mock Management=====
46 47 48 49 50 51 52 53 54 55 56 57
static void CMock_Init(void)
{
  Mockstanky_Init();
}
static void CMock_Verify(void)
{
  Mockstanky_Verify();
}
static void CMock_Destroy(void)
{
  Mockstanky_Destroy();
}
58 59

//=======Suite Setup=====
60 61 62 63
static int suite_setup(void)
{
a_yaml_setup();
}
64 65

//=======Test Reset Option=====
66 67 68 69 70 71 72 73 74 75
void resetTest()
{
  CMock_Verify();
  CMock_Destroy();
  tearDown();
  CMock_Init();
  setUp();
}


76
//=======MAIN=====
77 78 79 80 81 82 83 84 85 86
int main(void)
{
  suite_setup();
  Unity.TestFile = "test/testdata/mocksample.c";
  UnityBegin();
  RUN_TEST(test_TheFirstThingToTest, 21);
  RUN_TEST(test_TheSecondThingToTest, 43);

  return (UnityEnd());
}