testsample_mock_yaml.c 1.8 KB
Newer Older
1 2
/* AUTOGENERATED FILE. DO NOT EDIT. */

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

28
/*=======Automagically Detected Files To Include=====*/
29 30 31 32 33
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "CException.h"
34 35 36
#include "two.h"
#include "three.h"
#include <four.h>
37 38 39 40
#include "funky.h"
#include <setjmp.h>
#include "Mockstanky.h"

41
/*=======External Functions This Runner Calls=====*/
42 43 44 45 46 47
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);


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

62
/*=======Suite Setup=====*/
63 64 65 66 67
static int suite_setup(void)
{
a_yaml_setup();
}

68
/*=======Test Reset Option=====*/
G
Greg Williams 已提交
69 70
void resetTest(void);
void resetTest(void)
71 72 73 74 75 76 77 78 79
{
  CMock_Verify();
  CMock_Destroy();
  tearDown();
  CMock_Init();
  setUp();
}


80
/*=======MAIN=====*/
81 82 83
int main(void)
{
  suite_setup();
84
  UnityBegin("testdata/mocksample.c");
85 86 87
  RUN_TEST(test_TheFirstThingToTest, 21);
  RUN_TEST(test_TheSecondThingToTest, 43);

88
  CMock_Guts_MemFreeFinal();
89 90
  return (UnityEnd());
}