summaryrefslogtreecommitdiff
path: root/tests/libntp/g_modetoa.cpp
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2015-07-01 03:12:13 +0000
committerCy Schubert <cy@FreeBSD.org>2015-07-01 03:12:13 +0000
commit873997f35a991eee09ed91148a0cf332360380da (patch)
tree5b1ffa3ad0e56e0e9f2991011729791ee86d7632 /tests/libntp/g_modetoa.cpp
parent4ba32eb5a8bf3455c09d1513ed2af8d2c861a6ba (diff)
Notes
Diffstat (limited to 'tests/libntp/g_modetoa.cpp')
-rw-r--r--tests/libntp/g_modetoa.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/libntp/g_modetoa.cpp b/tests/libntp/g_modetoa.cpp
new file mode 100644
index 000000000000..96bf3ce59952
--- /dev/null
+++ b/tests/libntp/g_modetoa.cpp
@@ -0,0 +1,16 @@
+#include "g_libntptest.h"
+
+class modetoaTest : public libntptest {
+};
+
+TEST_F(modetoaTest, KnownMode) {
+ const int MODE = 3; // Should be "client"
+
+ EXPECT_STREQ("client", modetoa(MODE));
+}
+
+TEST_F(modetoaTest, UnknownMode) {
+ const int MODE = 100;
+
+ EXPECT_STREQ("mode#100", modetoa(MODE));
+}