Commit bd792733 authored by Daiki Ueno's avatar Daiki Ueno

Bug 1365193, util_gtest: suppress coverity warning, r=kaie

parent e2fbfcd8
......@@ -31,13 +31,13 @@ class PK11URITest : public ::testing::Test {
size_t i;
for (i = 0; i < num_pattrs; i++) {
const char *value = PK11URI_GetPathAttribute(tmp.get(), pattrs[i].name);
ASSERT_TRUE(value);
ASSERT_EQ(std::string(value), std::string(pattrs[i].value));
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(pattrs[i].value));
}
for (i = 0; i < num_qattrs; i++) {
const char *value = PK11URI_GetQueryAttribute(tmp.get(), qattrs[i].name);
ASSERT_TRUE(value);
ASSERT_EQ(std::string(value), std::string(qattrs[i].value));
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
}
}
......@@ -48,8 +48,8 @@ class PK11URITest : public ::testing::Test {
PK11URI_CreateURI(pattrs, num_pattrs, qattrs, num_qattrs));
ASSERT_TRUE(tmp);
char *out = PK11URI_FormatURI(nullptr, tmp.get());
ASSERT_TRUE(out);
ASSERT_EQ(std::string(out), formatted);
EXPECT_TRUE(out);
if (out) EXPECT_EQ(std::string(out), formatted);
PORT_Free(out);
}
......@@ -67,13 +67,13 @@ class PK11URITest : public ::testing::Test {
size_t i;
for (i = 0; i < num_pattrs; i++) {
const char *value = PK11URI_GetPathAttribute(tmp.get(), pattrs[i].name);
ASSERT_TRUE(value);
ASSERT_EQ(std::string(value), std::string(pattrs[i].value));
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(pattrs[i].value));
}
for (i = 0; i < num_qattrs; i++) {
const char *value = PK11URI_GetQueryAttribute(tmp.get(), qattrs[i].name);
ASSERT_TRUE(value);
ASSERT_EQ(std::string(value), std::string(qattrs[i].value));
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
}
}
......@@ -81,9 +81,11 @@ class PK11URITest : public ::testing::Test {
ScopedPK11URI tmp(PK11URI_ParseURI(str.c_str()));
ASSERT_TRUE(tmp);
char *out = PK11URI_FormatURI(nullptr, tmp.get());
ASSERT_TRUE(out);
ASSERT_EQ(std::string(out), formatted);
PORT_Free(out);
EXPECT_TRUE(out);
if (out) {
EXPECT_EQ(std::string(out), formatted);
PORT_Free(out);
}
}
protected:
......
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