mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-23 21:14:18 +00:00
added unit test to allocate zero length pbufs
This commit is contained in:
parent
4c9b316e6b
commit
7617a76b19
@ -37,6 +37,36 @@ static u8_t testbuf_3[TESTBUFSIZE_3];
|
||||
static u8_t testbuf_3a[TESTBUFSIZE_3];
|
||||
|
||||
/* Test functions */
|
||||
START_TEST(test_pbuf_alloc_zero_pbufs)
|
||||
{
|
||||
struct pbuf *p;
|
||||
LWIP_UNUSED_ARG(_i);
|
||||
|
||||
p = pbuf_alloc(PBUF_RAW, 0, PBUF_ROM);
|
||||
fail_unless(p != NULL);
|
||||
if (p != NULL) {
|
||||
pbuf_free(p);
|
||||
}
|
||||
|
||||
p = pbuf_alloc(PBUF_RAW, 0, PBUF_RAM);
|
||||
fail_unless(p != NULL);
|
||||
if (p != NULL) {
|
||||
pbuf_free(p);
|
||||
}
|
||||
|
||||
p = pbuf_alloc(PBUF_RAW, 0, PBUF_REF);
|
||||
fail_unless(p != NULL);
|
||||
if (p != NULL) {
|
||||
pbuf_free(p);
|
||||
}
|
||||
|
||||
p = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);
|
||||
fail_unless(p != NULL);
|
||||
if (p != NULL) {
|
||||
pbuf_free(p);
|
||||
}
|
||||
}
|
||||
END_TEST
|
||||
|
||||
/** Call pbuf_copy on a pbuf with zero length */
|
||||
START_TEST(test_pbuf_copy_zero_pbuf)
|
||||
@ -229,6 +259,7 @@ Suite *
|
||||
pbuf_suite(void)
|
||||
{
|
||||
testfunc tests[] = {
|
||||
TESTFUNC(test_pbuf_alloc_zero_pbufs),
|
||||
TESTFUNC(test_pbuf_copy_zero_pbuf),
|
||||
TESTFUNC(test_pbuf_split_64k_on_small_pbufs),
|
||||
TESTFUNC(test_pbuf_queueing_bigger_than_64k),
|
||||
|
Loading…
Reference in New Issue
Block a user