]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
forgot to ci a few files
authorDamir Tomic <viperus@ntp.org>
Sun, 7 Jun 2015 08:51:34 +0000 (10:51 +0200)
committerDamir Tomic <viperus@ntp.org>
Sun, 7 Jun 2015 08:51:34 +0000 (10:51 +0200)
bk: 5574061652raQt0dOxNOINupackESQ

tests/libntp/Makefile.am
tests/libntp/testcalshims.c
tests/libntp/testcalshims.h

index f6d80a6f6e800134adb771075821121aa1d95d4f..88d7dee04562bf95a47da147ba6823403b0a3466 100644 (file)
@@ -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 =
 
index 6a18b43457ca07904b6030b4d9bd879129cdd086..563a2f38962e101b7d7fd2ce557af9659d78bfed 100644 (file)
@@ -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));
 
index 5afb7b879991c38da57b7f314ba82e5dcd9b6939..8d6cbea2beb55a31ee6931a05ae0ba06e24610e4 100644 (file)
@@ -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);