From: Lokesh Walase Date: Fri, 24 Jul 2015 06:25:00 +0000 (+0530) Subject: ntp_signd test changes X-Git-Tag: NTP_4_3_67~2^2~2^2~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0e66f76abff4b883e6dd97eff8a029f33c6eb31;p=thirdparty%2Fntp.git ntp_signd test changes bk: 55b1da3cXvbFBbBk3ACXzVeqiL_dnA --- diff --git a/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am index e7dfeb5fa..3fc9068c5 100644 --- a/tests/ntpd/Makefile.am +++ b/tests/ntpd/Makefile.am @@ -7,6 +7,7 @@ run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb check_PROGRAMS = \ test-leapsec \ test-rc_cmdlength \ + test-ntp_signd \ $(NULL) if GTEST_AVAILABLE @@ -49,12 +50,14 @@ tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \ g_ntpdtest.cpp \ $(top_srcdir)/ntpd/ntp_leapsec.c \ $(top_srcdir)/ntpd/rc_cmdlength.c \ + $(top_srcdir)/ntpd/ntp_signd.c \ g_leapsec.cpp \ $(NULL) BUILT_SOURCES += \ $(srcdir)/run-leapsec.c \ $(srcdir)/run-rc_cmdlength.c \ + $(srcdir)/run-ntp_signd.c \ $(NULL) noinst_HEADERS = g_ntpdtest.h \ @@ -98,6 +101,24 @@ test_rc_cmdlength_SOURCES = \ $(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list) $(run_unity) rc_cmdlength.c run-rc_cmdlength.c +### +test_ntp_signd_CFLAGS = \ + -I$(top_srcdir)/sntp/unity \ + $(NULL) + +test_ntp_signd_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_ntp_signd_SOURCES = \ + ntp_signd.c \ + run-ntp_signd.c \ + $(srcdir)/../libntp/test-libntp.c \ + $(NULL) + +$(srcdir)/run-ntp_signd.c: $(srcdir)/ntp_signd.c $(std_unity_list) + $(run_unity) ntp_signd.c run-ntp_signd.c + TESTS = diff --git a/tests/ntpd/run-ntp_signd.c b/tests/ntpd/run-ntp_signd.c new file mode 100644 index 000000000..e84000084 --- /dev/null +++ b/tests/ntpd/run-ntp_signd.c @@ -0,0 +1,52 @@ +/* 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 + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +void resetTest(void); +extern void test_ux_socket_connect(void); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "ntp_signd.c"; + UnityBegin("ntp_signd.c"); + RUN_TEST(test_ux_socket_connect, 13); + + return (UnityEnd()); +}