]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Makefile.am:
authorDamir Tomic <viperus@ntp.org>
Thu, 6 Aug 2015 08:27:35 +0000 (10:27 +0200)
committerDamir Tomic <viperus@ntp.org>
Thu, 6 Aug 2015 08:27:35 +0000 (10:27 +0200)
  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

tests/libntp/decodenetnum.c
tests/libntp/run-decodenetnum.c
tests/libntp/run-socktoa.c
tests/libntp/socktoa.c
tests/ntpd/Makefile.am

index 39f0320bf9bc4909f314c0377f16d64b81e587b7..ae25b094a1f9cb3153574ed7ab3ea537e7aa614a 100644 (file)
@@ -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";
index 70dd294df72cc28895458f8887daefbb0b4a9050..d30b602629a3b77665e97d7b9e7a51507cad65f5 100644 (file)
@@ -24,7 +24,6 @@
 #include <stdio.h>
 #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());
 }
index 3cf17a8b308e7ce12b6c0482a0d2ceb2de0d851e..664bb91b8f07d83c499870c7ce7e9de5c254ccff 100644 (file)
@@ -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());
 }
index 6d65fea949db8ea0cc7f1443145cc57a4c9bf4f5..3e73f31dde474bb762e1242988722422dca3fcb8 100644 (file)
@@ -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 */
+}
+
index f64b4fc08000d47dc4b8a39f2ff9fef3e06c0f2c..89d48efe9f69517ebc73304e215719ab6713f61e 100644 (file)
@@ -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 =                 \