ReactOS 0.4.16-dev-736-g28b802b
lwip_check.h File Reference
#include <config.h>
#include <check.h>
#include <stdlib.h>
Include dependency graph for lwip_check.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  testfunc
 

Macros

#define FAIL_RET()   do { fail(); return; } while(0)
 
#define EXPECT(x)   fail_unless(x)
 
#define EXPECT_RET(x)   do { fail_unless(x); if(!(x)) { return; }} while(0)
 
#define EXPECT_RETX(x, y)   do { fail_unless(x); if(!(x)) { return y; }} while(0)
 
#define EXPECT_RETNULL(x)   EXPECT_RETX(x, NULL)
 
#define TESTFUNC(x)   {(x), "" # x "" }
 
#define tcase_add_named_test(tc, tf)    _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1)
 
#define SKIP_POOL(x)   (1 << x)
 
#define SKIP_HEAP   (1 << MEMP_MAX)
 

Typedefs

typedef Suite *() suite_getter_fn(void)
 

Functions

Suite * create_suite (const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
 
void lwip_check_ensure_no_alloc (unsigned int skip)
 

Macro Definition Documentation

◆ EXPECT

#define EXPECT (   x)    fail_unless(x)

Definition at line 11 of file lwip_check.h.

◆ EXPECT_RET

#define EXPECT_RET (   x)    do { fail_unless(x); if(!(x)) { return; }} while(0)

Definition at line 12 of file lwip_check.h.

◆ EXPECT_RETNULL

#define EXPECT_RETNULL (   x)    EXPECT_RETX(x, NULL)

Definition at line 14 of file lwip_check.h.

◆ EXPECT_RETX

#define EXPECT_RETX (   x,
  y 
)    do { fail_unless(x); if(!(x)) { return y; }} while(0)

Definition at line 13 of file lwip_check.h.

◆ FAIL_RET

#define FAIL_RET ( )    do { fail(); return; } while(0)

Definition at line 10 of file lwip_check.h.

◆ SKIP_HEAP

#define SKIP_HEAP   (1 << MEMP_MAX)

Definition at line 49 of file lwip_check.h.

◆ SKIP_POOL

#define SKIP_POOL (   x)    (1 << x)

Definition at line 48 of file lwip_check.h.

◆ tcase_add_named_test

#define tcase_add_named_test (   tc,
  tf 
)     _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1)

Definition at line 25 of file lwip_check.h.

◆ TESTFUNC

#define TESTFUNC (   x)    {(x), "" # x "" }

Definition at line 22 of file lwip_check.h.

Typedef Documentation

◆ suite_getter_fn

typedef Suite *() suite_getter_fn(void)

typedef for a function returning a test suite

Definition at line 38 of file lwip_check.h.

Function Documentation

◆ create_suite()

Suite * create_suite ( const char name,
testfunc tests,
size_t  num_tests,
SFun  setup,
SFun  teardown 
)

Create a test suite

Definition at line 34 of file lwip_unittests.c.

35{
36 size_t i;
37 Suite *s = suite_create(name);
38
39 for(i = 0; i < num_tests; i++) {
40 TCase *tc_core = tcase_create(name);
41 if ((setup != NULL) || (teardown != NULL)) {
42 tcase_add_checked_fixture(tc_core, setup, teardown);
43 }
44 tcase_add_named_test(tc_core, tests[i]);
45 suite_add_tcase(s, tc_core);
46 }
47 return s;
48}
#define NULL
Definition: types.h:112
GLdouble s
Definition: gl.h:2039
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define tcase_add_named_test(tc, tf)
Definition: lwip_check.h:25
static struct test_info tests[]
static void teardown(void)
Definition: enum_files.c:130
static BOOL setup(void)
Definition: enum_files.c:97
Definition: name.c:39

Referenced by def_suite(), dhcp_suite(), dns_suite(), etharp_suite(), ip4_suite(), ip6_suite(), mdns_suite(), mem_suite(), mqtt_suite(), netif_suite(), pbuf_suite(), sockets_suite(), tcp_oos_suite(), tcp_state_suite(), tcp_suite(), timers_suite(), and udp_suite().

◆ lwip_check_ensure_no_alloc()

void lwip_check_ensure_no_alloc ( unsigned int  skip)

Definition at line 50 of file lwip_unittests.c.

51{
52 int i;
53 unsigned int mask;
54
55 if (!(skip & SKIP_HEAP)) {
56 fail_unless(lwip_stats.mem.used == 0,
57 "mem heap still has %d bytes allocated", lwip_stats.mem.used);
58 }
59 for (i = 0, mask = 1; i < MEMP_MAX; i++, mask <<= 1) {
60 if (!(skip & mask)) {
61 fail_unless(lwip_stats.memp[i]->used == 0,
62 "memp pool '%s' still has %d entries allocated",
63 lwip_stats.memp[i]->name, lwip_stats.memp[i]->used);
64 }
65 }
66}
#define skip(...)
Definition: atltest.h:64
GLenum GLint GLuint mask
Definition: glext.h:6028
#define SKIP_HEAP
Definition: lwip_check.h:49
@ MEMP_MAX
Definition: memp.h:55

Referenced by dhcp_setup(), dhcp_teardown(), etharp_setup(), etharp_teardown(), ip4_setup(), ip4_teardown(), mem_setup(), mem_teardown(), mqtt_setup(), mqtt_teardown(), netif_setup(), netif_teardown(), pbuf_setup(), pbuf_teardown(), sockets_setup(), sockets_teardown(), tcp_oos_setup(), tcp_oos_teardown(), tcp_setup(), tcp_state_setup(), tcp_state_teardown(), tcp_teardown(), udp_setup(), and udp_teardown().