From: Damir Tomic Date: Sun, 7 Jun 2015 08:51:34 +0000 (+0200) Subject: forgot to ci a few files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=516c1c807496334f0cccab4c4d5e528bae43806f;p=thirdparty%2Fntp.git forgot to ci a few files bk: 5574061652raQt0dOxNOINupackESQ --- diff --git a/tests/libntp/Makefile.am b/tests/libntp/Makefile.am index f6d80a6f6..88d7dee04 100644 --- a/tests/libntp/Makefile.am +++ b/tests/libntp/Makefile.am @@ -6,7 +6,7 @@ run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb #removed test-libntp check_PROGRAMS = test-modetoa test-uglydate test-ymd2yd test-statestr test-numtoa test-numtohost \ -test-hextoint test-atoint +test-hextoint test-atoint test-a_md5encrypt test-atouint test-authkeys if GTEST_AVAILABLE check_PROGRAMS += tests @@ -44,10 +44,10 @@ AM_LDFLAGS = $(LDFLAGS_NTP) tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \ libntptest.cpp \ - a_md5encrypt.cpp \ + g_a_md5encrypt.cpp \ g_atoint.cpp \ - atouint.cpp \ - authkeys.cpp \ + g_atouint.cpp \ + g_authkeys.cpp \ buftvtots.cpp \ calendar.cpp \ caljulian.cpp \ @@ -170,6 +170,30 @@ test_atoint_LDADD = \ $(unity_tests_LDADD) $(NULL) +test_a_md5encrypt_CFLAGS = \ + -I$(top_srcdir)/sntp/unity \ + $(NULL) + +test_a_md5encrypt_LDADD = \ + $(unity_tests_LDADD) + $(NULL) + +test_atouint_CFLAGS = \ + -I$(top_srcdir)/sntp/unity \ + $(NULL) + +test_atouint_LDADD = \ + $(unity_tests_LDADD) + $(NULL) + +test_authkeys_CFLAGS = \ + -I$(top_srcdir)/sntp/unity \ + $(NULL) + +test_authkeys_LDADD = \ + $(LDADD) \ + $(top_builddir)/sntp/unity/libunity.a \ + $(NULL) #removed one combined test, because unity devs suggested we use one program per test #test_libntp_SOURCES = \ @@ -220,6 +244,21 @@ test_atoint_SOURCES = \ run-test-atoint.c \ $(NULL) +test_a_md5encrypt_SOURCES = \ + a_md5encrypt.c \ + run-test-a_md5encrypt.c \ + #testcalshims.c \ + $(NULL) + +test_atouint_SOURCES = \ + atouint.c \ + run-test-atouint.c \ + $(NULL) + +test_authkeys_SOURCES = \ + authkeys.c \ + run-test-authkeys.c \ + $(NULL) $(srcdir)/run-test-modetoa.c: $(srcdir)/modetoa.c $(std_unity_list) $(run_unity) modetoa.c run-test-modetoa.c @@ -245,6 +284,14 @@ $(srcdir)/run-test-hextoint.c: $(srcdir)/hextoint.c $(std_unity_list) $(srcdir)/run-test-atoint.c: $(srcdir)/atoint.c $(std_unity_list) $(run_unity) atoint.c run-test-atoint.c +$(srcdir)/run-test-a_md5encrypt.c: $(srcdir)/a_md5encrypt.c $(std_unity_list) + $(run_unity) a_md5encrypt.c run-test-a_md5encrypt.c + +$(srcdir)/run-test-atouint.c: $(srcdir)/atouint.c $(std_unity_list) + $(run_unity) atouint.c run-test-atouint.c + +$(srcdir)/run-test-authkeys.c: $(srcdir)/authkeys.c $(std_unity_list) + $(run_unity) authkeys.c run-test-authkeys.c TESTS = diff --git a/tests/libntp/testcalshims.c b/tests/libntp/testcalshims.c index 6a18b4345..563a2f389 100644 --- a/tests/libntp/testcalshims.c +++ b/tests/libntp/testcalshims.c @@ -1,4 +1,4 @@ -#include "libntptest.h" +#include "testcalshims.h" /* This file contains various constants that libntp needs to be set * and that is normally defined in ntpd/ntpq/... @@ -7,7 +7,9 @@ u_long current_time = 4; // needed by authkeys. Used only in to calculate lifetime. const char *progname = "libntptest"; -time_t nowtime = 0; +//static //should be static in c +static time_t nowtime = 0; + time_t timefunc(time_t *ptr) { @@ -16,9 +18,11 @@ time_t timefunc(time_t *ptr) return nowtime; } + +//commented out cuz it was causing problems for a_md5encrypt.c + void settime(int y, int m, int d, int H, int M, int S) { - time_t days(ntpcal_edate_to_eradays(y-1, m-1, d-1) + 1 - DAY_UNIX_STARTS); time_t secs(ntpcal_etime_to_seconds(H, M, S)); diff --git a/tests/libntp/testcalshims.h b/tests/libntp/testcalshims.h index 5afb7b879..8d6cbea2b 100644 --- a/tests/libntp/testcalshims.h +++ b/tests/libntp/testcalshims.h @@ -1,9 +1,13 @@ //#include "tests_main.h" +#include "config.h" #include "ntp_stdlib.h" #include "ntp_calendar.h" - static time_t timefunc(time_t*); - static time_t nowtime; - static void settime(int y, int m, int d, int H, int M, int S); +u_long current_time = 4; // needed by authkeys. Used only in to calculate lifetime. +const char *progname = "libntptest"; + +static time_t timefunc(time_t*); +static time_t nowtime; +static void settime(int y, int m, int d, int H, int M, int S);