]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Makefile.am:
authorDamir Tomic <viperus@ntp.org>
Sat, 1 Aug 2015 18:49:22 +0000 (20:49 +0200)
committerDamir Tomic <viperus@ntp.org>
Sat, 1 Aug 2015 18:49:22 +0000 (20:49 +0200)
  added ntp_signdT
ntp_signdT.c, run-ntp_signdT.c:
  new file

bk: 55bd14b2VevHNrVjvFBULfdihHxHYA

tests/ntpd/Makefile.am
tests/ntpd/ntp_signdT.c [new file with mode: 0644]
tests/ntpd/run-ntp_signdT.c [new file with mode: 0644]

index c9430efcd4bc96b908bc688fdcf4eeb2a0291926..bf61fb594dc2dfc44751cbf20d6cbabd8e74afd9 100644 (file)
@@ -14,6 +14,7 @@ check_PROGRAMS =              \
        test-ntp_restrict       \
        test-rc_cmdlength       \
        test-ntp_scanner        \
+       test-ntp_signdT         \
        $(NULL)
 
 #      test-ntp_signd          \ #doesn't work, can't link it because you can't link static function
@@ -69,7 +70,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-ntp_signdT.c              \
        $(NULL)
 
 noinst_HEADERS =       g_ntpdtest.h            \
@@ -154,25 +155,26 @@ $(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 =                        \
+test_ntp_signdT_CFLAGS =                       \
        -I$(top_srcdir)/sntp/unity      \
        $(NULL)
 
-test_ntp_signd_LDADD =                 \
+test_ntp_signdT_LDADD =                        \
        $(unity_tests_LDADD)            \
        $(top_builddir)/ntpd/libntpd.a  \
        $(top_builddir)/ntpd/ntp_signd.o        \
        $(unity_tests_LDADD)            \
        $(NULL)
 
-test_ntp_signd_SOURCES =                       \
-       ntp_signd.c                     \
-       run-ntp_signd.c                 \
+test_ntp_signdT_SOURCES =                      \
+       ntp_signdT.c                    \
+       run-ntp_signdT.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_signdT.c: $(srcdir)/ntp_signdT.c $(std_unity_list)
+       $(run_unity) ntp_signdT.c run-ntp_signdT.c
 
 ###
 test_ntp_scanner_CFLAGS =                      \
diff --git a/tests/ntpd/ntp_signdT.c b/tests/ntpd/ntp_signdT.c
new file mode 100644 (file)
index 0000000..710183d
--- /dev/null
@@ -0,0 +1,28 @@
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "unity.h"
+
+#include "test-libntp.h"
+
+#include "ntp_signd.c"
+
+void 
+test_ux_socket_connect(void){
+       TEST_ASSERT_EQUAL(-1, ux_socket_connect(NULL));
+       TEST_ASSERT_EQUAL(-1, ux_socket_connect("127.0.0.1"));
+
+
+       //write_all()
+       char *socketName = "Random_Socket_Name";
+       int length = strlen(socketName);
+
+}
+
+void
+test_write_all(void){
+
+}
diff --git a/tests/ntpd/run-ntp_signdT.c b/tests/ntpd/run-ntp_signdT.c
new file mode 100644 (file)
index 0000000..5e5700a
--- /dev/null
@@ -0,0 +1,58 @@
+/* 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 <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_ux_socket_connect(void);
+extern void test_write_all(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_signdT.c");
+  RUN_TEST(test_ux_socket_connect, 14);
+  RUN_TEST(test_write_all, 26);
+
+  return (UnityEnd());
+}