Add unit tests for the phosphor-logging server

-Add unit tests for error wrapping

Change-Id: Ib15620d84de8ab5abdc85b8f88dd7c05f83fd6f3
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/test/elog_errorwrap_test.cpp b/test/elog_errorwrap_test.cpp
new file mode 100644
index 0000000..f341447
--- /dev/null
+++ b/test/elog_errorwrap_test.cpp
@@ -0,0 +1,32 @@
+#include "elog_errorwrap_test.hpp"
+
+namespace phosphor
+{
+namespace logging
+{
+namespace internal
+{
+
+TEST_F(TestLogManager, logCap)
+{
+    for (auto i = 0; i < ERROR_INFO_CAP + 20; i++)
+    {
+        manager.commitWithLvl(i, "FOO", 6);
+    }
+
+    // Max num of Info( and below Sev) errors can be created is qual to
+    // ERROR_INFO_CAP
+    EXPECT_EQ(ERROR_INFO_CAP , manager.getInfoErrSize());
+
+    for (auto i = 0; i < ERROR_CAP + 20; i++)
+    {
+        manager.commitWithLvl(i, "FOO", 0);
+    }
+    // Max num of high severity errors can be created is qual to ERROR_CAP
+    EXPECT_EQ(ERROR_CAP, manager.getRealErrSize());
+
+}
+
+}// namespace internal
+}// namespace logging
+}// namespace phosphor