#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
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 \
$(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 = \
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
$(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 =
-#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/...
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)
{
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));
//#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);