[Git][NTPsec/ntpsec][master] Fixes refid_str tests for big-endian machines.
Hal Murray
gitlab at mg.gitlab.com
Sun Aug 26 08:58:27 UTC 2018
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
94fc06ec by Fred Wright at 2018-08-26T00:17:36Z
Fixes refid_str tests for big-endian machines.
TESTED:
Tests now pass on both x86 and PPC.
- - - - -
1 changed file:
- tests/libntp/numtoa.c
Changes:
=====================================
tests/libntp/numtoa.c
=====================================
@@ -15,10 +15,10 @@ TEST(numtoa, RefidStr) {
const char *res;
// Test stratum > 1
- res = refid_str(0x11223344, 8);
+ res = refid_str(htonl(0x44332211), 8);
TEST_ASSERT_EQUAL_STRING("68.51.34.17", res);
// Test !(stratum > 1)
- res = refid_str(0x535047, 0);
+ res = refid_str(htonl(0x47505300), 0);
TEST_ASSERT_EQUAL_STRING(".GPS.", res);
}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/94fc06ece8beeed90b0c445d9a4f5d33a3804ccf
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/94fc06ece8beeed90b0c445d9a4f5d33a3804ccf
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/20180826/16542e81/attachment.html>
More information about the vc
mailing list