From: Damir Tomic Date: Mon, 10 Aug 2015 11:15:13 +0000 (+0200) Subject: run-ntp_util.c: X-Git-Tag: NTP_4_3_72~2^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb7a5854bc6a4297f19a56cda63755b15eed3df7;p=thirdparty%2Fntp.git run-ntp_util.c: new file, I guess? Makefile.am: changes to harlan's makefile after merge run-ntp_prio_q.c: hopefully, fixes stuff. Why is this here? Did harlan pull something from tfendrich? bk: 55c887c1KL3K6hxDiUOhxFUCe_KwuQ --- diff --git a/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am index 2ae51c7f3..1618bcd33 100644 --- a/tests/ntpd/Makefile.am +++ b/tests/ntpd/Makefile.am @@ -9,17 +9,17 @@ std_unity_list = \ run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb check_PROGRAMS = \ + test-ntp_signd \ test-leapsec \ test-rc_cmdlength \ - $(NULL) - -EXTRA_PROGRAMS = \ test-ntp_restrict \ test-ntp_scanner \ - test-ntp_signd \ test-ntp_prio_q \ $(NULL) +EXTRA_PROGRAMS = \ + $(NULL) + LDADD = \ $(top_builddir)/ntpd/libntpd.a \ $(top_builddir)/libntp/libntp.a \ @@ -51,7 +51,7 @@ BUILT_SOURCES += \ $(srcdir)/run-ntp_prio_q.c \ $(srcdir)/run-ntp_restrict.c \ $(srcdir)/run-rc_cmdlength.c \ - $(srcdir)/run-ntp_signd.c \ + $(srcdir)/run-t-ntp_signd.c \ $(NULL) #noinst_HEADERS = \ @@ -143,19 +143,19 @@ test_ntp_signd_CFLAGS = \ test_ntp_signd_LDADD = \ $(unity_tests_LDADD) \ - $(top_builddir)/ntpd/libntpd.a \ - $(top_builddir)/ntpd/ntp_signd.o \ - $(unity_tests_LDADD) \ + $(top_builddir)/ntpd/ntp_config.o \ + $(top_builddir)/ntpd/ntp_io.o \ $(NULL) test_ntp_signd_SOURCES = \ - ntp_signd.c \ - run-ntp_signd.c \ + t-ntp_signd.c \ + run-t-ntp_signd.c \ $(srcdir)/../libntp/test-libntp.c \ + $(srcdir)/../../ntpd/ntp_signd.c \ $(NULL) -$(srcdir)/run-ntp_signd.c: $(srcdir)/ntp_signd.c $(std_unity_list) - $(run_unity) ntp_signd.c run-ntp_signd.c +$(srcdir)/run-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 = \ diff --git a/tests/ntpd/run-ntp_prio_q.c b/tests/ntpd/run-ntp_prio_q.c index 35af443de..870a9b33b 100644 --- a/tests/ntpd/run-ntp_prio_q.c +++ b/tests/ntpd/run-ntp_prio_q.c @@ -49,7 +49,7 @@ void resetTest(void) setUp(); } -char const *progname; +char *progname; //=======MAIN===== diff --git a/tests/ntpd/run-ntp_util.c b/tests/ntpd/run-ntp_util.c new file mode 100644 index 000000000..84166f39b --- /dev/null +++ b/tests/ntpd/run-ntp_util.c @@ -0,0 +1,60 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include +#include +#include "config.h" +#include "ntp.h" +#include "ntp_calendar.h" +#include "ntp_stdlib.h" +#include "test-libntp.h" +#include +#include + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_mprintf_clock_stats(void); +extern void test_fstostr(void); + + +//=======Test Reset Option===== +void resetTest(void); +void resetTest(void) +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + UnityBegin("ntp_util.c"); + RUN_TEST(test_mprintf_clock_stats, 13); + RUN_TEST(test_fstostr, 27); + + return (UnityEnd()); +}