summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-02-13 18:50:07 +0100
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2020-05-04 20:39:12 +0000
commit65fd9663acd083f8c27d473dd263da2e4d693fb1 (patch)
tree334f612e74956497a8b86198c6d631b92be2f713 /tests
parentad88bc3d06ac61987e49b4c8f4caa3d452ddfda0 (diff)
discovery: add a unique local preference value per turn server
This value is built from the position in the component turn servers list, and from the base address network interface position in the list of network interfaces. This value is used to ensure a unique candidate priority for each one. Also ensure that the fields that compose the local preference don't overlap, by checking their maximum value. See RFC-8445, section 5.1.2.2 "Guidelines for Choosing Type and Local Preferences".
Diffstat (limited to 'tests')
-rw-r--r--tests/test-priority.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test-priority.c b/tests/test-priority.c
index 87b2ea4..2ffcd24 100644
--- a/tests/test-priority.c
+++ b/tests/test-priority.c
@@ -41,6 +41,7 @@
#include "agent.h"
#include "agent-priv.h"
#include "interfaces.h"
+#include "candidate.h"
int
@@ -62,6 +63,9 @@ main (void)
}
g_list_free_full (ips, g_free);
+ /* test 0 */
+ g_assert (ip_local_preference <= NICE_CANDIDATE_MAX_LOCAL_ADDRESSES);
+
/* test 1 */
g_assert_cmpuint (nice_candidate_jingle_priority (candidate), ==, 1000);
/* Host UDP */