tests: Support Check 0.13.0 API
[mattst88]: Keep compatibility with old API via preprocessor Fixes: #43
This commit is contained in:
parent
21324989b7
commit
59e271e15b
|
@ -1,10 +1,19 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "check_suites.h"
|
#include "check_suites.h"
|
||||||
|
|
||||||
|
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
|
||||||
void suite_add_test(Suite *s, TFun tf, const char *name)
|
void suite_add_test(Suite *s, TFun tf, const char *name)
|
||||||
|
#else
|
||||||
|
void suite_add_test(Suite *s, const TTest *tt, const char *name)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
TCase *tc = tcase_create(name);
|
TCase *tc = tcase_create(name);
|
||||||
|
|
||||||
|
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
|
||||||
tcase_add_test(tc, tf);
|
tcase_add_test(tc, tf);
|
||||||
|
#else
|
||||||
|
tcase_add_test(tc, tt);
|
||||||
|
#endif
|
||||||
suite_add_tcase(s, tc);
|
suite_add_tcase(s, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
|
|
||||||
|
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
|
||||||
void suite_add_test(Suite *s, TFun tf, const char *name);
|
void suite_add_test(Suite *s, TFun tf, const char *name);
|
||||||
|
#else
|
||||||
|
void suite_add_test(Suite *s, const TTest *tt, const char *name);
|
||||||
|
#endif
|
||||||
Suite *public_suite(void);
|
Suite *public_suite(void);
|
||||||
|
|
Loading…
Reference in New Issue