diff --git a/test/jbuf.c b/test/jbuf.c index 35ef95ba1d..89760850ae 100644 --- a/test/jbuf.c +++ b/test/jbuf.c @@ -33,11 +33,7 @@ int test_jbuf(void) } /* Empty list */ - if (ENOENT != jbuf_get(jb, &hdr2, &mem)) { - err = EINVAL; - goto out; - } - + ASSERT_EQ(ENOENT, jbuf_get(jb, &hdr2, &mem)); /* One frame */ memset(&hdr, 0, sizeof(hdr)); @@ -45,12 +41,12 @@ int test_jbuf(void) hdr.ts = 1; err = jbuf_put(jb, &hdr, frv[0]); TEST_ERR(err); - if ((EALREADY != jbuf_put(jb, &hdr, frv[0]))) {err = EINVAL; goto out;} + ASSERT_EQ(EALREADY, jbuf_put(jb, &hdr, frv[0])); err = jbuf_get(jb, &hdr2, &mem); TEST_ERR(err); - if (160 != hdr2.seq) {err = EINVAL; goto out;} - if (mem != frv[0]) {err = EINVAL; goto out;} + ASSERT_EQ(160, hdr2.seq); + ASSERT_EQ(frv[0], mem); mem = mem_deref(mem); if (ENOENT != jbuf_get(jb, &hdr2, &mem)) {err = EINVAL; goto out;} @@ -65,8 +61,7 @@ int test_jbuf(void) err = jbuf_put(jb, &hdr, frv[1]); TEST_ERR(err); - err = jbuf_get(jb, &hdr2, &mem); - ASSERT_EQ(EAGAIN, err); + ASSERT_EQ(EAGAIN, jbuf_get(jb, &hdr2, &mem)); if (320 != hdr2.seq) {err = EINVAL; goto out;} if (mem != frv[0]) {err = EINVAL; goto out;} mem = mem_deref(mem); @@ -99,8 +94,7 @@ int test_jbuf(void) if (mem != frv[0]) {err = EINVAL; goto out;} mem = mem_deref(mem); - err = jbuf_get(jb, &hdr2, &mem); - ASSERT_EQ(EAGAIN, err); + ASSERT_EQ(EAGAIN, jbuf_get(jb, &hdr2, &mem)); if (800 != hdr2.seq) {err = EINVAL; goto out;} if (mem != frv[1]) {err = EINVAL; goto out;} mem = mem_deref(mem); @@ -124,7 +118,7 @@ int test_jbuf(void) } -int test_jbuf_adaptive(void) +int test_jbuf_frames(void) { struct rtp_header hdr, hdr2; struct jbuf *jb = NULL; @@ -140,8 +134,6 @@ int test_jbuf_adaptive(void) err = jbuf_alloc(&jb, 1, 10); TEST_ERR(err); - err = jbuf_set_type(jb, JBUF_ADAPTIVE); - TEST_ERR(err); for (i=0; i