mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Improve handling of space in TEST_CASE/RANGE
The fix in 285bb6e282 didn't completly fix the issue.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
/* Support for Meta Test Rig */
|
||||
#define TEST_CASE(...)
|
||||
#define TEST_RANGE(...)
|
||||
|
||||
/* Include Passthroughs for Linking Tests */
|
||||
void putcharSpy(int c) { (void)putchar(c);}
|
||||
@@ -48,11 +49,13 @@ static int SetToOneToFailInTearDown;
|
||||
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
||||
static unsigned NextExpectedStringIndex;
|
||||
static unsigned NextExpectedCharIndex;
|
||||
static unsigned NextExpectedSpaceIndex;
|
||||
|
||||
void suiteSetUp(void)
|
||||
{
|
||||
NextExpectedStringIndex = 0;
|
||||
NextExpectedCharIndex = 0;
|
||||
NextExpectedSpaceIndex = 0;
|
||||
}
|
||||
|
||||
void setUp(void)
|
||||
@@ -169,3 +172,25 @@ void test_CharsArePreserved(unsigned index, char c)
|
||||
|
||||
NextExpectedCharIndex++;
|
||||
}
|
||||
|
||||
TEST_CASE(0,
|
||||
|
||||
1)
|
||||
TEST_CASE(1,
|
||||
|
||||
2
|
||||
|
||||
)
|
||||
TEST_RANGE([2,
|
||||
5 ,
|
||||
1], [6, 6, 1])
|
||||
TEST_CASE(
|
||||
|
||||
6 , 7)
|
||||
void test_SpaceInTestCase(unsigned index, unsigned bigger)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_UINT32(NextExpectedSpaceIndex, index);
|
||||
TEST_ASSERT_LESS_THAN(bigger, index);
|
||||
|
||||
NextExpectedSpaceIndex++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user