Fix error attribute naming for Linux 5.0

There was a slight change to one of the error attributes as part of the
OCC driver upstreaming process. This commit also adds unit tests for the
error attributes. This required some refactoring to support the unit
tests.

Resolves openbmc/openbmc#3505

Signed-off-by: Eddie James <eajames@us.ibm.com>
Change-Id: I665b46e44b18befc8a728f7246bcda82f1f1a71c
diff --git a/occ_errors.cpp b/occ_errors.cpp
index ae66a62..ab7663a 100644
--- a/occ_errors.cpp
+++ b/occ_errors.cpp
@@ -56,15 +56,18 @@
 }
 
 // Starts to watch for errors
-void Error::addWatch()
+void Error::addWatch(bool poll)
 {
     if (!watching)
     {
         // Open the file
         openFile();
 
-        // register the callback handler
-        registerCallBack();
+        if (poll)
+        {
+            // register the callback handler
+            registerCallBack();
+        }
 
         // Set we are watching the error
         watching = true;