More checks on test_mbuf_static

This commit is contained in:
Nils O. Selåsdal
2014-09-29 21:29:02 +02:00
parent 42136087b6
commit 33b48c4276
+8
View File
@@ -221,6 +221,7 @@ START_TEST (test_mbuf_static)
uint8_t data[1024];
struct MBuf mbuf;
uint8_t *p;
uc_mbuf_init(&mbuf, data, 1000, 24, UC_MBUF_FL_STATIC);
@@ -234,6 +235,13 @@ START_TEST (test_mbuf_static)
fail_if(mbuf.cookie != NULL);
fail_if(mbuf.head != mbuf.tail);
fail_if(mbuf.head != &data[24]);
p = uc_mbuf_put(&mbuf, 1000);
fail_if(p == NULL);
memset(p, 0xcc, 1000);
fail_if(uc_mbuf_len(&mbuf) != 1000);
p = uc_mbuf_put(&mbuf, 1);
fail_if(p != NULL);
uc_mbuf_free(&mbuf);