From: Damir Tomic Date: Thu, 6 Aug 2015 18:41:02 +0000 (+0200) Subject: socktoa.c: X-Git-Tag: NTP_4_3_72~2^2~20^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00a2408c4955bf59912431658ed4f07187c489b4;p=thirdparty%2Fntp.git socktoa.c: 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 --- diff --git a/sntp/tests/run-t-log.c b/sntp/tests/run-t-log.c index 2c70df55b..146ee197f 100644 --- a/sntp/tests/run-t-log.c +++ b/sntp/tests/run-t-log.c @@ -24,12 +24,12 @@ #include #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()); } diff --git a/tests/libntp/decodenetnum.c b/tests/libntp/decodenetnum.c index ae25b094a..0e9bc3492 100644 --- a/tests/libntp/decodenetnum.c +++ b/tests/libntp/decodenetnum.c @@ -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, diff --git a/tests/libntp/socktoa.c b/tests/libntp/socktoa.c index 3e73f31dd..6661fa553 100644 --- a/tests/libntp/socktoa.c +++ b/tests/libntp/socktoa.c @@ -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, diff --git a/tests/ntpq/Makefile.am b/tests/ntpq/Makefile.am index d0e75965b..4bb353024 100644 --- a/tests/ntpq/Makefile.am +++ b/tests/ntpq/Makefile.am @@ -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 index 000000000..f64e7287f --- /dev/null +++ b/tests/ntpq/t-ntpq.c @@ -0,0 +1,14 @@ +#include "config.h" + +#include "ntp.h" +#include "ntp_stdlib.h" + +#include "unity.h" + + +void testPrimary(void); + +void testPrimary(void){ + + +}