Added missing AUTHENTICATION_FAILED OCException reason.
authorOssama Othman <ossama.othman@intel.com>
Wed, 23 Dec 2015 04:38:40 +0000 (20:38 -0800)
committerDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Tue, 12 Jan 2016 13:09:29 +0000 (13:09 +0000)
Fixed warning about missing OC_STACK_AUTHENTICATION_FAILED case in
OCException::reason() switch statement, and added appropriate
corresponding string constant.

Change-Id: Ibdc2d68f9cfb76f8165a62bce65dc183b19d7622
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4709
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Ivan Pazderskyy <i.pazderskyy@samsung.com>
Reviewed-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
resource/include/StringConstants.h
resource/src/OCException.cpp
resource/unittests/OCExceptionTest.cpp

index f0fae04..526a0b9 100644 (file)
@@ -108,7 +108,7 @@ namespace OC
         static const char PDM_DB_NOT_INITIALIZED[]     = "Provisioning DB is not initialized";
         static const char DUPLICATE_UUID[]             = "Duplicate UUID in DB";
         static const char INCONSISTENT_DB[]            = "Data in provisioning DB is inconsistent";
-
+        static const char AUTHENTICATION_FAILURE[]     = "Authentication failure";
     }
 
     namespace Error
index 4d0b4a2..cdbb0e7 100644 (file)
@@ -103,6 +103,8 @@ std::string OC::OCException::reason(const OCStackResult sr)
             return OC::Exception::DUPLICATE_UUID;
         case OC_STACK_INCONSISTENT_DB:
             return OC::Exception::INCONSISTENT_DB;
+        case OC_STACK_AUTHENTICATION_FAILURE:
+            return OC::Exception::AUTHENTICATION_FAILURE;
     }
 
     return OC::Exception::UNKNOWN_ERROR;
index 39436cd..efe51dd 100644 (file)
@@ -70,7 +70,8 @@ namespace OC
                 OC_STACK_ERROR,
                 OC_STACK_PDM_IS_NOT_INITIALIZED,
                 OC_STACK_DUPLICATE_UUID,
-                OC_STACK_INCONSISTENT_DB
+                OC_STACK_INCONSISTENT_DB,
+                OC_STACK_AUTHENTICATION_FAILURE
             };
 
             std::string resultMessages[]=
@@ -112,7 +113,8 @@ namespace OC
                 OC::Exception::GENERAL_FAULT,
                 OC::Exception::PDM_DB_NOT_INITIALIZED,
                 OC::Exception::DUPLICATE_UUID,
-                OC::Exception::INCONSISTENT_DB
+                OC::Exception::INCONSISTENT_DB,
+                OC::Exception::AUTHENTICATION_FAILURE
             };
             TEST(OCExceptionTest, ReasonCodeMatches)
             {