IOT-2848 Fix for intermitent read error 19/23019/2
authorGeorge Nash <george.nash@intel.com>
Thu, 26 Oct 2017 18:07:03 +0000 (11:07 -0700)
committerRick Bell <richard.s.bell@intel.com>
Fri, 27 Oct 2017 16:01:00 +0000 (16:01 +0000)
Valgrind was reporting intermitent read errors
from the provisiontest. I think the result of the
failure was a change made for IOT-2599 the name
of the tests db file was changed from ./dbpath
to ./dbpath.tmp however the name of the file was
used in more than one test.
See: https://gerrit.iotivity.org/gerrit/#/c/22057/

Bug: https://jira.iotivity.org/browse/IOT-2848
Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: Id72a07b51aee10abe34a428239ca74dfbf7a2641
Signed-off-by: George Nash <george.nash@intel.com>
resource/provisioning/unittests/OCProvisioningTest.cpp

index e8e1db4..043ac7c 100644 (file)
@@ -29,6 +29,7 @@
 #include <gtest/gtest.h>
 
 #define TIMEOUT 5
+#define DB_FILE "./dbPath.tmp"
 
 namespace OCProvisioningTest
 {
@@ -49,7 +50,7 @@ namespace OCProvisioningTest
 
     TEST(ProvisionInitTest, TestValidPath)
     {
-        std::string dbPath("./dbPath.tmp");
+        std::string dbPath(DB_FILE);
         EXPECT_EQ(OC_STACK_OK, OCSecure::provisionInit(dbPath));
         EXPECT_EQ(OC_STACK_OK, OCSecure::provisionClose());
     }
@@ -184,7 +185,7 @@ namespace OCProvisioningTest
 
     TEST(DeviceInfoTest, DevInfoFromNetwork)
     {
-        std::string dbPath("./dbPath");
+        std::string dbPath(DB_FILE);
         EXPECT_EQ(OC_STACK_OK, OCSecure::provisionInit(dbPath));
         DeviceList_t owned, unowned;
         EXPECT_EQ(OC_STACK_OK, OCSecure::getDevInfoFromNetwork(TIMEOUT,