]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
socktoa.c:
authorDamir Tomic <viperus@ntp.org>
Thu, 6 Aug 2015 18:41:02 +0000 (20:41 +0200)
committerDamir Tomic <viperus@ntp.org>
Thu, 6 Aug 2015 18:41:02 +0000 (20:41 +0200)
  fixed. Tests are skipped when you do ./build --disable-ipv6

t-ntpq.c:
  new test file
decodenetnum.c:
  fixed. Tests are skipped when you do ./build --disable-ipv6
Makefile.am:
  changes
run-t-log.c:
  updated

bk: 55c3aa3e7_hYISejLUlqu1ZeOqbvvw

sntp/tests/run-t-log.c
tests/libntp/decodenetnum.c
tests/libntp/socktoa.c
tests/ntpq/Makefile.am
tests/ntpq/t-ntpq.c [new file with mode: 0644]

index 2c70df55b68b21bc246a730ec224232c71b2de38..146ee197fdf1bfcf04e0720a2313411537ff5b1c 100644 (file)
 #include <stdio.h>
 #include "config.h"
 #include "ntp_types.h"
-#include "log.h"
 
 //=======External Functions This Runner Calls=====
 extern void setUp(void);
 extern void tearDown(void);
 extern void testChangePrognameInMysyslog(void);
+extern void testOpenLogfileTest(void);
 extern void testWriteInCustomLogfile(void);
 
 
@@ -41,7 +41,7 @@ void resetTest(void)
   setUp();
 }
 
-const char *progname;
+char *progname;
 
 
 //=======MAIN=====
@@ -50,7 +50,8 @@ int main(int argc, char *argv[])
   progname = argv[0];
   UnityBegin("t-log.c");
   RUN_TEST(testChangePrognameInMysyslog, 9);
-  RUN_TEST(testWriteInCustomLogfile, 32);
+  RUN_TEST(testOpenLogfileTest, 10);
+  RUN_TEST(testWriteInCustomLogfile, 35);
 
   return (UnityEnd());
 }
index ae25b094a1f9cb3153574ed7ab3ea537e7aa614a..0e9bc34922b7de51273c9a8d8308070cd2991289 100644 (file)
@@ -46,8 +46,8 @@ test_IPv4AddressWithPort(void) {
 void
 test_IPv6AddressOnly(void) {
 
-#ifdef ISC_PLATFORM_HAVEIPV6
-
+//#ifdef ISC_PLATFORM_HAVEIPV6 //looks like HAVEIPV6 checks if system has IPV6 capabilies. WANTIPV6 can be changed with build --disable-ipv6
+#ifdef ISC_PLATFORM_WANTIPV6
        const struct in6_addr address = {
                0x20, 0x01, 0x0d, 0xb8,
         0x85, 0xa3, 0x08, 0xd3,
@@ -78,7 +78,7 @@ test_IPv6AddressOnly(void) {
 void
 test_IPv6AddressWithPort(void) {
 
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_WANTIPV6
 
        const struct in6_addr address = {
                0x20, 0x01, 0x0d, 0xb8,
index 3e73f31dde474bb762e1242988722422dca3fcb8..6661fa553c890078996daed8fb3df4a6199df341 100644 (file)
@@ -28,7 +28,7 @@ test_IPv4AddressWithPort(void) {
 void 
 test_IPv6AddressWithPort(void) {
 
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_WANTIPV6
 
        const struct in6_addr address = {
                0x20, 0x01, 0x0d, 0xb8,
@@ -111,7 +111,7 @@ test_HashNotEqual(void) {
 void 
 test_IgnoreIPv6Fields(void) {
 
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_WANTIPV6
 
        const struct in6_addr address = {
                0x20, 0x01, 0x0d, 0xb8,
index d0e75965bb6af35702cabc570ec40f850100183e..4bb353024f5b9d00c9fac8789bd91ae1aa20618f 100644 (file)
@@ -9,8 +9,7 @@ std_unity_list =                                                \
 run_unity =    cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
 
 check_PROGRAMS =               \
-       test-ntp_scanner        \
-       test-ntp_signd          \
+       test-ntpq               \
        $(NULL)
 
 
@@ -61,49 +60,21 @@ noinst_HEADERS =    g_ntpdtest.h            \
                        $(NULL)
 
 ###
-test_ntp_signd_CFLAGS =                        \
+test_ntpq_CFLAGS =                     \
        -I$(top_srcdir)/sntp/unity      \
-       -Iwhy.h         \
        $(NULL)
 
-test_ntp_signd_LDADD =                 \
+test_ntpq_LDADD =                      \
        $(unity_tests_LDADD)            \
-       $(top_builddir)/ntpd/libntpd.a  \
-       $(unity_tests_LDADD)            \
-       $(top_builddir)/ntpd/ntp_config.o       \
-       $(top_builddir)/ntpd/ntp_io.o   \
-       $(NULL)
-
-#      $(top_builddir)/ntpd/ntp_signd.o #not needed if you #include the file.c
-
-test_ntp_signd_SOURCES =                       \
-       t-ntp_signd.c                   \
-       run-t-ntp_signd.c                       \
-       $(srcdir)/../libntp/test-libntp.c               \
-       $(srcdir)/../../ntpd/ntp_signd.c                \
-       $(NULL)
-
-$(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
-       $(run_unity) t-ntp_signd.c run-t-ntp_signd.c
-
-###
-test_ntp_scanner_CFLAGS =                      \
-       -I$(top_srcdir)/sntp/unity      \
-       $(NULL)
-
-test_ntp_scanner_LDADD =                       \
-       $(unity_tests_LDADD)            \
-       $(top_builddir)/ntpd/ntp_scanner.o              \
        $(NULL)
 
-test_ntp_scanner_SOURCES =                     \
-       ntp_scanner.c                           \
-       run-ntp_scanner.c                       \
-       $(srcdir)/../libntp/test-libntp.c       \
+test_ntpq_SOURCES =                    \
+       t-ntpq.c                                \
+       run-t-ntpq.c                    \
        $(NULL)
 
-$(srcdir)/run-ntp_scanner.c: $(srcdir)/ntp_scanner.c $(std_unity_list)
-       $(run_unity) ntp_scanner.c run-ntp_scanner.c
+$(srcdir)/run-t-ntpq.c: $(srcdir)/t-ntpq.c $(std_unity_list)
+       $(run_unity) t-ntpq.c run-t-ntpq.c
 
 
 
diff --git a/tests/ntpq/t-ntpq.c b/tests/ntpq/t-ntpq.c
new file mode 100644 (file)
index 0000000..f64e728
--- /dev/null
@@ -0,0 +1,14 @@
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+
+#include "unity.h"
+
+
+void testPrimary(void);
+
+void testPrimary(void){
+
+
+}