summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-09-30 17:54:21 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-10-01 09:21:14 +0100
commit66e47aa39f9cd3666e610fab78caa0c7d8f9c410 (patch)
tree380fecc6b7c9fa33f41f5d4f4413a634de26bb5e
parent1ae15f66af2af17e991ab028ca16a1200fd5f4e5 (diff)
downloadlibnice-66e47aa39f9cd3666e610fab78caa0c7d8f9c410.tar.gz
tests: Use g_assert_cmpuint() to make test failures easier to diagnose
Now we can actually see the priority numbers which are unequal. Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D300
-rw-r--r--tests/test-priority.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test-priority.c b/tests/test-priority.c
index 4e41db5..4b5a0ea 100644
--- a/tests/test-priority.c
+++ b/tests/test-priority.c
@@ -52,36 +52,36 @@ main (void)
nice_address_set_from_string (&candidate->base_addr, "127.0.0.1");
/* test 1 */
- g_assert (nice_candidate_jingle_priority (candidate) == 1000);
+ g_assert_cmpuint (nice_candidate_jingle_priority (candidate), ==, 1000);
/* Host UDP */
candidate->transport = NICE_CANDIDATE_TRANSPORT_UDP;
candidate->component_id = 1;
- g_assert (nice_candidate_ice_priority (candidate, FALSE, FALSE) == 0x780001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, FALSE, FALSE), ==, 0x780001FF);
/* Host UDP reliable */
- g_assert (nice_candidate_ice_priority (candidate, TRUE, FALSE) == 0x3C0001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, TRUE, FALSE), ==, 0x3C0001FF);
/* Host tcp-active unreliable */
candidate->transport = NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE;
- g_assert (nice_candidate_ice_priority (candidate, FALSE, FALSE) == 0x3CC001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, FALSE, FALSE), ==, 0x3CC001FF);
/* Host tcp-active reliable */
candidate->transport = NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE;
/* Host tcp-active reliable */
- g_assert (nice_candidate_ice_priority (candidate, TRUE, FALSE) == 0x78C001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, TRUE, FALSE), ==, 0x78C001FF);
/* srv-reflexive tcp-active reliable */
candidate->type = NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE;
candidate->transport = NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE;
- g_assert (nice_candidate_ice_priority (candidate, TRUE, FALSE) == 0x648001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, TRUE, FALSE), ==, 0x648001FF);
/* nat-assisted srv-reflexive tcp-active reliable */
- g_assert (nice_candidate_ice_priority (candidate, TRUE, TRUE) == 0x698001FF);
+ g_assert_cmpuint (nice_candidate_ice_priority (candidate, TRUE, TRUE), ==, 0x698001FF);
nice_candidate_free (candidate);
/* test 2 */
/* 2^32*MIN(O,A) + 2*MAX(O,A) + (O>A?1:0)
= 2^32*1 + 2*5000 + 0
= 4294977296 */
- g_assert (nice_candidate_pair_priority (1,5000) == 4294977296LL);
+ g_assert_cmpuint (nice_candidate_pair_priority (1,5000), ==, 4294977296LL);
/* 2^32*1 + 2*5000 + 1 = 4294977297 */
- g_assert (nice_candidate_pair_priority (5000, 1) == 4294977297LL);
+ g_assert_cmpuint (nice_candidate_pair_priority (5000, 1), ==, 4294977297LL);
return 0;
}