mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-08-06 13:50:49 +08:00
Rearrange details to always print if given, no matter if another msg added or not.
Print output on failures no matter if verbose or not. Enforce that HEX comparisons are unsigned comparisons.
This commit is contained in:
@ -173,7 +173,7 @@ module RakefileHelpers
|
||||
def execute(command_string, ok_to_fail = false)
|
||||
report command_string if $verbose
|
||||
output = `#{command_string}`.chomp
|
||||
report(output) if $verbose && !output.nil? && !output.empty?
|
||||
report(output) if ($verbose && !output.nil? && !output.empty?) || (!$?.nil? && !$?.exitstatus.zero? && !ok_to_fail)
|
||||
raise "Command failed. (Returned #{$?.exitstatus})" if !$?.nil? && !$?.exitstatus.zero? && !ok_to_fail
|
||||
output
|
||||
end
|
||||
|
@ -1133,6 +1133,18 @@ void testHEX64ArrayWithinDelta(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testHEX64ArrayWithinDeltaShouldNotHaveSignIssues(void)
|
||||
{
|
||||
#ifndef UNITY_SUPPORT_64
|
||||
TEST_IGNORE();
|
||||
#else
|
||||
UNITY_UINT64 expected[] = {0x7FFFFFFFFFFFFFFF, 0x8000000000000000};
|
||||
UNITY_UINT64 actualBigDelta[] = {0x8000000000000000, 0x7FFFFFFFFFFFFFFF};
|
||||
|
||||
TEST_ASSERT_HEX64_ARRAY_WITHIN(1, expected, actualBigDelta, 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
void testHEX64ArrayWithinDeltaAndMessage(void)
|
||||
{
|
||||
#ifndef UNITY_SUPPORT_64
|
||||
@ -1287,6 +1299,14 @@ void testHEX32ArrayWithinDelta(void)
|
||||
TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 3);
|
||||
}
|
||||
|
||||
void testHEX32ArrayWithinDeltaShouldNotHaveSignIssues(void)
|
||||
{
|
||||
UNITY_UINT32 expected[] = {0x7FFFFFFF, 0x80000000};
|
||||
UNITY_UINT32 actualBigDelta[] = {0x80000000, 0x7FFFFFFF};
|
||||
|
||||
TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualBigDelta, 2);
|
||||
}
|
||||
|
||||
void testHEX32ArrayWithinDeltaAndMessage(void)
|
||||
{
|
||||
UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277};
|
||||
@ -1398,6 +1418,14 @@ void testHEX16ArrayWithinDelta(void)
|
||||
TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 3);
|
||||
}
|
||||
|
||||
void testHEX16ArrayWithinDeltaShouldNotHaveSignIssues(void)
|
||||
{
|
||||
UNITY_UINT16 expected[] = {0x7FFF, 0x8000};
|
||||
UNITY_UINT16 actualBigDelta[] = {0x8000, 0x7FFF};
|
||||
|
||||
TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualBigDelta, 2);
|
||||
}
|
||||
|
||||
void testHEX16ArrayWithinDeltaAndMessage(void)
|
||||
{
|
||||
UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277};
|
||||
@ -1528,6 +1556,14 @@ void testHEX8ArrayNotWithinDelta(void)
|
||||
VERIFY_FAILS_END
|
||||
}
|
||||
|
||||
void testHEX8ArrayWithinDeltaShouldNotHaveSignIssues(void)
|
||||
{
|
||||
UNITY_UINT8 expected[] = {0x7F, 0x80};
|
||||
UNITY_UINT8 actualBigDelta[] = {0x80, 0x7F};
|
||||
|
||||
TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualBigDelta, 2);
|
||||
}
|
||||
|
||||
void testHEX8ArrayNotWithinDeltaAndMessage(void)
|
||||
{
|
||||
UNITY_UINT8 expected[] = {0x34, 0x22, 0x77};
|
||||
|
@ -800,6 +800,11 @@ void testHEX32sWithinDelta(void)
|
||||
TEST_ASSERT_HEX32_WITHIN(5, 5000, 5005);
|
||||
}
|
||||
|
||||
void testHEX32sWithinDeltaShouldIgnoreSign(void)
|
||||
{
|
||||
TEST_ASSERT_HEX32_WITHIN(1, 0x7FFFFFFF, 0x80000000);
|
||||
}
|
||||
|
||||
void testHEX32sWithinDeltaAndCustomMessage(void)
|
||||
{
|
||||
TEST_ASSERT_HEX32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message.");
|
||||
@ -842,6 +847,11 @@ void testHEX16sWithinDelta(void)
|
||||
TEST_ASSERT_HEX16_WITHIN(5, 5000, 5005);
|
||||
}
|
||||
|
||||
void testHEX16sWithinDeltaShouldIgnoreSign(void)
|
||||
{
|
||||
TEST_ASSERT_HEX16_WITHIN(1, 0x7FFF, 0x8000);
|
||||
}
|
||||
|
||||
void testHEX16sWithinDeltaAndCustomMessage(void)
|
||||
{
|
||||
TEST_ASSERT_HEX16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message.");
|
||||
@ -880,6 +890,11 @@ void testHEX8sWithinDelta(void)
|
||||
TEST_ASSERT_HEX8_WITHIN(5, 1, 4);
|
||||
}
|
||||
|
||||
void testHEX8sWithinDeltaShouldIgnoreSign(void)
|
||||
{
|
||||
TEST_ASSERT_HEX8_WITHIN(1, 0x7F, 0x80);
|
||||
}
|
||||
|
||||
void testHEX8sWithinDeltaAndCustomMessage(void)
|
||||
{
|
||||
TEST_ASSERT_HEX8_WITHIN_MESSAGE(1, 254, 255, "Custom Message.");
|
||||
|
@ -652,6 +652,15 @@ void testHEX64sWithinDelta(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testHEX32sWithinDeltaShouldIgnoreSign(void)
|
||||
{
|
||||
#ifndef UNITY_SUPPORT_64
|
||||
TEST_IGNORE();
|
||||
#else
|
||||
TEST_ASSERT_HEX64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x8000000000000000);
|
||||
#endif
|
||||
}
|
||||
|
||||
void testHEX64sNotWithinDelta(void)
|
||||
{
|
||||
#ifndef UNITY_SUPPORT_64
|
||||
|
Reference in New Issue
Block a user