ReactOS  0.4.14-dev-999-g61c8d34
test_udp.c File Reference
#include "test_udp.h"
#include "lwip/udp.h"
#include "lwip/stats.h"
Include dependency graph for test_udp.c:

Go to the source code of this file.

Functions

static void udp_remove_all (void)
 
static void udp_setup (void)
 
static void udp_teardown (void)
 
 START_TEST (test_udp_new_remove)
 
END_TEST Suite * udp_suite (void)
 

Function Documentation

◆ START_TEST()

START_TEST ( test_udp_new_remove  )

Definition at line 42 of file test_udp.c.

43 {
44  struct udp_pcb* pcb;
45  LWIP_UNUSED_ARG(_i);
46 
47  fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
48 
49  pcb = udp_new();
50  fail_unless(pcb != NULL);
51  if (pcb != NULL) {
52  fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1);
53  udp_remove(pcb);
54  fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
55  }
56 }
smooth NULL
Definition: ftsmooth.c:416
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:73

◆ udp_remove_all()

static void udp_remove_all ( void  )
static

Definition at line 12 of file test_udp.c.

13 {
14  struct udp_pcb *pcb = udp_pcbs;
15  struct udp_pcb *pcb2;
16 
17  while(pcb != NULL) {
18  pcb2 = pcb;
19  pcb = pcb->next;
20  udp_remove(pcb2);
21  }
22  fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
23 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by udp_setup(), and udp_teardown().

◆ udp_setup()

static void udp_setup ( void  )
static

Definition at line 28 of file test_udp.c.

29 {
31 }
static void udp_remove_all(void)
Definition: test_udp.c:12

Referenced by udp_suite().

◆ udp_suite()

END_TEST Suite* udp_suite ( void  )

Create the suite including all tests for this module

Definition at line 62 of file test_udp.c.

63 {
64  TFun tests[] = {
65  test_udp_new_remove,
66  };
67  return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown);
68 }
struct param_test tests[]
static Suite * create_suite(const char *name, TFun *tests, size_t num_tests, SFun setup, SFun teardown)
Definition: lwip_check.h:20
static void udp_teardown(void)
Definition: test_udp.c:34
static void udp_setup(void)
Definition: test_udp.c:28

Referenced by main().

◆ udp_teardown()

static void udp_teardown ( void  )
static

Definition at line 34 of file test_udp.c.

35 {
37 }
static void udp_remove_all(void)
Definition: test_udp.c:12

Referenced by udp_suite().