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 / testdata / testRunnerGeneratorSmall.c

67 lines · 1356 bytes Raw Blame History
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
7TEST_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/* Support for Meta Test Rig */
15#define TEST_CASE(a)
16void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking tests
17
18/* Global Variables Used During These Tests */
19int CounterSetup = 0;
20int CounterTeardown = 0;
21int CounterSuiteSetup = 0;
22
23void setUp(void)
24{
25 CounterSetup = 1;
26}
27
28void tearDown(void)
29{
30 CounterTeardown = 1;
31}
32
33void custom_setup(void)
34{
35 CounterSetup = 2;
36}
37
38void custom_teardown(void)
39{
40 CounterTeardown = 2;
41}
42
43void test_ThisTestAlwaysPasses(void)
44{
45 TEST_PASS();
46}
47
48void test_ThisTestAlwaysFails(void)
49{
50 TEST_FAIL_MESSAGE("This Test Should Fail");
51}
52
53void test_ThisTestAlwaysIgnored(void)
54{
55 TEST_IGNORE_MESSAGE("This Test Should Be Ignored");
56}
57
58void spec_ThisTestPassesWhenNormalSetupRan(void)
59{
60 TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run");
61}
62
63void spec_ThisTestPassesWhenNormalTeardownRan(void)
64{
65 TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run");
66}
67