summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/tests/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/tests/sandbox')
-rw-r--r--contrib/ntp/tests/sandbox/Makefile.am25
-rw-r--r--contrib/ntp/tests/sandbox/Makefile.in42
-rw-r--r--contrib/ntp/tests/sandbox/run-modetoa.c11
-rw-r--r--contrib/ntp/tests/sandbox/run-uglydate.c13
-rw-r--r--contrib/ntp/tests/sandbox/run-ut-2803.c11
-rw-r--r--contrib/ntp/tests/sandbox/smeartest.c12
6 files changed, 75 insertions, 39 deletions
diff --git a/contrib/ntp/tests/sandbox/Makefile.am b/contrib/ntp/tests/sandbox/Makefile.am
index 489ceab..c146b14 100644
--- a/contrib/ntp/tests/sandbox/Makefile.am
+++ b/contrib/ntp/tests/sandbox/Makefile.am
@@ -1,11 +1,24 @@
#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
+
NULL =
BUILT_SOURCES =
CLEANFILES =
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
-check_PROGRAMS = bug-2803 first-test second-test smeartest
+check_PROGRAMS = \
+ first-test \
+ smeartest \
+ $(NULL)
+
+EXTRA_PROGRAMS = \
+ bug-2803 \
+ second-test \
+ $(NULL)
# HMS: we may not need some of these:
LDADD = \
@@ -23,13 +36,15 @@ AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-bug_2803_SOURCES = \
- bug-2803.c \
- run-ut-2803.c \
- ut-2803.c \
+bug_2803_SOURCES = \
+ bug-2803.c \
+ run-ut-2803.c \
+ ut-2803.c \
$(NULL)
$(srcdir)/run-ut-2803.c: $(srcdir)/ut-2803.c $(std_unity_list)
diff --git a/contrib/ntp/tests/sandbox/Makefile.in b/contrib/ntp/tests/sandbox/Makefile.in
index 70edbc9..e524c70 100644
--- a/contrib/ntp/tests/sandbox/Makefile.in
+++ b/contrib/ntp/tests/sandbox/Makefile.in
@@ -13,6 +13,8 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -87,8 +89,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = bug-2803$(EXEEXT) first-test$(EXEEXT) \
- second-test$(EXEEXT) smeartest$(EXEEXT)
+check_PROGRAMS = first-test$(EXEEXT) smeartest$(EXEEXT) \
+ $(am__EXEEXT_1)
+EXTRA_PROGRAMS = bug-2803$(EXEEXT) second-test$(EXEEXT) \
+ $(am__EXEEXT_1)
@NTP_CROSSCOMPILE_FALSE@am__append_1 = $(check_PROGRAMS)
subdir = tests/sandbox
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -118,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -136,6 +141,7 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 =
am__objects_1 =
am_bug_2803_OBJECTS = bug-2803.$(OBJEXT) run-ut-2803.$(OBJEXT) \
ut-2803.$(OBJEXT) $(am__objects_1)
@@ -455,6 +461,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -463,6 +470,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -524,6 +532,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -709,12 +718,14 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-
-#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
NULL =
BUILT_SOURCES = run-ut-2803.c run-uglydate.c run-modetoa.c \
check-libntp check-libunity .deps-ver
CLEANFILES = check-libntp check-libunity .deps-ver
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
# HMS: we may not need some of these:
@@ -730,12 +741,13 @@ AM_CFLAGS = $(CFLAGS_NTP)
# HMS: we may not need some of these:
AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp/unity \
- -I$(top_srcdir)/include $(CPPFLAGS_NTP)
+ -I$(top_srcdir)/include $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
bug_2803_SOURCES = \
- bug-2803.c \
- run-ut-2803.c \
- ut-2803.c \
+ bug-2803.c \
+ run-ut-2803.c \
+ ut-2803.c \
$(NULL)
first_test_SOURCES = \
@@ -1048,13 +1060,6 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
-bug-2803.log: bug-2803$(EXEEXT)
- @p='bug-2803$(EXEEXT)'; \
- b='bug-2803'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
first-test.log: first-test$(EXEEXT)
@p='first-test$(EXEEXT)'; \
b='first-test'; \
@@ -1062,13 +1067,6 @@ first-test.log: first-test$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-second-test.log: second-test$(EXEEXT)
- @p='second-test$(EXEEXT)'; \
- b='second-test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
smeartest.log: smeartest$(EXEEXT)
@p='smeartest$(EXEEXT)'; \
b='smeartest'; \
diff --git a/contrib/ntp/tests/sandbox/run-modetoa.c b/contrib/ntp/tests/sandbox/run-modetoa.c
index 776dda4..143bd75 100644
--- a/contrib/ntp/tests/sandbox/run-modetoa.c
+++ b/contrib/ntp/tests/sandbox/run-modetoa.c
@@ -31,18 +31,21 @@ extern void test_UnknownMode(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "modetoa.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("modetoa.c");
RUN_TEST(test_KnownMode, 8);
RUN_TEST(test_UnknownMode, 15);
diff --git a/contrib/ntp/tests/sandbox/run-uglydate.c b/contrib/ntp/tests/sandbox/run-uglydate.c
index dd909ad..e65cd01 100644
--- a/contrib/ntp/tests/sandbox/run-uglydate.c
+++ b/contrib/ntp/tests/sandbox/run-uglydate.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -30,18 +32,21 @@ extern void test_ConstantDateTime(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "uglydate.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("uglydate.c");
RUN_TEST(test_ConstantDateTime, 9);
return (UnityEnd());
diff --git a/contrib/ntp/tests/sandbox/run-ut-2803.c b/contrib/ntp/tests/sandbox/run-ut-2803.c
index d6ca2ee..b948c4a 100644
--- a/contrib/ntp/tests/sandbox/run-ut-2803.c
+++ b/contrib/ntp/tests/sandbox/run-ut-2803.c
@@ -35,18 +35,21 @@ extern void test_ignored(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "ut-2803.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("ut-2803.c");
RUN_TEST(test_main, 30);
RUN_TEST(test_XPASS, 37);
RUN_TEST(test_XFAIL, 49);
diff --git a/contrib/ntp/tests/sandbox/smeartest.c b/contrib/ntp/tests/sandbox/smeartest.c
index e1b04e5..a8ee210 100644
--- a/contrib/ntp/tests/sandbox/smeartest.c
+++ b/contrib/ntp/tests/sandbox/smeartest.c
@@ -127,6 +127,8 @@ ltor(l_fp l)
main()
{
+ l_fp l;
+ int rc;
rtol(0xfe800000);
rtol(0xfe800001);
@@ -164,5 +166,15 @@ main()
rtoltor(0xfe7ffffe);
rtoltor(0xfe7fffff);
+ rc = atolfp("-.932087", &l);
+ ltor(l);
+ rtol(0xfec458b0);
+ printf("%x -> %d.%d.%d.%d\n",
+ 0xfec458b0,
+ 0xfe,
+ 0xc4,
+ 0x58,
+ 0xb0);
+
return 0;
}
OpenPOWER on IntegriCloud