Commit 7ab51a25 authored by Todd Malsbary's avatar Todd Malsbary Committed by Uze Choi

Fix compile error with g++ 6.3.1 and RD unit tests.

gtest.h: In instantiation of 'testing::AssertionResult \
    testing::internal::CmpHelperNE(const char*, const char*, const \
    T1&, const T2&) [with T1 = long int; T2 = char*]':
rddatabase.cpp:126:9:   required from here
gtest.h:1577:28: error: ISO C++ forbids comparison between pointer \
    and integer [-fpermissive]

Change-Id: I6e5a2863fc6d45dffb5bc61526ae9f786eb1c638
Signed-off-by: default avatarTodd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20263Reviewed-by: default avatarPhil Coval <philippe.coval@osg.samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent ee04f357
......@@ -117,13 +117,13 @@ static OCRepPayload *CreateRDPublishPayload(const char *deviceId,
OCRepPayloadSetPropString(link, OC_RSRVD_URI, anchor);
size_t rtDim[MAX_REP_ARRAY_DEPTH] = {1, 0, 0};
char **rt = (char **)OICMalloc(sizeof(char *) * 1);
EXPECT_NE(NULL, rt) << "Failed to OICMalloc rt!";
EXPECT_TRUE(NULL != rt) << "Failed to OICMalloc rt!";
if (NULL == rt)
{
return NULL;
}
rt[0] = OICStrdup(resources[i].rt);
EXPECT_NE(NULL, rt[0]) << "Failed to OICStrdup rt!";
EXPECT_TRUE(NULL != rt[0]) << "Failed to OICStrdup rt!";
if (NULL == rt[0])
{
OICFree(rt);
......@@ -141,13 +141,13 @@ static OCRepPayload *CreateRDPublishPayload(const char *deviceId,
size_t itfDim[MAX_REP_ARRAY_DEPTH] = {1, 0, 0};
char **itf = (char **)OICMalloc(sizeof(char *) * 1);
EXPECT_NE(NULL, itf) << "Failed to OICMalloc itf!";
EXPECT_TRUE(NULL != itf) << "Failed to OICMalloc itf!";
if (NULL == itf)
{
return NULL;
}
itf[0] = OICStrdup(resources[i].itf);
EXPECT_NE(NULL, itf[0]) << "Failed to OICStrdup itf!";
EXPECT_TRUE(NULL != itf[0]) << "Failed to OICStrdup itf!";
if (NULL == itf[0])
{
OICFree(itf);
......@@ -218,7 +218,7 @@ TEST_F(RDDatabaseTests, StoreResources)
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
const char *deviceId = "7a960f46-a52e-4837-bd83-460b1a6dd56b";
OCRepPayload *repPayload = CreateResources(deviceId);
ASSERT_NE(NULL, repPayload) << "CreateResources failed!";
ASSERT_TRUE(NULL != repPayload) << "CreateResources failed!";
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(repPayload));
......@@ -245,7 +245,7 @@ TEST_F(RDDatabaseTests, AddResources)
const char *deviceId = "7a960f46-a52e-4837-bd83-460b1a6dd56b";
OCRepPayload *repPayload = CreateResources(deviceId);
ASSERT_NE(NULL, repPayload) << "CreateResources failed!";
ASSERT_TRUE(NULL != repPayload) << "CreateResources failed!";
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(repPayload));
OCPayloadDestroy((OCPayload *)repPayload);
......@@ -290,7 +290,7 @@ TEST_F(RDDatabaseTests, UpdateResources)
const char *deviceId = &anchor[6];
OCRepPayload *repPayload = CreateResources(deviceId);
ASSERT_NE(NULL, repPayload) << "CreateResources failed!";
ASSERT_TRUE(NULL != repPayload) << "CreateResources failed!";
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(repPayload));
OCPayloadDestroy((OCPayload *)repPayload);
......@@ -345,7 +345,7 @@ TEST_F(RDDatabaseTests, AddAndUpdateResources)
const char *deviceId = &anchor[6];
OCRepPayload *repPayload = CreateResources(deviceId);
ASSERT_NE(NULL, repPayload) << "CreateResources failed!";
ASSERT_TRUE(NULL != repPayload) << "CreateResources failed!";
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(repPayload));
OCPayloadDestroy((OCPayload *)repPayload);
......@@ -416,9 +416,9 @@ TEST_F(RDDatabaseTests, DeleteResourcesDevice)
};
OCRepPayload *payloads[2];
payloads[0] = CreateResources(deviceIds[0]);
ASSERT_NE(NULL, payloads[0]) << "CreateResources failed!";
ASSERT_TRUE(NULL != payloads[0]) << "CreateResources failed!";
payloads[1] = CreateResources(deviceIds[1]);
ASSERT_NE(NULL, payloads[1]) << "CreateResources failed!";
ASSERT_TRUE(NULL != payloads[1]) << "CreateResources failed!";
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(payloads[0]));
EXPECT_EQ(OC_STACK_OK, OCRDDatabaseStoreResources(payloads[1]));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment