6#if !LWIP_STATS || !MEM_STATS
7#error "This tests needs MEM-statistics enabled"
37 fail_unless(lwip_stats.mem.used == 0);
40 fail_unless(p1 !=
NULL);
41 fail_unless(lwip_stats.mem.used >=
SIZE1);
42 s1 = lwip_stats.mem.used;
45 fail_unless(p2 !=
NULL);
46 fail_unless(lwip_stats.mem.used >=
SIZE2 +
s1);
47 s2 = lwip_stats.mem.used;
52 fail_unless(lwip_stats.mem.used <=
s2 -
SIZE2);
55 fail_unless(lwip_stats.mem.used == 0);
65 for(
i = 0;
i <
num &&
i < 16;
i++) {
69 for(
i = 0;
i <
num &&
i < 16;
i += freestep) {
76 for(
i = 0;
i <
num &&
i < 16;
i++) {
97 fail_unless(lwip_stats.mem.used == 0);
99 for (
x = 0;
x <
num;
x++) {
101 for (freestep = 1; freestep <= 3; freestep++) {
102 fail_unless(lwip_stats.mem.used == 0);
104 fail_unless(lwip_stats.mem.used == 0);
113 u8_t *
ptr, *ptr_low, *ptr_high;
116 fail_unless(lwip_stats.mem.used == 0);
117 fail_unless(lwip_stats.mem.illegal == 0);
121 fail_unless(lwip_stats.mem.used != 0);
123 ptr_low =
ptr - 0x10;
125 fail_unless(lwip_stats.mem.illegal == 1);
126 lwip_stats.mem.illegal = 0;
130 fail_unless(lwip_stats.mem.illegal == 1);
131 lwip_stats.mem.illegal = 0;
134 fail_unless(lwip_stats.mem.illegal == 0);
135 fail_unless(lwip_stats.mem.used == 0);
141 u8_t *ptr1b, *ptr1, *ptr2, *ptr3;
144 fail_unless(lwip_stats.mem.used == 0);
145 fail_unless(lwip_stats.mem.illegal == 0);
148 fail_unless(ptr1 !=
NULL);
149 fail_unless(lwip_stats.mem.used != 0);
152 fail_unless(ptr2 !=
NULL);
153 fail_unless(lwip_stats.mem.used != 0);
156 fail_unless(ptr3 !=
NULL);
157 fail_unless(lwip_stats.mem.used != 0);
161 fail_unless(lwip_stats.mem.illegal == 0);
165 fail_unless(lwip_stats.mem.illegal == 1);
166 lwip_stats.mem.illegal = 0;
170 fail_unless(lwip_stats.mem.illegal == 0);
173 fail_unless(lwip_stats.mem.illegal == 1);
174 lwip_stats.mem.illegal = 0;
178 fail_unless(lwip_stats.mem.illegal == 0);
179 fail_unless(lwip_stats.mem.used == 0);
182 fail_unless(lwip_stats.mem.illegal == 1);
183 fail_unless(lwip_stats.mem.used == 0);
184 lwip_stats.mem.illegal = 0;
191 fail_unless(ptr1b !=
NULL);
192 fail_unless(lwip_stats.mem.used != 0);
195 fail_unless(lwip_stats.mem.illegal == 1);
196 lwip_stats.mem.illegal = 0;
201 fail_unless(lwip_stats.mem.illegal == 1);
202 lwip_stats.mem.illegal = 0;
205 fail_unless(lwip_stats.mem.illegal == 0);
206 fail_unless(lwip_stats.mem.used == 0);
#define mem_free(ptr, bsize)
void * mem_trim(void *rmem, mem_size_t new_size)
void * mem_malloc(mem_size_t size_in)
#define LWIP_ASSERT(message, assertion)
GLint GLint GLint GLint GLint x
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
#define LWIP_UNUSED_ARG(x)
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)
static struct test_info tests[]
static void mem_teardown(void)
END_TEST Suite * mem_suite(void)
static END_TEST void malloc_keep_x(int x, int num, int size, int freestep)
static void mem_setup(void)