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);
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,
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,
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";
#include <stdio.h>
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "sockaddrtest.h"
//=======External Functions This Runner Calls=====
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());
}
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=====
{
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());
}
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);
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,
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
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,
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 */
+}
+
###
test_ntp_signd_CFLAGS = \
-I$(top_srcdir)/sntp/unity \
- -Iwhy.h \
$(NULL)
test_ntp_signd_LDADD = \