1
0
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:
Erik Flodin
2022-10-13 22:13:03 +02:00
parent 37b61d2be2
commit 76b7e359cc
2 changed files with 33 additions and 3 deletions

View File

@@ -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++;
}