mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-16 18:03:44 +08:00
Fixed more compiler warnings for unit tests
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
|
||||
|
||||
typedef struct {
|
||||
TFun func;
|
||||
const char *name;
|
||||
TFun func;
|
||||
const char *name;
|
||||
} testfunc;
|
||||
|
||||
#define TESTFUNC(x) {(x), "" # x "" }
|
||||
@@ -28,20 +28,10 @@ typedef struct {
|
||||
typedef Suite* (suite_getter_fn)(void);
|
||||
|
||||
/** Create a test suite */
|
||||
static Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
|
||||
{
|
||||
size_t i;
|
||||
Suite *s = suite_create(name);
|
||||
Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown);
|
||||
|
||||
for(i = 0; i < num_tests; i++) {
|
||||
TCase *tc_core = tcase_create(name);
|
||||
if ((setup != NULL) || (teardown != NULL)) {
|
||||
tcase_add_checked_fixture(tc_core, setup, teardown);
|
||||
}
|
||||
tcase_add_named_test(tc_core, tests[i]);
|
||||
suite_add_tcase(s, tc_core);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
#ifdef LWIP_UNITTESTS_LIB
|
||||
int lwip_unittests_run(void)
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_HDR_LWIP_CHECK_H__ */
|
||||
|
||||
Reference in New Issue
Block a user