[Git][NTPsec/ntpsec][master] Added test for refid_str.

Ian Bruene gitlab at mg.gitlab.com
Mon Jul 30 23:27:00 UTC 2018


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
ed5d672c by Ian Bruene at 2018-07-30T23:26:55Z
Added test for refid_str.

- - - - -


1 changed file:

- tests/libntp/numtoa.c


Changes:

=====================================
tests/libntp/numtoa.c
=====================================
@@ -25,7 +25,19 @@ TEST(numtoa, Netmask) {
 	TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input));
 }
 
+TEST(numtoa, RefidStr) {
+	const char *res;
+
+	// Test stratum > 1
+	res = refid_str(0x11223344, 8);
+	TEST_ASSERT_EQUAL_STRING("68.51.34.17", res);
+	// Test !(stratum > 1)
+	res = refid_str(0x535047, 0);
+	TEST_ASSERT_EQUAL_STRING(".GPS.", res);
+}
+
 TEST_GROUP_RUNNER(numtoa) {
 	RUN_TEST_CASE(numtoa, Address);
 	RUN_TEST_CASE(numtoa, Netmask);
+	RUN_TEST_CASE(numtoa, RefidStr);
 }



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ed5d672c8bfa90f2ac659df9a16ef51c4bc52c43

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ed5d672c8bfa90f2ac659df9a16ef51c4bc52c43
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180730/3846e073/attachment-0001.html>


More information about the vc mailing list