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

Fix: Declare all variables before statements in a function.

Likewise, place all function prototypes before statements.
     These changes support Microsoft Visual Studio 2008 Express Edition,
       which follows C89-style rules.
This commit is contained in:
Bryan A. Jones
2013-01-11 12:56:15 -06:00
parent cfc35610b4
commit 4817d78de3
2 changed files with 10 additions and 7 deletions

View File

@@ -49,10 +49,12 @@ TEST(UnityFixture, PointerSetting)
TEST(UnityFixture, ForceMallocFail)
{
void* m;
void* mfails;
UnityMalloc_MakeMallocFailAfterCount(1);
void* m = malloc(10);
m = malloc(10);
CHECK(m);
void* mfails = malloc(10);
mfails = malloc(10);
TEST_ASSERT_POINTERS_EQUAL(0, mfails);
free(m);
}
@@ -76,8 +78,9 @@ TEST(UnityFixture, ReallocSameIsUnchanged)
TEST(UnityFixture, ReallocLargerNeeded)
{
void* m1 = malloc(10);
void* m2;
strcpy((char*)m1, "123456789");
void* m2 = realloc(m1, 15);
m2 = realloc(m1, 15);
CHECK(m1 != m2);
STRCMP_EQUAL("123456789", m2);
free(m2);