mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-12-18 14:40:15 +08:00
Merge pull request #254 from jsalling/cleanup/clang-format
Formatting source code to existing style
This commit is contained in:
@@ -5,9 +5,9 @@
|
|||||||
* [Released under MIT License. Please refer to license.txt for details]
|
* [Released under MIT License. Please refer to license.txt for details]
|
||||||
* ========================================== */
|
* ========================================== */
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include "unity_fixture.h"
|
#include "unity_fixture.h"
|
||||||
#include "unity_internals.h"
|
#include "unity_internals.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
struct UNITY_FIXTURE_T UnityFixture;
|
struct UNITY_FIXTURE_T UnityFixture;
|
||||||
|
|
||||||
@@ -71,7 +71,8 @@ void UnityTestRunner(unityfunction* setup,
|
|||||||
const char* printableName,
|
const char* printableName,
|
||||||
const char* group,
|
const char* group,
|
||||||
const char* name,
|
const char* name,
|
||||||
const char* file, unsigned int line)
|
const char* file,
|
||||||
|
unsigned int line)
|
||||||
{
|
{
|
||||||
if (testSelected(name) && groupSelected(group))
|
if (testSelected(name) && groupSelected(group))
|
||||||
{
|
{
|
||||||
@@ -395,7 +396,9 @@ int UnityGetCommandLineOptions(int argc, const char* argv[])
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* ignore unknown parameter */
|
/* ignore unknown parameter */
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
21
src/unity.c
21
src/unity.c
@@ -180,8 +180,7 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number)
|
|||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
|
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
|
||||||
divisor /= 10;
|
divisor /= 10;
|
||||||
}
|
} while (divisor > 0);
|
||||||
while (divisor > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
@@ -417,7 +416,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);
|
UnityPrint(UnityStrExpected);
|
||||||
if (expected != NULL)
|
if (expected != NULL)
|
||||||
@@ -443,8 +444,6 @@ static void UnityPrintExpectedAndActualStringsLen(const char* expected, const ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------
|
/*-----------------------------------------------
|
||||||
* Assertion & Control Helpers
|
* Assertion & Control Helpers
|
||||||
*-----------------------------------------------*/
|
*-----------------------------------------------*/
|
||||||
@@ -580,7 +579,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
|
|
||||||
if (expect_val != actual_val)
|
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 */
|
{ /* For UINT, remove sign extension (padding 1's) from signed type casts above */
|
||||||
UNITY_INT mask = 1;
|
UNITY_INT mask = 1;
|
||||||
mask = (mask << 8 * length) - 1;
|
mask = (mask << 8 * length) - 1;
|
||||||
@@ -621,12 +620,11 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
|
|
||||||
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
|
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
|
||||||
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
|
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
|
||||||
do { \
|
{ \
|
||||||
UnityPrint(UnityStrExpected); \
|
UnityPrint(UnityStrExpected); \
|
||||||
UnityPrintFloat(expected); \
|
UnityPrintFloat(expected); \
|
||||||
UnityPrint(UnityStrWas); \
|
UnityPrint(UnityStrWas); \
|
||||||
UnityPrintFloat(actual); \
|
UnityPrintFloat(actual); }
|
||||||
} while(0)
|
|
||||||
#else
|
#else
|
||||||
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
|
#define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
|
||||||
UnityPrint(UnityStrDelta)
|
UnityPrint(UnityStrDelta)
|
||||||
@@ -880,7 +878,6 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* not UNITY_EXCLUDE_DOUBLE */
|
#endif /* not UNITY_EXCLUDE_DOUBLE */
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
@@ -1001,7 +998,6 @@ void UnityAssertEqualStringLen(const char* expected,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
void UnityAssertEqualStringArray(const char** expected,
|
void UnityAssertEqualStringArray(const char** expected,
|
||||||
const char** actual,
|
const char** actual,
|
||||||
@@ -1364,7 +1360,8 @@ int UnityStringArgumentMatches(const char* str)
|
|||||||
/* look for the start of the next partial */
|
/* look for the start of the next partial */
|
||||||
ptr2 = ptr1;
|
ptr2 = ptr1;
|
||||||
ptrf = 0;
|
ptrf = 0;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
ptr2++;
|
ptr2++;
|
||||||
if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
|
if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
|
||||||
ptrf = &ptr2[1];
|
ptrf = &ptr2[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user