[Git][NTPsec/ntpsec][master] decodenetnum: reorder tests for better verbosity on failure.
Gary E. Miller
gitlab at mg.gitlab.com
Wed Apr 12 18:28:53 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
4fbd08a6 by Gary E. Miller at 2017-04-12T11:28:20-07:00
decodenetnum: reorder tests for better verbosity on failure.
- - - - -
1 changed file:
- tests/libntp/decodenetnum.c
Changes:
=====================================
tests/libntp/decodenetnum.c
=====================================
--- a/tests/libntp/decodenetnum.c
+++ b/tests/libntp/decodenetnum.c
@@ -15,6 +15,7 @@ TEST_TEAR_DOWN(decodenetnum) {}
TEST(decodenetnum, IPv4AddressOnly) {
const char *str = "192.0.2.1";
+ bool ret;
sockaddr_u actual;
sockaddr_u expected;
@@ -22,8 +23,9 @@ TEST(decodenetnum, IPv4AddressOnly) {
PSOCK_ADDR4(&expected)->s_addr = inet_addr("192.0.2.1");
SET_PORT(&expected, NTP_PORT);
- TEST_ASSERT_TRUE(decodenetnum(str, &actual));
+ ret = decodenetnum(str, &actual);
TEST_ASSERT_TRUE(IsEqualS(&expected, &actual));
+ TEST_ASSERT_TRUE(ret);
}
TEST(decodenetnum, IPv4AddressWithPort) {
@@ -40,6 +42,7 @@ TEST(decodenetnum, IPv4AddressWithPort) {
}
TEST(decodenetnum, IPv6AddressOnly) {
+ bool ret;
const struct in6_addr address = {{{
0x20, 0x01, 0x0d, 0xb8,
0x85, 0xa3, 0x08, 0xd3,
@@ -55,8 +58,9 @@ TEST(decodenetnum, IPv6AddressOnly) {
SET_SOCK_ADDR6(&expected, address);
SET_PORT(&expected, NTP_PORT);
- TEST_ASSERT_TRUE(decodenetnum(str, &actual));
+ ret = decodenetnum(str, &actual);
TEST_ASSERT_TRUE(IsEqualS(&expected, &actual));
+ TEST_ASSERT_TRUE(ret);
}
TEST(decodenetnum, IPv6AddressWithPort) {
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4fbd08a676be88481350c54e31f42d7777557ec8
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4fbd08a676be88481350c54e31f42d7777557ec8
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/20170412/c5d770da/attachment.html>
More information about the vc
mailing list