Skip to content

Commit

Permalink
Bug 1162897 - Use braces, a=bustage
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed May 22, 2017
1 parent 4563164 commit 92a8047
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions gtests/util_gtest/util_pkcs11uri_unittest.cc
Expand Up @@ -32,12 +32,16 @@ class PK11URITest : public ::testing::Test {
for (i = 0; i < num_pattrs; i++) {
const char *value = PK11URI_GetPathAttribute(tmp.get(), pattrs[i].name);
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(pattrs[i].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);
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
if (value) {
EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
}
}
}

Expand All @@ -49,7 +53,9 @@ class PK11URITest : public ::testing::Test {
ASSERT_TRUE(tmp);
char *out = PK11URI_FormatURI(nullptr, tmp.get());
EXPECT_TRUE(out);
if (out) EXPECT_EQ(std::string(out), formatted);
if (out) {
EXPECT_EQ(std::string(out), formatted);
}
PORT_Free(out);
}

Expand All @@ -68,12 +74,16 @@ class PK11URITest : public ::testing::Test {
for (i = 0; i < num_pattrs; i++) {
const char *value = PK11URI_GetPathAttribute(tmp.get(), pattrs[i].name);
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(pattrs[i].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);
EXPECT_TRUE(value);
if (value) EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
if (value) {
EXPECT_EQ(std::string(value), std::string(qattrs[i].value));
}
}
}

Expand Down

0 comments on commit 92a8047

Please sign in to comment.