1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-28 02:34:27 +01:00

C89 comment style changes only

This commit is contained in:
jsalling
2016-08-23 23:10:05 -05:00
parent 75ad84c92f
commit 8beb9715be
11 changed files with 106 additions and 107 deletions

View File

@@ -1,9 +1,9 @@
//- Copyright (c) 2010 James Grenning and Contributed to Unity Project
/* ==========================================
Unity Project - A Test Framework for C
Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
[Released under MIT License. Please refer to license.txt for details]
========================================== */
/* Copyright (c) 2010 James Grenning and Contributed to Unity Project
* ==========================================
* Unity Project - A Test Framework for C
* Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
* [Released under MIT License. Please refer to license.txt for details]
* ========================================== */
#include "unity_fixture.h"
#include "unity_output_Spy.h"
@@ -79,7 +79,7 @@ TEST(UnityFixture, ReallocLargerNeeded)
CHECK(m1);
strcpy((char*)m1, "123456789");
m2 = realloc(m1, 15);
// CHECK(m1 != m2); //Depends on implementation
/* CHECK(m1 != m2); //Depends on implementation */
STRCMP_EQUAL("123456789", m2);
free(m2);
}
@@ -142,9 +142,9 @@ TEST(UnityFixture, ConcludeTestIncrementsFailCount)
_U_UINT savedIgnores = Unity.TestIgnores;
UnityOutputCharSpy_Enable(1);
Unity.CurrentTestFailed = 1;
UnityConcludeFixtureTest(); // Resets TestFailed for this test to pass
UnityConcludeFixtureTest(); /* Resets TestFailed for this test to pass */
Unity.CurrentTestIgnored = 1;
UnityConcludeFixtureTest(); // Resets TestIgnored
UnityConcludeFixtureTest(); /* Resets TestIgnored */
UnityOutputCharSpy_Enable(0);
TEST_ASSERT_EQUAL(savedFails + 1, Unity.TestFailures);
TEST_ASSERT_EQUAL(savedIgnores + 1, Unity.TestIgnores);
@@ -152,7 +152,7 @@ TEST(UnityFixture, ConcludeTestIncrementsFailCount)
Unity.TestIgnores = savedIgnores;
}
//------------------------------------------------------------
/*------------------------------------------------------------ */
TEST_GROUP(UnityCommandOptions);
@@ -312,7 +312,7 @@ IGNORE_TEST(UnityCommandOptions, TestShouldBeIgnored)
TEST_FAIL_MESSAGE("This test should not run!");
}
//------------------------------------------------------------
/*------------------------------------------------------------ */
TEST_GROUP(LeakDetection);
@@ -342,7 +342,7 @@ TEST_TEAR_DOWN(LeakDetection)
memcpy(Unity.AbortFrame, TestAbortFrame, sizeof(jmp_buf)); \
}
// This tricky set of defines lets us see if we are using the Spy, returns 1 if true
/* This tricky set of defines lets us see if we are using the Spy, returns 1 if true */
#ifdef __STDC_VERSION__
#if __STDC_VERSION__ >= 199901L
@@ -352,17 +352,17 @@ TEST_TEAR_DOWN(LeakDetection)
#define EXPAND_AND_USE_2ND(a, b) SECOND_PARAM(a, b, throwaway)
#define SECOND_PARAM(a, b, ...) b
#if USING_SPY_AS(UNITY_OUTPUT_CHAR)
#define USING_OUTPUT_SPY // UNITY_OUTPUT_CHAR = UnityOutputCharSpy_OutputChar
#define USING_OUTPUT_SPY /* UNITY_OUTPUT_CHAR = UnityOutputCharSpy_OutputChar */
#endif
#endif // >= 199901
#endif /* >= 199901 */
#else // __STDC_VERSION__ else
#else /* __STDC_VERSION__ else */
#define UnityOutputCharSpy_OutputChar 42
#if UNITY_OUTPUT_CHAR == UnityOutputCharSpy_OutputChar // Works if no -Wundef -Werror
#if UNITY_OUTPUT_CHAR == UnityOutputCharSpy_OutputChar /* Works if no -Wundef -Werror */
#define USING_OUTPUT_SPY
#endif
#undef UnityOutputCharSpy_OutputChar
#endif // __STDC_VERSION__
#endif /* __STDC_VERSION__ */
TEST(LeakDetection, DetectsLeak)
{
@@ -428,7 +428,7 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringFree)
void* m = malloc(10);
char* s = (char*)m;
TEST_ASSERT_NOT_NULL(m);
s[-1] = (char)0x00; // Will not detect 0
s[-1] = (char)0x00; /* Will not detect 0 */
s[-2] = (char)0x01;
UnityOutputCharSpy_Enable(1);
EXPECT_ABORT_BEGIN
@@ -476,7 +476,7 @@ TEST(LeakDetection, PointerSettingMax)
#endif
}
//------------------------------------------------------------
/*------------------------------------------------------------ */
TEST_GROUP(InternalMalloc);
#define TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(first_mem_ptr, ptr) \
@@ -535,9 +535,9 @@ TEST(InternalMalloc, ReallocFailDoesNotFreeMem)
if (out_of_mem == NULL) free(n1);
free(m);
TEST_ASSERT_NOT_NULL(m); // Got a real memory location
TEST_ASSERT_NULL(out_of_mem); // The realloc should have failed
TEST_ASSERT_NOT_EQUAL(n2, n1); // If n1 != n2 then realloc did not free n1
TEST_ASSERT_NOT_NULL(m); /* Got a real memory location */
TEST_ASSERT_NULL(out_of_mem); /* The realloc should have failed */
TEST_ASSERT_NOT_EQUAL(n2, n1); /* If n1 != n2 then realloc did not free n1 */
TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n2);
#endif
}