[IOT-1832] Restore error code
authorDan Mihai <Daniel.Mihai@microsoft.com>
Mon, 20 Feb 2017 17:01:53 +0000 (09:01 -0800)
committerMike Fenelon <mike.fenelon@microsoft.com>
Tue, 21 Feb 2017 23:00:30 +0000 (23:00 +0000)
Restore the error code expected by the unit test, recently
modified by change df063552a4dfab53662653566fe73ed491820aaf.

Change-Id: If5393030a4019485aad5dc0c13159b5b895dc2f8
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17385
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
resource/csdk/security/src/credresource.c

index 10099ae..ad10ebc 100644 (file)
@@ -2312,7 +2312,13 @@ OCStackResult InitCredResource()
         OicUuid_t emptyUuid = {.id={0}};
 
         ret = GetDoxmDeviceID(&deviceID);
-        VERIFY_SUCCESS(TAG, ret == OC_STACK_OK, ERROR);
+        if (ret != OC_STACK_OK)
+        {
+            OIC_LOG_V(WARNING, TAG, "%s: GetDoxmDeviceID failed, error %d", __func__, ret);
+            //Unit tests expect error code OC_STACK_INVALID_PARAM.
+            ret = OC_STACK_INVALID_PARAM;
+            goto exit;
+        }
 
         //Add a log to track the invalid credential.
         LL_FOREACH(gCred, cred)