Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change to ASSERT_XXX macros, remove EXPECT_XXX macros #885

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions test/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,50 +649,50 @@ int test_rtcp_twcc(void)
(with padding 00 00 03) */
err = rtcp_decode(&msg, buf);
TEST_ERR(err);
EXPECT_EQ(err, 0);
EXPECT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
EXPECT_EQ(msg->r.fb.n, 5);
EXPECT_TRUE(msg->r.fb.fci.twccv != NULL);
EXPECT_EQ(msg->r.fb.fci.twccv->seq, 3);
EXPECT_EQ(msg->r.fb.fci.twccv->count, 9);
EXPECT_EQ(msg->r.fb.fci.twccv->reftime, 17005);
EXPECT_EQ(msg->r.fb.fci.twccv->fbcount, 0);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 2);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 7);
ASSERT_EQ(err, 0);
ASSERT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
ASSERT_EQ(msg->r.fb.n, 5);
ASSERT_TRUE(msg->r.fb.fci.twccv != NULL);
ASSERT_EQ(msg->r.fb.fci.twccv->seq, 3);
ASSERT_EQ(msg->r.fb.fci.twccv->count, 9);
ASSERT_EQ(msg->r.fb.fci.twccv->reftime, 17005);
ASSERT_EQ(msg->r.fb.fci.twccv->fbcount, 0);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 2);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 7);
msg = mem_deref(msg);

/* TWCC n=10 base=12 count=30 reftime=17005 fbcount=1 chunks=6
deltas=23 (with padding 00 00 03) */
err = rtcp_decode(&msg, buf);
TEST_ERR(err);
EXPECT_EQ(err, 0);
EXPECT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
EXPECT_EQ(msg->r.fb.n, 10);
EXPECT_EQ(msg->r.fb.fci.twccv->seq, 12);
EXPECT_EQ(msg->r.fb.fci.twccv->count, 30);
EXPECT_EQ(msg->r.fb.fci.twccv->reftime, 17005);
EXPECT_EQ(msg->r.fb.fci.twccv->fbcount, 1);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 6);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 23);
ASSERT_EQ(err, 0);
ASSERT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
ASSERT_EQ(msg->r.fb.n, 10);
ASSERT_EQ(msg->r.fb.fci.twccv->seq, 12);
ASSERT_EQ(msg->r.fb.fci.twccv->count, 30);
ASSERT_EQ(msg->r.fb.fci.twccv->reftime, 17005);
ASSERT_EQ(msg->r.fb.fci.twccv->fbcount, 1);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 6);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 23);
msg = mem_deref(msg);

/* TWCC n=5 base=42 count=11 reftime=17006 fbcount=2 chunks=2
deltas=9 (with padding 01) */
err = rtcp_decode(&msg, buf);
TEST_ERR(err);
EXPECT_EQ(err, 0);
EXPECT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
EXPECT_EQ(msg->r.fb.n, 5);
EXPECT_EQ(msg->r.fb.fci.twccv->seq, 42);
EXPECT_EQ(msg->r.fb.fci.twccv->count, 11);
EXPECT_EQ(msg->r.fb.fci.twccv->reftime, 17006);
EXPECT_EQ(msg->r.fb.fci.twccv->fbcount, 2);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 2);
EXPECT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 9);
ASSERT_EQ(err, 0);
ASSERT_EQ(msg->hdr.count, RTCP_RTPFB_TWCC);
ASSERT_EQ(msg->r.fb.n, 5);
ASSERT_EQ(msg->r.fb.fci.twccv->seq, 42);
ASSERT_EQ(msg->r.fb.fci.twccv->count, 11);
ASSERT_EQ(msg->r.fb.fci.twccv->reftime, 17006);
ASSERT_EQ(msg->r.fb.fci.twccv->fbcount, 2);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->chunks), 2);
ASSERT_EQ(mbuf_get_left(msg->r.fb.fci.twccv->deltas), 9);
msg = mem_deref(msg);

/* Assert we have processed everything. */
EXPECT_EQ(mbuf_get_left(buf), 0);
ASSERT_EQ(mbuf_get_left(buf), 0);

out:
mem_deref(buf);
Expand Down
2 changes: 1 addition & 1 deletion test/stun.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static void stun_resp_handler(int err, uint16_t scode, const char *reason,
++test->n_resp;

/* verify STUN response */
EXPECT_EQ(0, scode);
ASSERT_EQ(0, scode);
TEST_EQUALS(0x0101, stun_msg_type(msg));
TEST_EQUALS(STUN_CLASS_SUCCESS_RESP, stun_msg_class(msg));
TEST_EQUALS(STUN_METHOD_BINDING, stun_msg_method(msg));
Expand Down
3 changes: 0 additions & 3 deletions test/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ extern enum test_mode test_mode;
goto out; \
}

#define EXPECT_EQ ASSERT_EQ
#define EXPECT_TRUE ASSERT_TRUE


/* Module API */
int test_aac(void);
Expand Down