]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
added a few more files to sandbox/ , updated unity to print FAIL instead of Failure
authorDamir Tomic <viperus@ntp.org>
Tue, 26 May 2015 08:45:31 +0000 (08:45 +0000)
committerDamir Tomic <viperus@ntp.org>
Tue, 26 May 2015 08:45:31 +0000 (08:45 +0000)
bk: 556432abPZsAdkby-ZqVFoQIY7jrnw

tests/sandbox/modetoa.c [new file with mode: 0644]
tests/sandbox/uglydate.c [new file with mode: 0644]

diff --git a/tests/sandbox/modetoa.c b/tests/sandbox/modetoa.c
new file mode 100644 (file)
index 0000000..811eef6
--- /dev/null
@@ -0,0 +1,20 @@
+//#include "config.h"
+//#include "libntptest.h"
+#include "unity.h"
+//#include "ntp_stdlib.h"
+
+
+
+void test_KnownMode(void) {
+       const int MODE = 3; // Should be "client"
+       TEST_ASSERT_EQUAL_STRING("client", modetoa(MODE));
+
+//     EXPECT_STREQ("client", modetoa(MODE));
+}
+
+void test_UnknownMode(void) {
+       const int MODE = 100;
+
+        TEST_ASSERT_EQUAL_STRING("mode#1001", modetoa(MODE));
+//     EXPECT_STREQ("mode#100", modetoa(MODE));
+}
diff --git a/tests/sandbox/uglydate.c b/tests/sandbox/uglydate.c
new file mode 100644 (file)
index 0000000..a7879c1
--- /dev/null
@@ -0,0 +1,16 @@
+#include "config.h"
+#include "ntp_fp.h"
+#include "unity.h"
+
+//#include "ntp_stdlib.h"
+//#include "libntptest.h"
+
+void
+test_ConstantDateTime(void) {
+       const u_int32 HALF = 2147483648UL;
+
+       l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
+
+       TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500",
+                                uglydate(&time));
+}