Merge pull request #550 from jannisbaudisch/fix_test_parameterization_regex

Improve regex for test parameterization to support function pointers
This commit is contained in:
Mark VanderVoord
2023-02-06 15:31:49 -05:00
committed by GitHub
4 changed files with 18 additions and 1 deletions
+1
View File
@@ -4,5 +4,6 @@
#define EXTERN_DECL
extern int CounterSuiteSetup;
extern int isArgumentOne(int i);
#endif
+11
View File
@@ -164,6 +164,17 @@ void paratest_ShouldHandleParameterizedTestsThatFail(int Num)
TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail");
}
int isArgumentOne(int i)
{
return i == 1;
}
TEST_CASE(isArgumentOne)
void paratest_WorksWithFunctionPointers(int function(int))
{
TEST_ASSERT_TRUE_MESSAGE(function(1), "Function should return True");
}
#ifdef USE_CEXCEPTION
void extest_ShouldHandleCExceptionInTest(void)
{