Skip to content

Commit

Permalink
More relaxed packet count tests in resolver_test
Browse files Browse the repository at this point in the history
  • Loading branch information
bennylp committed Dec 19, 2024
1 parent 01712f1 commit 97b0949
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pjlib-util/src/pjlib-util-test/resolver_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ static int simple_test(void)


/* Both servers must get packet */
PJ_TEST_EQ(g_server[0].pkt_count, 1, NULL, return -310);
PJ_TEST_EQ(g_server[1].pkt_count, 1, NULL, return -320);
PJ_TEST_GTE(g_server[0].pkt_count, 1, NULL, return -310);
PJ_TEST_GTE(g_server[1].pkt_count, 1, NULL, return -320);

return 0;
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ static int dns_test(void)

/* Both servers must get packet as both are in probing state */
PJ_TEST_GTE(g_server[0].pkt_count, 1, NULL, return -430);
PJ_TEST_EQ(g_server[1].pkt_count, 1, NULL, return -435);
PJ_TEST_GTE(g_server[1].pkt_count, 1, NULL, return -435);

/*
* Check that both servers still receive requests, since they are
Expand All @@ -1113,7 +1113,7 @@ static int dns_test(void)

/* Both servers must get packet as both are in probing & active state */
PJ_TEST_GTE(g_server[0].pkt_count, 1, NULL, return -450);
PJ_TEST_EQ(g_server[1].pkt_count, 1, NULL, return -454);
PJ_TEST_GTE(g_server[1].pkt_count, 1, NULL, return -454);

/* Wait to allow probing period to complete, server 0 will be in bad state */
PJ_LOG(3,(THIS_FILE, " waiting for probing state to end (%d sec)",
Expand Down Expand Up @@ -1143,7 +1143,7 @@ static int dns_test(void)

/* Only server 1 get the request */
PJ_TEST_EQ(g_server[0].pkt_count, 0, NULL, return -470);
PJ_TEST_EQ(g_server[1].pkt_count, 1, NULL, return -474);
PJ_TEST_GTE(g_server[1].pkt_count, 1, NULL, return -474);

/* Wait to allow active & bad period to complete, both will be in probing state */
PJ_LOG(3,(THIS_FILE, " waiting for active NS to expire (%d sec)",
Expand Down Expand Up @@ -1192,7 +1192,7 @@ static int dns_test(void)
pj_thread_sleep(1000);

/* Only good NS should get request */
PJ_TEST_EQ(g_server[0].pkt_count, 1, NULL, return -486);
PJ_TEST_GTE(g_server[0].pkt_count, 1, NULL, return -486);
PJ_TEST_EQ(g_server[1].pkt_count, 0, NULL, return -488);

return 0;
Expand Down

0 comments on commit 97b0949

Please sign in to comment.