mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 08:25:58 +01:00
Add test for function pointers in parameterized tests
This commit is contained in:
1
test/testdata/Defs.h
vendored
1
test/testdata/Defs.h
vendored
@@ -4,5 +4,6 @@
|
||||
#define EXTERN_DECL
|
||||
|
||||
extern int CounterSuiteSetup;
|
||||
extern int isArgumentOne(int i);
|
||||
|
||||
#endif
|
||||
|
||||
11
test/testdata/testRunnerGenerator.c
vendored
11
test/testdata/testRunnerGenerator.c
vendored
@@ -167,6 +167,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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user