Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenlwip_check.h
Go to the documentation of this file.
00001 #ifndef __LWIP_CHECK_H__ 00002 #define __LWIP_CHECK_H__ 00003 00004 /* Common header file for lwIP unit tests using the check framework */ 00005 00006 #include <config.h> 00007 #include <check.h> 00008 #include <stdlib.h> 00009 00010 #define FAIL_RET() do { fail(); return; } while(0) 00011 #define EXPECT(x) fail_unless(x) 00012 #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 00013 #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 00014 #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 00015 00017 typedef Suite* (suite_getter_fn)(void); 00018 00020 static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 00021 { 00022 size_t i; 00023 Suite *s = suite_create(name); 00024 00025 for(i = 0; i < num_tests; i++) { 00026 /* Core test case */ 00027 TCase *tc_core = tcase_create("Core"); 00028 if ((setup != NULL) || (teardown != NULL)) { 00029 tcase_add_checked_fixture(tc_core, setup, teardown); 00030 } 00031 tcase_add_test(tc_core, tests[i]); 00032 suite_add_tcase(s, tc_core); 00033 } 00034 return s; 00035 } 00036 00037 #endif /* __LWIP_CHECK_H__ */ Generated on Sun May 27 2012 04:36:11 for ReactOS by
1.7.6.1
|