Add testcases for NamesValues

Change-Id: I61c52f2a196a32dbd4d03a2ccafa2b94414f7555
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..138d637
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,12 @@
+AM_CPPFLAGS = -I$(top_srcdir)
+
+# Run all 'check' test programs
+TESTS = $(check_PROGRAMS)
+
+check_PROGRAMS = nvtest
+nvtest_CPPFLAGS = -Igtest $(GTEST_CPPFLAGS) $(AM_CPPFLAGS)
+
+nvtest_CXXFLAGS = $(PTHREAD_CFLAGS)
+nvtest_LDFLAGS = -lgtest_main -lgtest $(PTHREAD_LIBS) $(OESDK_TESTCASE_FLAGS)
+
+nvtest_SOURCES = nvtest.cpp
diff --git a/test/nvtest.cpp b/test/nvtest.cpp
new file mode 100644
index 0000000..2abdae9
--- /dev/null
+++ b/test/nvtest.cpp
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2017 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <gtest/gtest.h>
+#include "names_values.hpp"
+
+TEST(NamesValuesTest, TestValues)
+{
+    witherspoon::power::util::NamesValues nv;
+
+    std::string expected;
+    EXPECT_EQ(nv.get(), expected); //empty
+
+    nv.add("name1", 0);
+    nv.add("name2", 0xC0FFEE);
+    nv.add("name3", 0x12345678abcdef12);
+    nv.add("name4", 0x0000000001);
+
+    expected = "name1=0x0|name2=0xc0ffee|name3=0x12345678abcdef12|name4=0x1";
+
+    EXPECT_EQ(nv.get(), expected);
+}
+