summaryrefslogtreecommitdiff
path: root/tests/libntp/g_prettydate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libntp/g_prettydate.cpp')
-rw-r--r--tests/libntp/g_prettydate.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/libntp/g_prettydate.cpp b/tests/libntp/g_prettydate.cpp
new file mode 100644
index 0000000000000..45741b5a93dee
--- /dev/null
+++ b/tests/libntp/g_prettydate.cpp
@@ -0,0 +1,16 @@
+#include "g_libntptest.h"
+
+extern "C" {
+#include "ntp_fp.h"
+};
+
+class prettydateTest : public libntptest {
+protected:
+ static const u_int32 HALF = 2147483648UL;
+};
+
+TEST_F(prettydateTest, ConstantDate) {
+ l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
+
+ ASSERT_STREQ("cfba1ce0.80000000 Wed, Jun 9 2010 14:00:00.500", gmprettydate(&time));
+}