summaryrefslogtreecommitdiff
path: root/tests/libntp/uglydate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libntp/uglydate.cpp')
-rw-r--r--tests/libntp/uglydate.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/libntp/uglydate.cpp b/tests/libntp/uglydate.cpp
new file mode 100644
index 0000000..6d9e6c6
--- /dev/null
+++ b/tests/libntp/uglydate.cpp
@@ -0,0 +1,18 @@
+#include "libntptest.h"
+
+extern "C" {
+#include "ntp_fp.h"
+};
+
+class uglydateTest : public libntptest {
+protected:
+ static const u_int32 HALF = 2147483648UL;
+};
+
+TEST_F(uglydateTest, ConstantDateTime) {
+ l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
+
+ EXPECT_STREQ("3485080800.500000 10:159:14:00:00.500",
+ uglydate(&time));
+}
+