source: azure_iot_hub_f767zi/trunk/asp_baseplatform/lwip/lwip-2.1.2/test/unit/lwip_check.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.2 KB
Line 
1#ifndef LWIP_HDR_LWIP_CHECK_H
2#define LWIP_HDR_LWIP_CHECK_H
3
4/* Common header file for lwIP unit tests using the check framework */
5
6#include <config.h>
7#include <check.h>
8#include <stdlib.h>
9
10#define FAIL_RET() do { fail(); return; } while(0)
11#define EXPECT(x) fail_unless(x)
12#define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0)
13#define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0)
14#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
15
16typedef struct {
17 TFun func;
18 const char *name;
19} testfunc;
20
21#define TESTFUNC(x) {(x), "" # x "" }
22
23/* Modified function from check.h, supplying function name */
24#define tcase_add_named_test(tc,tf) \
25 _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1)
26
27/** typedef for a function returning a test suite */
28typedef Suite* (suite_getter_fn)(void);
29
30/** Create a test suite */
31Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown);
32
33#ifdef LWIP_UNITTESTS_LIB
34int lwip_unittests_run(void)
35#endif
36
37/* helper functions */
38#define SKIP_POOL(x) (1 << x)
39#define SKIP_HEAP (1 << MEMP_MAX)
40void lwip_check_ensure_no_alloc(unsigned int skip);
41
42#endif /* LWIP_HDR_LWIP_CHECK_H */
Note: See TracBrowser for help on using the repository browser.