Ran Unity into a source code formatter, no code changes

Used clang-format, which produces noise on stuff you don't care about
and requires setting it up to match the existing code base. Kept the
potentially useful changes, discarded the rest, some manual tweaking
required. It did catch lots of pesky indentation mistakes.
This commit is contained in:
jsalling
2017-01-18 19:48:40 -06:00
parent 04e10f95ee
commit 97e4bd252a
2 changed files with 71 additions and 71 deletions

View File

@ -5,9 +5,9 @@
* [Released under MIT License. Please refer to license.txt for details]
* ========================================== */
#include <string.h>
#include "unity_fixture.h"
#include "unity_internals.h"
#include <string.h>
struct UNITY_FIXTURE_T UnityFixture;
@ -71,7 +71,8 @@ void UnityTestRunner(unityfunction* setup,
const char* printableName,
const char* group,
const char* name,
const char* file, unsigned int line)
const char* file,
unsigned int line)
{
if (testSelected(name) && groupSelected(group))
{
@ -395,7 +396,9 @@ int UnityGetCommandLineOptions(int argc, const char* argv[])
i++;
}
}
} else {
}
else
{
/* ignore unknown parameter */
i++;
}

View File

@ -181,8 +181,7 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number)
{
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
divisor /= 10;
}
while (divisor > 0);
} while (divisor > 0);
}
/*-----------------------------------------------*/
@ -436,7 +435,9 @@ static void UnityPrintExpectedAndActualStrings(const char* expected, const char*
}
/*-----------------------------------------------*/
static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const UNITY_UINT32 length)
static void UnityPrintExpectedAndActualStringsLen(const char* expected,
const char* actual,
const UNITY_UINT32 length)
{
UnityPrint(UnityStrExpected);
if (expected != NULL)
@ -462,8 +463,6 @@ static void UnityPrintExpectedAndActualStringsLen(const char* expected, const ch
}
}
/*-----------------------------------------------
* Assertion & Control Helpers
*-----------------------------------------------*/
@ -599,7 +598,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
if (expect_val != actual_val)
{
if (style & UNITY_DISPLAY_RANGE_UINT && length < sizeof expect_val)
if (style & UNITY_DISPLAY_RANGE_UINT && length < sizeof(expect_val))
{ /* For UINT, remove sign extension (padding 1's) from signed type casts above */
UNITY_INT mask = 1;
mask = (mask << 8 * length) - 1;
@ -640,12 +639,11 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
do { \
{ \
UnityPrint(UnityStrExpected); \
UnityPrintFloat(expected); \
UnityPrint(UnityStrWas); \
UnityPrintFloat(actual); \
} while(0)
UnityPrintFloat(actual); }
#else
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
UnityPrint(UnityStrDelta)
@ -899,7 +897,6 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
}
}
#endif /* not UNITY_EXCLUDE_DOUBLE */
/*-----------------------------------------------*/
@ -1020,7 +1017,6 @@ void UnityAssertEqualStringLen(const char* expected,
}
}
/*-----------------------------------------------*/
void UnityAssertEqualStringArray(const char** expected,
const char** actual,
@ -1383,7 +1379,8 @@ int UnityStringArgumentMatches(const char* str)
/* look for the start of the next partial */
ptr2 = ptr1;
ptrf = 0;
do {
do
{
ptr2++;
if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
ptrf = &ptr2[1];