From: Damir Tomic Date: Thu, 6 Aug 2015 08:27:35 +0000 (+0200) Subject: Makefile.am: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4ff5b65c53b8764cf91a5aa094442c3492d686a;p=thirdparty%2Fntp.git Makefile.am: small fix socktoa.c, run-decodenetnum.c: update decodenetnum.c: Minor changes due to the autogenerated ruby script run-socktoa.c: Minor changes due to the autogenerated ruby script bk: 55c31a77p2c6e3WYSQjsgSIguW6aOQ --- diff --git a/tests/libntp/decodenetnum.c b/tests/libntp/decodenetnum.c index 39f0320bf..ae25b094a 100644 --- a/tests/libntp/decodenetnum.c +++ b/tests/libntp/decodenetnum.c @@ -6,10 +6,10 @@ extern void test_IPv4AddressOnly(void); extern void test_IPv4AddressWithPort(void); -#ifdef ISC_PLATFORM_HAVEIPV6 +//#ifdef ISC_PLATFORM_HAVEIPV6 extern void test_IPv6AddressOnly(void); extern void test_IPv6AddressWithPort(void); -#endif /* ISC_PLATFORM_HAVEIPV6 */ +//#endif /* ISC_PLATFORM_HAVEIPV6 */ extern void test_IllegalAddress(void); extern void test_IllegalCharInPort(void); @@ -42,9 +42,12 @@ test_IPv4AddressWithPort(void) { TEST_ASSERT_TRUE(IsEqual(expected, actual)); } -#ifdef ISC_PLATFORM_HAVEIPV6 + void test_IPv6AddressOnly(void) { + +#ifdef ISC_PLATFORM_HAVEIPV6 + const struct in6_addr address = { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, @@ -62,12 +65,21 @@ test_IPv6AddressOnly(void) { TEST_ASSERT_TRUE(decodenetnum(str, &actual)); TEST_ASSERT_TRUE(IsEqual(expected, actual)); -} + +#else + TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping."); #endif /* ISC_PLATFORM_HAVEIPV6 */ -#ifdef ISC_PLATFORM_HAVEIPV6 + +} + + + void test_IPv6AddressWithPort(void) { + +#ifdef ISC_PLATFORM_HAVEIPV6 + const struct in6_addr address = { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, @@ -85,9 +97,13 @@ test_IPv6AddressWithPort(void) { TEST_ASSERT_TRUE(decodenetnum(str, &actual)); TEST_ASSERT_TRUE(IsEqual(expected, actual)); -} +#else + TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping."); #endif /* ISC_PLATFORM_HAVEIPV6 */ +} + + void test_IllegalAddress(void) { const char *str = "192.0.2.270:2000"; diff --git a/tests/libntp/run-decodenetnum.c b/tests/libntp/run-decodenetnum.c index 70dd294df..d30b60262 100644 --- a/tests/libntp/run-decodenetnum.c +++ b/tests/libntp/run-decodenetnum.c @@ -24,7 +24,6 @@ #include #include "config.h" #include "ntp_stdlib.h" -#include "ntp_calendar.h" #include "sockaddrtest.h" //=======External Functions This Runner Calls===== @@ -56,10 +55,10 @@ int main(int argc, char *argv[]) UnityBegin("decodenetnum.c"); RUN_TEST(test_IPv4AddressOnly, 7); RUN_TEST(test_IPv4AddressWithPort, 8); - RUN_TEST(test_IPv6AddressOnly, 9); - RUN_TEST(test_IPv6AddressWithPort, 10); - RUN_TEST(test_IllegalAddress, 11); - RUN_TEST(test_IllegalCharInPort, 12); + RUN_TEST(test_IPv6AddressOnly, 10); + RUN_TEST(test_IPv6AddressWithPort, 11); + RUN_TEST(test_IllegalAddress, 13); + RUN_TEST(test_IllegalCharInPort, 14); return (UnityEnd()); } diff --git a/tests/libntp/run-socktoa.c b/tests/libntp/run-socktoa.c index 3cf17a8b3..664bb91b8 100644 --- a/tests/libntp/run-socktoa.c +++ b/tests/libntp/run-socktoa.c @@ -32,10 +32,10 @@ extern void setUp(void); extern void tearDown(void); extern void test_IPv4AddressWithPort(void); extern void test_IPv6AddressWithPort(void); +extern void test_IgnoreIPv6Fields(void); extern void test_ScopedIPv6AddressWithPort(void); extern void test_HashEqual(void); extern void test_HashNotEqual(void); -extern void test_IgnoreIPv6Fields(void); //=======Test Reset Option===== @@ -54,12 +54,12 @@ int main(int argc, char *argv[]) { progname = argv[0]; UnityBegin("socktoa.c"); - RUN_TEST(test_IPv4AddressWithPort, 9); - RUN_TEST(test_IPv6AddressWithPort, 10); - RUN_TEST(test_ScopedIPv6AddressWithPort, 11); - RUN_TEST(test_HashEqual, 12); - RUN_TEST(test_HashNotEqual, 13); - RUN_TEST(test_IgnoreIPv6Fields, 14); + RUN_TEST(test_IPv4AddressWithPort, 10); + RUN_TEST(test_IPv6AddressWithPort, 12); + RUN_TEST(test_IgnoreIPv6Fields, 13); + RUN_TEST(test_ScopedIPv6AddressWithPort, 15); + RUN_TEST(test_HashEqual, 16); + RUN_TEST(test_HashNotEqual, 17); return (UnityEnd()); } diff --git a/tests/libntp/socktoa.c b/tests/libntp/socktoa.c index 6d65fea94..3e73f31dd 100644 --- a/tests/libntp/socktoa.c +++ b/tests/libntp/socktoa.c @@ -8,10 +8,10 @@ void test_IPv4AddressWithPort(void); -#ifdef ISC_PLATFORM_HAVEIPV6 +//#ifdef ISC_PLATFORM_HAVEIPV6 void test_IPv6AddressWithPort(void); void test_IgnoreIPv6Fields(void); -#endif /* ISC_PLATFORM_HAVEIPV6 */ +//#endif /* ISC_PLATFORM_HAVEIPV6 */ void test_ScopedIPv6AddressWithPort(void); void test_HashEqual(void); void test_HashNotEqual(void); @@ -24,9 +24,12 @@ test_IPv4AddressWithPort(void) { TEST_ASSERT_EQUAL_STRING("192.0.2.10:123", sockporttoa(&input)); } -#ifdef ISC_PLATFORM_HAVEIPV6 + void test_IPv6AddressWithPort(void) { + +#ifdef ISC_PLATFORM_HAVEIPV6 + const struct in6_addr address = { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, @@ -47,9 +50,15 @@ test_IPv6AddressWithPort(void) { TEST_ASSERT_EQUAL_STRING(expected, socktoa(&input)); TEST_ASSERT_EQUAL_STRING(expected_port, sockporttoa(&input)); -} + +#else + TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping."); + #endif /* ISC_PLATFORM_HAVEIPV6 */ +} + + void test_ScopedIPv6AddressWithPort(void) { #ifdef ISC_PLATFORM_HAVESCOPEID @@ -98,9 +107,12 @@ test_HashNotEqual(void) { TEST_ASSERT_FALSE(sock_hash(&input1) == sock_hash(&input2)); } -#ifdef ISC_PLATFORM_HAVEIPV6 + void test_IgnoreIPv6Fields(void) { + +#ifdef ISC_PLATFORM_HAVEIPV6 + const struct in6_addr address = { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, @@ -121,5 +133,9 @@ test_IgnoreIPv6Fields(void) { SET_PORT(&input2, NTP_PORT); TEST_ASSERT_EQUAL(sock_hash(&input1), sock_hash(&input2)); -} + +#else + TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping."); #endif /* ISC_PLATFORM_HAVEIPV6 */ +} + diff --git a/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am index f64b4fc08..89d48efe9 100644 --- a/tests/ntpd/Makefile.am +++ b/tests/ntpd/Makefile.am @@ -181,7 +181,6 @@ $(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list) ### test_ntp_signd_CFLAGS = \ -I$(top_srcdir)/sntp/unity \ - -Iwhy.h \ $(NULL) test_ntp_signd_LDADD = \