summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 10:36:28 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 10:36:28 +0000
commit515f2492fbc0a023eb089e91e349106da325de5e (patch)
treed606fd354fe6c4695fe2f635e62774fe582e8232 /net
parenta834a1abc0a318a563d9a0eb3adec0df2947a982 (diff)
downloadchromium_src-515f2492fbc0a023eb089e91e349106da325de5e.zip
chromium_src-515f2492fbc0a023eb089e91e349106da325de5e.tar.gz
chromium_src-515f2492fbc0a023eb089e91e349106da325de5e.tar.bz2
Clang: enable -Wbool-conversions and -Wunused-variables on Linux.
-Wbool-conversion warns about EXPECT_EQ(false, blah), so replace that with EXPECT_FALSE(blah). Do the same with EXPECT_EQ(true, blah) for good measure (even though that doesn't generate warnings). Also remove the one instance of an unused variable. BUG=69421 TEST=buildbots all compile and all tests pass Review URL: http://codereview.chromium.org/6300001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/cert_database_nss_unittest.cc33
-rw-r--r--net/base/ssl_config_service_win_unittest.cc7
-rw-r--r--net/websockets/websocket_job_unittest.cc8
3 files changed, 23 insertions, 25 deletions
diff --git a/net/base/cert_database_nss_unittest.cc b/net/base/cert_database_nss_unittest.cc
index 468c870..679afc4 100644
--- a/net/base/cert_database_nss_unittest.cc
+++ b/net/base/cert_database_nss_unittest.cc
@@ -184,8 +184,8 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_SSLTrust) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_SSL,
- &failed));
+ EXPECT_TRUE(cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_SSL,
+ &failed));
EXPECT_EQ(0U, failed.size());
@@ -216,8 +216,8 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_EmailTrust) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_EMAIL,
- &failed));
+ EXPECT_TRUE(cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_EMAIL,
+ &failed));
EXPECT_EQ(0U, failed.size());
@@ -247,8 +247,8 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_ObjSignTrust) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_OBJ_SIGN,
- &failed));
+ EXPECT_TRUE(cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_OBJ_SIGN,
+ &failed));
EXPECT_EQ(0U, failed.size());
@@ -278,8 +278,8 @@ TEST_F(CertDatabaseNSSTest, ImportCA_NotCACert) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true,
- cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_SSL, &failed));
+ EXPECT_TRUE(cert_db_.ImportCACerts(certs, CertDatabase::TRUSTED_SSL,
+ &failed));
ASSERT_EQ(1U, failed.size());
// Note: this compares pointers directly. It's okay in this case because
// ImportCACerts returns the same pointers that were passed in. In the
@@ -302,7 +302,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertHierarchy) {
// work (see
// http://mxr.mozilla.org/mozilla/source/security/nss/lib/certhigh/certvfy.c#752
// "XXX This choice of trustType seems arbitrary.")
- EXPECT_EQ(true, cert_db_.ImportCACerts(
+ EXPECT_TRUE(cert_db_.ImportCACerts(
certs, CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL,
&failed));
@@ -322,7 +322,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertHierarchyDupeRoot) {
// First import just the root.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(
+ EXPECT_TRUE(cert_db_.ImportCACerts(
certs, CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL,
&failed));
@@ -337,7 +337,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertHierarchyDupeRoot) {
// Now import with the other certs in the list too. Even though the root is
// already present, we should still import the rest.
failed.clear();
- EXPECT_EQ(true, cert_db_.ImportCACerts(
+ EXPECT_TRUE(cert_db_.ImportCACerts(
certs, CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL,
&failed));
@@ -360,8 +360,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertHierarchyUntrusted) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(certs, CertDatabase::UNTRUSTED,
- &failed));
+ EXPECT_TRUE(cert_db_.ImportCACerts(certs, CertDatabase::UNTRUSTED, &failed));
ASSERT_EQ(1U, failed.size());
EXPECT_EQ("DOD CA-17", failed[0].certificate->subject().common_name);
@@ -382,7 +381,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertHierarchyTree) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(
+ EXPECT_TRUE(cert_db_.ImportCACerts(
certs, CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL,
&failed));
@@ -406,7 +405,7 @@ TEST_F(CertDatabaseNSSTest, ImportCACertNotHierarchy) {
// Import it.
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportCACerts(
+ EXPECT_TRUE(cert_db_.ImportCACerts(
certs, CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL |
CertDatabase::TRUSTED_OBJ_SIGN, &failed));
@@ -434,7 +433,7 @@ TEST_F(CertDatabaseNSSTest, ImportServerCert) {
ASSERT_EQ(2U, certs.size());
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportServerCert(certs, &failed));
+ EXPECT_TRUE(cert_db_.ImportServerCert(certs, &failed));
EXPECT_EQ(0U, failed.size());
@@ -462,7 +461,7 @@ TEST_F(CertDatabaseNSSTest, ImportServerCert_SelfSigned) {
ASSERT_TRUE(ReadCertIntoList("punycodetest.der", &certs));
CertDatabase::ImportCertFailureList failed;
- EXPECT_EQ(true, cert_db_.ImportServerCert(certs, &failed));
+ EXPECT_TRUE(cert_db_.ImportServerCert(certs, &failed));
EXPECT_EQ(0U, failed.size());
diff --git a/net/base/ssl_config_service_win_unittest.cc b/net/base/ssl_config_service_win_unittest.cc
index 7669d99..6a87760 100644
--- a/net/base/ssl_config_service_win_unittest.cc
+++ b/net/base/ssl_config_service_win_unittest.cc
@@ -38,9 +38,9 @@ class SSLConfigServiceWinTest : public testing::Test {
TEST(SSLConfigServiceWinTest, GetNowTest) {
// Verify that the constructor sets the correct default values.
net::SSLConfig config;
- EXPECT_EQ(true, config.rev_checking_enabled);
- EXPECT_EQ(true, config.ssl3_enabled);
- EXPECT_EQ(true, config.tls1_enabled);
+ EXPECT_TRUE(config.rev_checking_enabled);
+ EXPECT_TRUE(config.ssl3_enabled);
+ EXPECT_TRUE(config.tls1_enabled);
bool rv = net::SSLConfigServiceWin::GetSSLConfigNow(&config);
EXPECT_TRUE(rv);
@@ -151,4 +151,3 @@ TEST(SSLConfigServiceWinTest, ObserverTest) {
// Restore the original SSL3 setting.
net::SSLConfigServiceWin::SetSSL3Enabled(config_save.ssl3_enabled);
}
-
diff --git a/net/websockets/websocket_job_unittest.cc b/net/websockets/websocket_job_unittest.cc
index 43d8509..342a2a3 100644
--- a/net/websockets/websocket_job_unittest.cc
+++ b/net/websockets/websocket_job_unittest.cc
@@ -263,7 +263,7 @@ TEST_F(WebSocketJobTest, SimpleHandshake) {
bool sent = websocket_->SendData(kHandshakeRequestMessage,
strlen(kHandshakeRequestMessage));
- EXPECT_EQ(true, sent);
+ EXPECT_TRUE(sent);
MessageLoop::current()->RunAllPending();
EXPECT_EQ(kHandshakeRequestMessage, socket_->sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
@@ -308,7 +308,7 @@ TEST_F(WebSocketJobTest, SlowHandshake) {
bool sent = websocket_->SendData(kHandshakeRequestMessage,
strlen(kHandshakeRequestMessage));
- EXPECT_EQ(true, sent);
+ EXPECT_TRUE(sent);
// We assume request is sent in one data chunk (from WebKit)
// We don't support streaming request.
MessageLoop::current()->RunAllPending();
@@ -390,7 +390,7 @@ TEST_F(WebSocketJobTest, HandshakeWithCookie) {
bool sent = websocket_->SendData(kHandshakeRequestMessage,
strlen(kHandshakeRequestMessage));
- EXPECT_EQ(true, sent);
+ EXPECT_TRUE(sent);
MessageLoop::current()->RunAllPending();
EXPECT_EQ(kHandshakeRequestExpected, socket_->sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
@@ -477,7 +477,7 @@ TEST_F(WebSocketJobTest, HandshakeWithCookieButNotAllowed) {
bool sent = websocket_->SendData(kHandshakeRequestMessage,
strlen(kHandshakeRequestMessage));
- EXPECT_EQ(true, sent);
+ EXPECT_TRUE(sent);
MessageLoop::current()->RunAllPending();
EXPECT_EQ(kHandshakeRequestExpected, socket_->sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());