Skip to content

Commit

Permalink
test: jbuf - remove obsolete adaptive and wish
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 27, 2023
1 parent 4442684 commit c9eb069
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/jbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,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<RE_ARRAY_SIZE(frv); i++) {
frv[i] = mem_zalloc(32, NULL);
Expand All @@ -171,15 +169,15 @@ int test_jbuf_adaptive(void)
TEST_ERR(err);
TEST_EQUALS(EALREADY, jbuf_put(jb, &hdr, frv[0]));

/* wish size is not reached yet */
/* min size is not reached yet */
TEST_EQUALS(ENOENT, jbuf_get(jb, &hdr2, &mem));

hdr.seq = 161;
hdr.ts = 161;
err = jbuf_put(jb, &hdr, frv[1]);
TEST_ERR(err);

/* wish size reached */
/* min size reached */
DEBUG_INFO("n > min reached, read first frame\n");
err = jbuf_get(jb, &hdr2, &mem);
TEST_ERR(err);
Expand Down Expand Up @@ -262,8 +260,6 @@ int test_jbuf_adaptive_video(void)

err = jbuf_alloc(&jb, 1, 10);
TEST_ERR(err);
err = jbuf_set_type(jb, JBUF_ADAPTIVE);
TEST_ERR(err);

for (i=0; i<RE_ARRAY_SIZE(frv); i++) {
frv[i] = mem_zalloc(32, NULL);
Expand Down Expand Up @@ -315,16 +311,16 @@ int test_jbuf_adaptive_video(void)

err = jbuf_get(jb, &hdr2, &mem); /* second packet with unique frame */
mem = mem_deref(mem);
TEST_EQUALS(EAGAIN, err); /* n > wish */
TEST_EQUALS(EAGAIN, err); /* n > min */
TEST_EQUALS(2, hdr2.seq);
TEST_EQUALS(100, hdr2.ts);

err = jbuf_get(jb, &hdr2, &mem);
mem = mem_deref(mem);
TEST_EQUALS(EAGAIN, err); /* n > wish */
TEST_EQUALS(EAGAIN, err); /* n > min */
err = jbuf_get(jb, &hdr2, &mem);
mem = mem_deref(mem);
TEST_ERR(err); /* n == wish */
TEST_ERR(err); /* n == min */
TEST_EQUALS(4, hdr2.seq);
TEST_EQUALS(200, hdr2.ts);

Expand Down

0 comments on commit c9eb069

Please sign in to comment.