mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Squashed 'tests/unity/' changes from 2988e98..1f52255
1f52255 Merge pull request #267 from FSMaxB/fix-wconversion 7bce0b4 Fix warning with ubsan and -Wconversion b5da224 Merge pull request #266 from FSMaxB/fix-double-promotion 1bf22d3 Fix warnings with -Wdouble-promotion git-subtree-dir: tests/unity git-subtree-split: 1f522558a6c4577aa937341bf856ba3b1436768a
This commit is contained in:
parent
1f422b586a
commit
2c45ad7816
@ -194,7 +194,7 @@ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
|
|||||||
while (nibbles > 0)
|
while (nibbles > 0)
|
||||||
{
|
{
|
||||||
nibbles--;
|
nibbles--;
|
||||||
nibble = (number >> (nibbles * 4)) & 0x0F;
|
nibble = (int)(number >> (nibbles * 4)) & 0x0F;
|
||||||
if (nibble <= 9)
|
if (nibble <= 9)
|
||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR((char)('0' + nibble));
|
UNITY_OUTPUT_CHAR((char)('0' + nibble));
|
||||||
@ -669,7 +669,7 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected,
|
|||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrElement);
|
UnityPrint(UnityStrElement);
|
||||||
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
||||||
UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual);
|
UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
@ -691,7 +691,7 @@ void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
|
|||||||
if (!UnityFloatsWithin(delta, expected, actual))
|
if (!UnityFloatsWithin(delta, expected, actual))
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual);
|
UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
@ -746,7 +746,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
|
|||||||
UnityPrint(trait_names[trait_index]);
|
UnityPrint(trait_names[trait_index]);
|
||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
|
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
|
||||||
UnityPrintFloat(actual);
|
UnityPrintFloat((UNITY_DOUBLE)actual);
|
||||||
#else
|
#else
|
||||||
if (should_be_trait)
|
if (should_be_trait)
|
||||||
UnityPrint(UnityStrNot);
|
UnityPrint(UnityStrNot);
|
||||||
|
Loading…
Reference in New Issue
Block a user