From: Damir Tomic Date: Tue, 26 May 2015 08:45:31 +0000 (+0000) Subject: added a few more files to sandbox/ , updated unity to print FAIL instead of Failure X-Git-Tag: NTP_4_3_40~6^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49fb5cf8b22d24fa9e8648993494ee6934f5d14c;p=thirdparty%2Fntp.git added a few more files to sandbox/ , updated unity to print FAIL instead of Failure bk: 556432abPZsAdkby-ZqVFoQIY7jrnw --- diff --git a/tests/sandbox/modetoa.c b/tests/sandbox/modetoa.c new file mode 100644 index 000000000..811eef626 --- /dev/null +++ b/tests/sandbox/modetoa.c @@ -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 index 000000000..a7879c117 --- /dev/null +++ b/tests/sandbox/uglydate.c @@ -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)); +}