ceedling 0.24.0 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ceedling +6 -1
- data/docs/CeedlingPacket.md +9 -0
- data/lib/ceedling/generator.rb +2 -2
- data/lib/ceedling/generator_test_runner.rb +32 -1
- data/lib/ceedling/rakefile.rb +1 -1
- data/lib/ceedling/system_wrapper.rb +13 -10
- data/lib/ceedling/tool_executor.rb +2 -2
- data/lib/ceedling/version.rb +1 -1
- data/plugins/command_hooks/README.md +52 -0
- data/plugins/command_hooks/lib/command_hooks.rb +71 -0
- data/plugins/module_generator/lib/module_generator.rb +10 -4
- data/plugins/module_generator/module_generator.rake +2 -2
- data/spec/spec_system_helper.rb +16 -11
- data/spec/system/deployment_spec.rb +2 -2
- data/vendor/c_exception/vendor/unity/auto/generate_module.rb +77 -34
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +1 -1
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +3 -3
- data/vendor/c_exception/vendor/unity/src/unity.c +105 -105
- data/vendor/c_exception/vendor/unity/src/unity.h +8 -8
- data/vendor/c_exception/vendor/unity/src/unity_internals.h +139 -139
- data/vendor/c_exception/vendor/unity/test/tests/testunity.c +141 -142
- data/vendor/cmock/lib/cmock_generator.rb +2 -1
- data/vendor/cmock/test/c/TestCMockC.c +1 -1
- data/vendor/cmock/test/system/test_interactions/unity_64bit_support.yml +13 -13
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +4 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +77 -34
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +3 -3
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +105 -105
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +8 -8
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +139 -139
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +141 -142
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +77 -34
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +1 -1
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +3 -3
- data/vendor/cmock/vendor/unity/src/unity.c +105 -105
- data/vendor/cmock/vendor/unity/src/unity.h +8 -8
- data/vendor/cmock/vendor/unity/src/unity_internals.h +139 -139
- data/vendor/cmock/vendor/unity/test/tests/testunity.c +141 -142
- data/vendor/unity/auto/generate_module.rb +77 -34
- data/vendor/unity/extras/fixture/src/unity_fixture.c +1 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +3 -3
- data/vendor/unity/src/unity.c +105 -105
- data/vendor/unity/src/unity.h +8 -8
- data/vendor/unity/src/unity_internals.h +139 -139
- data/vendor/unity/test/tests/testunity.c +141 -142
- metadata +4 -2
@@ -13,14 +13,14 @@ extern "C"
|
|
13
13
|
{
|
14
14
|
#endif
|
15
15
|
|
16
|
-
struct
|
16
|
+
struct UNITY_FIXTURE_T
|
17
17
|
{
|
18
18
|
int Verbose;
|
19
19
|
unsigned int RepeatCount;
|
20
20
|
const char* NameFilter;
|
21
21
|
const char* GroupFilter;
|
22
22
|
};
|
23
|
-
extern struct
|
23
|
+
extern struct UNITY_FIXTURE_T UnityFixture;
|
24
24
|
|
25
25
|
typedef void unityfunction(void);
|
26
26
|
void UnityTestRunner(unityfunction* setup,
|
@@ -138,8 +138,8 @@ TEST(UnityFixture, FreeNULLSafety)
|
|
138
138
|
|
139
139
|
TEST(UnityFixture, ConcludeTestIncrementsFailCount)
|
140
140
|
{
|
141
|
-
|
142
|
-
|
141
|
+
UNITY_UINT savedFails = Unity.TestFailures;
|
142
|
+
UNITY_UINT savedIgnores = Unity.TestIgnores;
|
143
143
|
UnityOutputCharSpy_Enable(1);
|
144
144
|
Unity.CurrentTestFailed = 1;
|
145
145
|
UnityConcludeFixtureTest(); /* Resets TestFailed for this test to pass */
|
@@ -301,7 +301,7 @@ TEST(UnityCommandOptions, GroupOrNameFilterWithoutStringFails)
|
|
301
301
|
|
302
302
|
TEST(UnityCommandOptions, GroupFilterReallyFilters)
|
303
303
|
{
|
304
|
-
|
304
|
+
UNITY_UINT saved = Unity.NumberOfTests;
|
305
305
|
TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(4, unknownCommand));
|
306
306
|
UnityIgnoreTest(NULL, "non-matching", NULL);
|
307
307
|
TEST_ASSERT_EQUAL(saved, Unity.NumberOfTests);
|
@@ -19,7 +19,7 @@ void UNITY_OUTPUT_CHAR(int);
|
|
19
19
|
/* return prematurely if we are already in failure or ignore state */
|
20
20
|
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
|
21
21
|
|
22
|
-
struct
|
22
|
+
struct UNITY_STORAGE_T Unity;
|
23
23
|
|
24
24
|
static const char UnityStrOk[] = "OK";
|
25
25
|
static const char UnityStrPass[] = "PASS";
|
@@ -55,7 +55,7 @@ static const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
|
|
55
55
|
static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
|
56
56
|
|
57
57
|
/* compiler-generic print formatting masks */
|
58
|
-
static const
|
58
|
+
static const UNITY_UINT UnitySizeMask[] =
|
59
59
|
{
|
60
60
|
255u, /* 0xFF */
|
61
61
|
65535u, /* 0xFFFF */
|
@@ -103,21 +103,21 @@ void UnityPrint(const char* string)
|
|
103
103
|
{
|
104
104
|
UNITY_OUTPUT_CHAR('\\');
|
105
105
|
UNITY_OUTPUT_CHAR('x');
|
106
|
-
UnityPrintNumberHex((
|
106
|
+
UnityPrintNumberHex((UNITY_UINT)*pch, 2);
|
107
107
|
}
|
108
108
|
pch++;
|
109
109
|
}
|
110
110
|
}
|
111
111
|
}
|
112
112
|
|
113
|
-
void UnityPrintLen(const char* string, const
|
114
|
-
void UnityPrintLen(const char* string, const
|
113
|
+
void UnityPrintLen(const char* string, const UNITY_UINT32 length);
|
114
|
+
void UnityPrintLen(const char* string, const UNITY_UINT32 length)
|
115
115
|
{
|
116
116
|
const char* pch = string;
|
117
117
|
|
118
118
|
if (pch != NULL)
|
119
119
|
{
|
120
|
-
while (*pch && (
|
120
|
+
while (*pch && (UNITY_UINT32)(pch - string) < length)
|
121
121
|
{
|
122
122
|
/* printable characters plus CR & LF are printed */
|
123
123
|
if ((*pch <= 126) && (*pch >= 32))
|
@@ -141,7 +141,7 @@ void UnityPrintLen(const char* string, const _UU32 length)
|
|
141
141
|
{
|
142
142
|
UNITY_OUTPUT_CHAR('\\');
|
143
143
|
UNITY_OUTPUT_CHAR('x');
|
144
|
-
UnityPrintNumberHex((
|
144
|
+
UnityPrintNumberHex((UNITY_UINT)*pch, 2);
|
145
145
|
}
|
146
146
|
pch++;
|
147
147
|
}
|
@@ -149,7 +149,7 @@ void UnityPrintLen(const char* string, const _UU32 length)
|
|
149
149
|
}
|
150
150
|
|
151
151
|
/*-----------------------------------------------*/
|
152
|
-
void UnityPrintNumberByStyle(const
|
152
|
+
void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style)
|
153
153
|
{
|
154
154
|
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
155
155
|
{
|
@@ -157,35 +157,35 @@ void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T s
|
|
157
157
|
}
|
158
158
|
else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT)
|
159
159
|
{
|
160
|
-
UnityPrintNumberUnsigned( (
|
160
|
+
UnityPrintNumberUnsigned( (UNITY_UINT)number & UnitySizeMask[((UNITY_UINT)style & (UNITY_UINT)0x0F) - 1] );
|
161
161
|
}
|
162
162
|
else
|
163
163
|
{
|
164
164
|
UNITY_OUTPUT_CHAR('0');
|
165
165
|
UNITY_OUTPUT_CHAR('x');
|
166
|
-
UnityPrintNumberHex((
|
166
|
+
UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0x000F) << 1));
|
167
167
|
}
|
168
168
|
}
|
169
169
|
|
170
170
|
/*-----------------------------------------------*/
|
171
|
-
void UnityPrintNumber(const
|
171
|
+
void UnityPrintNumber(const UNITY_INT number_to_print)
|
172
172
|
{
|
173
|
-
|
173
|
+
UNITY_UINT number = (UNITY_UINT)number_to_print;
|
174
174
|
|
175
175
|
if (number_to_print < 0)
|
176
176
|
{
|
177
177
|
/* A negative number, including MIN negative */
|
178
178
|
UNITY_OUTPUT_CHAR('-');
|
179
|
-
number = (
|
179
|
+
number = (UNITY_UINT)(-number_to_print);
|
180
180
|
}
|
181
181
|
UnityPrintNumberUnsigned(number);
|
182
182
|
}
|
183
183
|
|
184
184
|
/*-----------------------------------------------
|
185
185
|
* basically do an itoa using as little ram as possible */
|
186
|
-
void UnityPrintNumberUnsigned(const
|
186
|
+
void UnityPrintNumberUnsigned(const UNITY_UINT number)
|
187
187
|
{
|
188
|
-
|
188
|
+
UNITY_UINT divisor = 1;
|
189
189
|
|
190
190
|
/* figure out initial divisor */
|
191
191
|
while (number / divisor > 9)
|
@@ -203,9 +203,9 @@ void UnityPrintNumberUnsigned(const _U_UINT number)
|
|
203
203
|
}
|
204
204
|
|
205
205
|
/*-----------------------------------------------*/
|
206
|
-
void UnityPrintNumberHex(const
|
206
|
+
void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
|
207
207
|
{
|
208
|
-
|
208
|
+
UNITY_UINT nibble;
|
209
209
|
char nibbles = nibbles_to_print;
|
210
210
|
|
211
211
|
while (nibbles > 0)
|
@@ -223,10 +223,10 @@ void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print)
|
|
223
223
|
}
|
224
224
|
|
225
225
|
/*-----------------------------------------------*/
|
226
|
-
void UnityPrintMask(const
|
226
|
+
void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number)
|
227
227
|
{
|
228
|
-
|
229
|
-
|
228
|
+
UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1);
|
229
|
+
UNITY_INT32 i;
|
230
230
|
|
231
231
|
for (i = 0; i < UNITY_INT_WIDTH; i++)
|
232
232
|
{
|
@@ -261,7 +261,7 @@ void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
|
|
261
261
|
# endif
|
262
262
|
#endif
|
263
263
|
|
264
|
-
void UnityPrintFloat(
|
264
|
+
void UnityPrintFloat(UNITY_DOUBLE number)
|
265
265
|
{
|
266
266
|
char TempBuffer[UNITY_VERBOSE_NUMBER_MAX_LENGTH + 1];
|
267
267
|
snprintf(TempBuffer, sizeof(TempBuffer), "%.6f", number);
|
@@ -290,7 +290,7 @@ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
|
290
290
|
#ifndef UNITY_FIXTURES
|
291
291
|
UnityPrint(file);
|
292
292
|
UNITY_OUTPUT_CHAR(':');
|
293
|
-
UnityPrintNumber((
|
293
|
+
UnityPrintNumber((UNITY_INT)line);
|
294
294
|
UNITY_OUTPUT_CHAR(':');
|
295
295
|
UnityPrint(Unity.CurrentTestName);
|
296
296
|
UNITY_OUTPUT_CHAR(':');
|
@@ -389,7 +389,7 @@ static void UnityPrintExpectedAndActualStrings(const char* expected, const char*
|
|
389
389
|
}
|
390
390
|
|
391
391
|
/*-----------------------------------------------*/
|
392
|
-
static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const
|
392
|
+
static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const UNITY_UINT32 length)
|
393
393
|
{
|
394
394
|
UnityPrint(UnityStrExpected);
|
395
395
|
if (expected != NULL)
|
@@ -453,9 +453,9 @@ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_P
|
|
453
453
|
* Assertion Functions
|
454
454
|
*-----------------------------------------------*/
|
455
455
|
|
456
|
-
void UnityAssertBits(const
|
457
|
-
const
|
458
|
-
const
|
456
|
+
void UnityAssertBits(const UNITY_INT mask,
|
457
|
+
const UNITY_INT expected,
|
458
|
+
const UNITY_INT actual,
|
459
459
|
const char* msg,
|
460
460
|
const UNITY_LINE_TYPE lineNumber)
|
461
461
|
{
|
@@ -465,17 +465,17 @@ void UnityAssertBits(const _U_SINT mask,
|
|
465
465
|
{
|
466
466
|
UnityTestResultsFailBegin(lineNumber);
|
467
467
|
UnityPrint(UnityStrExpected);
|
468
|
-
UnityPrintMask((
|
468
|
+
UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected);
|
469
469
|
UnityPrint(UnityStrWas);
|
470
|
-
UnityPrintMask((
|
470
|
+
UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual);
|
471
471
|
UnityAddMsgIfSpecified(msg);
|
472
472
|
UNITY_FAIL_AND_BAIL;
|
473
473
|
}
|
474
474
|
}
|
475
475
|
|
476
476
|
/*-----------------------------------------------*/
|
477
|
-
void UnityAssertEqualNumber(const
|
478
|
-
const
|
477
|
+
void UnityAssertEqualNumber(const UNITY_INT expected,
|
478
|
+
const UNITY_INT actual,
|
479
479
|
const char* msg,
|
480
480
|
const UNITY_LINE_TYPE lineNumber,
|
481
481
|
const UNITY_DISPLAY_STYLE_T style)
|
@@ -504,12 +504,12 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|
504
504
|
/*-----------------------------------------------*/
|
505
505
|
void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
506
506
|
UNITY_INTERNAL_PTR actual,
|
507
|
-
const
|
507
|
+
const UNITY_UINT32 num_elements,
|
508
508
|
const char* msg,
|
509
509
|
const UNITY_LINE_TYPE lineNumber,
|
510
510
|
const UNITY_DISPLAY_STYLE_T style)
|
511
511
|
{
|
512
|
-
|
512
|
+
UNITY_UINT32 elements = num_elements;
|
513
513
|
UNITY_INTERNAL_PTR ptr_exp = (UNITY_INTERNAL_PTR)expected;
|
514
514
|
UNITY_INTERNAL_PTR ptr_act = (UNITY_INTERNAL_PTR)actual;
|
515
515
|
|
@@ -533,20 +533,20 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|
533
533
|
case UNITY_DISPLAY_STYLE_UINT8:
|
534
534
|
while (elements--)
|
535
535
|
{
|
536
|
-
if (*(UNITY_PTR_ATTRIBUTE const
|
536
|
+
if (*(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)ptr_act)
|
537
537
|
{
|
538
538
|
UnityTestResultsFailBegin(lineNumber);
|
539
539
|
UnityPrint(UnityStrElement);
|
540
540
|
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
541
541
|
UnityPrint(UnityStrExpected);
|
542
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
542
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)ptr_exp, style);
|
543
543
|
UnityPrint(UnityStrWas);
|
544
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
544
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)ptr_act, style);
|
545
545
|
UnityAddMsgIfSpecified(msg);
|
546
546
|
UNITY_FAIL_AND_BAIL;
|
547
547
|
}
|
548
|
-
ptr_exp = (UNITY_INTERNAL_PTR)((
|
549
|
-
ptr_act = (UNITY_INTERNAL_PTR)((
|
548
|
+
ptr_exp = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_exp + 1);
|
549
|
+
ptr_act = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_act + 1);
|
550
550
|
}
|
551
551
|
break;
|
552
552
|
case UNITY_DISPLAY_STYLE_HEX16:
|
@@ -554,20 +554,20 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|
554
554
|
case UNITY_DISPLAY_STYLE_UINT16:
|
555
555
|
while (elements--)
|
556
556
|
{
|
557
|
-
if (*(UNITY_PTR_ATTRIBUTE const
|
557
|
+
if (*(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)ptr_act)
|
558
558
|
{
|
559
559
|
UnityTestResultsFailBegin(lineNumber);
|
560
560
|
UnityPrint(UnityStrElement);
|
561
561
|
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
562
562
|
UnityPrint(UnityStrExpected);
|
563
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
563
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)ptr_exp, style);
|
564
564
|
UnityPrint(UnityStrWas);
|
565
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
565
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)ptr_act, style);
|
566
566
|
UnityAddMsgIfSpecified(msg);
|
567
567
|
UNITY_FAIL_AND_BAIL;
|
568
568
|
}
|
569
|
-
ptr_exp = (UNITY_INTERNAL_PTR)((
|
570
|
-
ptr_act = (UNITY_INTERNAL_PTR)((
|
569
|
+
ptr_exp = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_exp + 2);
|
570
|
+
ptr_act = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_act + 2);
|
571
571
|
}
|
572
572
|
break;
|
573
573
|
#ifdef UNITY_SUPPORT_64
|
@@ -576,40 +576,40 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|
576
576
|
case UNITY_DISPLAY_STYLE_UINT64:
|
577
577
|
while (elements--)
|
578
578
|
{
|
579
|
-
if (*(UNITY_PTR_ATTRIBUTE const
|
579
|
+
if (*(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)ptr_act)
|
580
580
|
{
|
581
581
|
UnityTestResultsFailBegin(lineNumber);
|
582
582
|
UnityPrint(UnityStrElement);
|
583
583
|
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
584
584
|
UnityPrint(UnityStrExpected);
|
585
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
585
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)ptr_exp, style);
|
586
586
|
UnityPrint(UnityStrWas);
|
587
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
587
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)ptr_act, style);
|
588
588
|
UnityAddMsgIfSpecified(msg);
|
589
589
|
UNITY_FAIL_AND_BAIL;
|
590
590
|
}
|
591
|
-
ptr_exp = (UNITY_INTERNAL_PTR)((
|
592
|
-
ptr_act = (UNITY_INTERNAL_PTR)((
|
591
|
+
ptr_exp = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_exp + 8);
|
592
|
+
ptr_act = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_act + 8);
|
593
593
|
}
|
594
594
|
break;
|
595
595
|
#endif
|
596
596
|
default:
|
597
597
|
while (elements--)
|
598
598
|
{
|
599
|
-
if (*(UNITY_PTR_ATTRIBUTE const
|
599
|
+
if (*(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)ptr_act)
|
600
600
|
{
|
601
601
|
UnityTestResultsFailBegin(lineNumber);
|
602
602
|
UnityPrint(UnityStrElement);
|
603
603
|
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
604
604
|
UnityPrint(UnityStrExpected);
|
605
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
605
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)ptr_exp, style);
|
606
606
|
UnityPrint(UnityStrWas);
|
607
|
-
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const
|
607
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)ptr_act, style);
|
608
608
|
UnityAddMsgIfSpecified(msg);
|
609
609
|
UNITY_FAIL_AND_BAIL;
|
610
610
|
}
|
611
|
-
ptr_exp = (UNITY_INTERNAL_PTR)((
|
612
|
-
ptr_act = (UNITY_INTERNAL_PTR)((
|
611
|
+
ptr_exp = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_exp + 4);
|
612
|
+
ptr_act = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_act + 4);
|
613
613
|
}
|
614
614
|
break;
|
615
615
|
}
|
@@ -632,21 +632,21 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|
632
632
|
#endif
|
633
633
|
|
634
634
|
#ifndef UNITY_EXCLUDE_FLOAT
|
635
|
-
static int UnityFloatsWithin(
|
635
|
+
static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual)
|
636
636
|
{
|
637
|
-
|
637
|
+
UNITY_FLOAT diff;
|
638
638
|
UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff);
|
639
639
|
}
|
640
640
|
|
641
|
-
void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const
|
642
|
-
UNITY_PTR_ATTRIBUTE const
|
643
|
-
const
|
641
|
+
void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected,
|
642
|
+
UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual,
|
643
|
+
const UNITY_UINT32 num_elements,
|
644
644
|
const char* msg,
|
645
645
|
const UNITY_LINE_TYPE lineNumber)
|
646
646
|
{
|
647
|
-
|
648
|
-
UNITY_PTR_ATTRIBUTE const
|
649
|
-
UNITY_PTR_ATTRIBUTE const
|
647
|
+
UNITY_UINT32 elements = num_elements;
|
648
|
+
UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected;
|
649
|
+
UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual;
|
650
650
|
|
651
651
|
UNITY_SKIP_EXECUTION;
|
652
652
|
|
@@ -682,9 +682,9 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
|
|
682
682
|
}
|
683
683
|
|
684
684
|
/*-----------------------------------------------*/
|
685
|
-
void UnityAssertFloatsWithin(const
|
686
|
-
const
|
687
|
-
const
|
685
|
+
void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
|
686
|
+
const UNITY_FLOAT expected,
|
687
|
+
const UNITY_FLOAT actual,
|
688
688
|
const char* msg,
|
689
689
|
const UNITY_LINE_TYPE lineNumber)
|
690
690
|
{
|
@@ -708,15 +708,15 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|
708
708
|
}
|
709
709
|
|
710
710
|
/*-----------------------------------------------*/
|
711
|
-
void UnityAssertFloatSpecial(const
|
711
|
+
void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
|
712
712
|
const char* msg,
|
713
713
|
const UNITY_LINE_TYPE lineNumber,
|
714
714
|
const UNITY_FLOAT_TRAIT_T style)
|
715
715
|
{
|
716
716
|
const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet };
|
717
|
-
|
718
|
-
|
719
|
-
|
717
|
+
UNITY_INT should_be_trait = ((UNITY_INT)style & 1);
|
718
|
+
UNITY_INT is_trait = !should_be_trait;
|
719
|
+
UNITY_INT trait_index = (UNITY_INT)(style >> 1);
|
720
720
|
|
721
721
|
UNITY_SKIP_EXECUTION;
|
722
722
|
|
@@ -775,21 +775,21 @@ void UnityAssertFloatSpecial(const _UF actual,
|
|
775
775
|
|
776
776
|
/*-----------------------------------------------*/
|
777
777
|
#ifndef UNITY_EXCLUDE_DOUBLE
|
778
|
-
static int UnityDoublesWithin(
|
778
|
+
static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual)
|
779
779
|
{
|
780
|
-
|
780
|
+
UNITY_DOUBLE diff;
|
781
781
|
UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff);
|
782
782
|
}
|
783
783
|
|
784
|
-
void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const
|
785
|
-
UNITY_PTR_ATTRIBUTE const
|
786
|
-
const
|
784
|
+
void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected,
|
785
|
+
UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual,
|
786
|
+
const UNITY_UINT32 num_elements,
|
787
787
|
const char* msg,
|
788
788
|
const UNITY_LINE_TYPE lineNumber)
|
789
789
|
{
|
790
|
-
|
791
|
-
UNITY_PTR_ATTRIBUTE const
|
792
|
-
UNITY_PTR_ATTRIBUTE const
|
790
|
+
UNITY_UINT32 elements = num_elements;
|
791
|
+
UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected;
|
792
|
+
UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual;
|
793
793
|
|
794
794
|
UNITY_SKIP_EXECUTION;
|
795
795
|
|
@@ -825,9 +825,9 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
|
|
825
825
|
}
|
826
826
|
|
827
827
|
/*-----------------------------------------------*/
|
828
|
-
void UnityAssertDoublesWithin(const
|
829
|
-
const
|
830
|
-
const
|
828
|
+
void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
|
829
|
+
const UNITY_DOUBLE expected,
|
830
|
+
const UNITY_DOUBLE actual,
|
831
831
|
const char* msg,
|
832
832
|
const UNITY_LINE_TYPE lineNumber)
|
833
833
|
{
|
@@ -851,15 +851,15 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|
851
851
|
|
852
852
|
/*-----------------------------------------------*/
|
853
853
|
|
854
|
-
void UnityAssertDoubleSpecial(const
|
854
|
+
void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
|
855
855
|
const char* msg,
|
856
856
|
const UNITY_LINE_TYPE lineNumber,
|
857
857
|
const UNITY_FLOAT_TRAIT_T style)
|
858
858
|
{
|
859
859
|
const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet };
|
860
|
-
|
861
|
-
|
862
|
-
|
860
|
+
UNITY_INT should_be_trait = ((UNITY_INT)style & 1);
|
861
|
+
UNITY_INT is_trait = !should_be_trait;
|
862
|
+
UNITY_INT trait_index = (UNITY_INT)(style >> 1);
|
863
863
|
|
864
864
|
UNITY_SKIP_EXECUTION;
|
865
865
|
|
@@ -918,9 +918,9 @@ void UnityAssertDoubleSpecial(const _UD actual,
|
|
918
918
|
#endif /* not UNITY_EXCLUDE_DOUBLE */
|
919
919
|
|
920
920
|
/*-----------------------------------------------*/
|
921
|
-
void UnityAssertNumbersWithin( const
|
922
|
-
const
|
923
|
-
const
|
921
|
+
void UnityAssertNumbersWithin( const UNITY_UINT delta,
|
922
|
+
const UNITY_INT expected,
|
923
|
+
const UNITY_INT actual,
|
924
924
|
const char* msg,
|
925
925
|
const UNITY_LINE_TYPE lineNumber,
|
926
926
|
const UNITY_DISPLAY_STYLE_T style)
|
@@ -930,23 +930,23 @@ void UnityAssertNumbersWithin( const _U_UINT delta,
|
|
930
930
|
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
931
931
|
{
|
932
932
|
if (actual > expected)
|
933
|
-
Unity.CurrentTestFailed = ((
|
933
|
+
Unity.CurrentTestFailed = ((UNITY_UINT)(actual - expected) > delta);
|
934
934
|
else
|
935
|
-
Unity.CurrentTestFailed = ((
|
935
|
+
Unity.CurrentTestFailed = ((UNITY_UINT)(expected - actual) > delta);
|
936
936
|
}
|
937
937
|
else
|
938
938
|
{
|
939
|
-
if ((
|
940
|
-
Unity.CurrentTestFailed = ((
|
939
|
+
if ((UNITY_UINT)actual > (UNITY_UINT)expected)
|
940
|
+
Unity.CurrentTestFailed = ((UNITY_UINT)(actual - expected) > delta);
|
941
941
|
else
|
942
|
-
Unity.CurrentTestFailed = ((
|
942
|
+
Unity.CurrentTestFailed = ((UNITY_UINT)(expected - actual) > delta);
|
943
943
|
}
|
944
944
|
|
945
945
|
if (Unity.CurrentTestFailed)
|
946
946
|
{
|
947
947
|
UnityTestResultsFailBegin(lineNumber);
|
948
948
|
UnityPrint(UnityStrDelta);
|
949
|
-
UnityPrintNumberByStyle((
|
949
|
+
UnityPrintNumberByStyle((UNITY_INT)delta, style);
|
950
950
|
UnityPrint(UnityStrExpected);
|
951
951
|
UnityPrintNumberByStyle(expected, style);
|
952
952
|
UnityPrint(UnityStrWas);
|
@@ -962,7 +962,7 @@ void UnityAssertEqualString(const char* expected,
|
|
962
962
|
const char* msg,
|
963
963
|
const UNITY_LINE_TYPE lineNumber)
|
964
964
|
{
|
965
|
-
|
965
|
+
UNITY_UINT32 i;
|
966
966
|
|
967
967
|
UNITY_SKIP_EXECUTION;
|
968
968
|
|
@@ -998,11 +998,11 @@ void UnityAssertEqualString(const char* expected,
|
|
998
998
|
/*-----------------------------------------------*/
|
999
999
|
void UnityAssertEqualStringLen(const char* expected,
|
1000
1000
|
const char* actual,
|
1001
|
-
const
|
1001
|
+
const UNITY_UINT32 length,
|
1002
1002
|
const char* msg,
|
1003
1003
|
const UNITY_LINE_TYPE lineNumber)
|
1004
1004
|
{
|
1005
|
-
|
1005
|
+
UNITY_UINT32 i;
|
1006
1006
|
|
1007
1007
|
UNITY_SKIP_EXECUTION;
|
1008
1008
|
|
@@ -1039,11 +1039,11 @@ void UnityAssertEqualStringLen(const char* expected,
|
|
1039
1039
|
/*-----------------------------------------------*/
|
1040
1040
|
void UnityAssertEqualStringArray( const char** expected,
|
1041
1041
|
const char** actual,
|
1042
|
-
const
|
1042
|
+
const UNITY_UINT32 num_elements,
|
1043
1043
|
const char* msg,
|
1044
1044
|
const UNITY_LINE_TYPE lineNumber)
|
1045
1045
|
{
|
1046
|
-
|
1046
|
+
UNITY_UINT32 i, j = 0;
|
1047
1047
|
|
1048
1048
|
UNITY_SKIP_EXECUTION;
|
1049
1049
|
|
@@ -1096,15 +1096,15 @@ void UnityAssertEqualStringArray( const char** expected,
|
|
1096
1096
|
/*-----------------------------------------------*/
|
1097
1097
|
void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
|
1098
1098
|
UNITY_INTERNAL_PTR actual,
|
1099
|
-
const
|
1100
|
-
const
|
1099
|
+
const UNITY_UINT32 length,
|
1100
|
+
const UNITY_UINT32 num_elements,
|
1101
1101
|
const char* msg,
|
1102
1102
|
const UNITY_LINE_TYPE lineNumber)
|
1103
1103
|
{
|
1104
1104
|
UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected;
|
1105
1105
|
UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual;
|
1106
|
-
|
1107
|
-
|
1106
|
+
UNITY_UINT32 elements = num_elements;
|
1107
|
+
UNITY_UINT32 bytes;
|
1108
1108
|
|
1109
1109
|
UNITY_SKIP_EXECUTION;
|
1110
1110
|
|
@@ -1139,8 +1139,8 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
|
|
1139
1139
|
UnityAddMsgIfSpecified(msg);
|
1140
1140
|
UNITY_FAIL_AND_BAIL;
|
1141
1141
|
}
|
1142
|
-
ptr_exp = (UNITY_INTERNAL_PTR)((
|
1143
|
-
ptr_act = (UNITY_INTERNAL_PTR)((
|
1142
|
+
ptr_exp = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_exp + 1);
|
1143
|
+
ptr_act = (UNITY_INTERNAL_PTR)((UNITY_PTR)ptr_act + 1);
|
1144
1144
|
}
|
1145
1145
|
}
|
1146
1146
|
}
|
@@ -1249,11 +1249,11 @@ int UnityEnd(void)
|
|
1249
1249
|
UNITY_PRINT_EOL();
|
1250
1250
|
UnityPrint(UnityStrBreaker);
|
1251
1251
|
UNITY_PRINT_EOL();
|
1252
|
-
UnityPrintNumber((
|
1252
|
+
UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests));
|
1253
1253
|
UnityPrint(UnityStrResultsTests);
|
1254
|
-
UnityPrintNumber((
|
1254
|
+
UnityPrintNumber((UNITY_INT)(Unity.TestFailures));
|
1255
1255
|
UnityPrint(UnityStrResultsFailures);
|
1256
|
-
UnityPrintNumber((
|
1256
|
+
UnityPrintNumber((UNITY_INT)(Unity.TestIgnores));
|
1257
1257
|
UnityPrint(UnityStrResultsIgnored);
|
1258
1258
|
UNITY_PRINT_EOL();
|
1259
1259
|
if (Unity.TestFailures == 0U)
|
@@ -107,10 +107,10 @@ void tearDown(void);
|
|
107
107
|
#define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL)
|
108
108
|
#define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL)
|
109
109
|
#define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL)
|
110
|
-
#define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (
|
111
|
-
#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (
|
112
|
-
#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((
|
113
|
-
#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((
|
110
|
+
#define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, NULL)
|
111
|
+
#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, NULL)
|
112
|
+
#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, NULL)
|
113
|
+
#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, NULL)
|
114
114
|
|
115
115
|
/* Integer Ranges (of all sizes) */
|
116
116
|
#define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL)
|
@@ -212,10 +212,10 @@ void tearDown(void);
|
|
212
212
|
#define TEST_ASSERT_EQUAL_HEX32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message))
|
213
213
|
#define TEST_ASSERT_EQUAL_HEX64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, (message))
|
214
214
|
#define TEST_ASSERT_BITS_MESSAGE(mask, expected, actual, message) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, (message))
|
215
|
-
#define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (
|
216
|
-
#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (
|
217
|
-
#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((
|
218
|
-
#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((
|
215
|
+
#define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, (message))
|
216
|
+
#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message))
|
217
|
+
#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message))
|
218
|
+
#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message))
|
219
219
|
|
220
220
|
/* Integer Ranges (of all sizes) */
|
221
221
|
#define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message))
|