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 / extras / fixture / test / unity_fixture_TestRunner.c

57 lines · 2593 bytes Raw Blame History
1/* Copyright (c) 2010 James Grenning and Contributed to Unity Project
2 * ==========================================
3 * Unity Project - A Test Framework for C
4 * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
5 * [Released under MIT License. Please refer to license.txt for details]
6 * ========================================== */
7
8#include "unity_fixture.h"
9
10TEST_GROUP_RUNNER(UnityFixture)
11{
12 RUN_TEST_CASE(UnityFixture, PointerSetting);
13 RUN_TEST_CASE(UnityFixture, ForceMallocFail);
14 RUN_TEST_CASE(UnityFixture, ReallocSmallerIsUnchanged);
15 RUN_TEST_CASE(UnityFixture, ReallocSameIsUnchanged);
16 RUN_TEST_CASE(UnityFixture, ReallocLargerNeeded);
17 RUN_TEST_CASE(UnityFixture, ReallocNullPointerIsLikeMalloc);
18 RUN_TEST_CASE(UnityFixture, ReallocSizeZeroFreesMemAndReturnsNullPointer);
19 RUN_TEST_CASE(UnityFixture, CallocFillsWithZero);
20 RUN_TEST_CASE(UnityFixture, PointerSet);
21 RUN_TEST_CASE(UnityFixture, FreeNULLSafety);
22 RUN_TEST_CASE(UnityFixture, ConcludeTestIncrementsFailCount);
23}
24
25TEST_GROUP_RUNNER(UnityCommandOptions)
26{
27 RUN_TEST_CASE(UnityCommandOptions, DefaultOptions);
28 RUN_TEST_CASE(UnityCommandOptions, OptionVerbose);
29 RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroup);
30 RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByName);
31 RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount);
32 RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount);
33 RUN_TEST_CASE(UnityCommandOptions, MultipleOptions);
34 RUN_TEST_CASE(UnityCommandOptions, MultipleOptionsDashRNotLastAndNoValueSpecified);
35 RUN_TEST_CASE(UnityCommandOptions, UnknownCommandIsIgnored);
36 RUN_TEST_CASE(UnityCommandOptions, GroupOrNameFilterWithoutStringFails);
37 RUN_TEST_CASE(UnityCommandOptions, GroupFilterReallyFilters);
38 RUN_TEST_CASE(UnityCommandOptions, TestShouldBeIgnored);
39}
40
41TEST_GROUP_RUNNER(LeakDetection)
42{
43 RUN_TEST_CASE(LeakDetection, DetectsLeak);
44 RUN_TEST_CASE(LeakDetection, BufferOverrunFoundDuringFree);
45 RUN_TEST_CASE(LeakDetection, BufferOverrunFoundDuringRealloc);
46 RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringFree);
47 RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringRealloc);
48 RUN_TEST_CASE(LeakDetection, PointerSettingMax);
49}
50
51TEST_GROUP_RUNNER(InternalMalloc)
52{
53 RUN_TEST_CASE(InternalMalloc, MallocPastBufferFails);
54 RUN_TEST_CASE(InternalMalloc, CallocPastBufferFails);
55 RUN_TEST_CASE(InternalMalloc, MallocThenReallocGrowsMemoryInPlace);
56 RUN_TEST_CASE(InternalMalloc, ReallocFailDoesNotFreeMem);
57}