Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: net/base/x509_certificate_unittest.cc

Issue 3142016: Change EXPECT_ to ASSERT_ for X.509 tests where it will crash if the check fails (Closed)
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_unittest.cc
diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc
index 04ce0ce7847dd87c786f0197ae3dc5f4c2297502..ad0b5c6004f76192635720ddaf1633a0dcd20f08 100644
--- a/net/base/x509_certificate_unittest.cc
+++ b/net/base/x509_certificate_unittest.cc
@@ -272,9 +272,9 @@ TEST(X509CertificateTest, WebkitCertParsing) {
EXPECT_EQ("California", subject.state_or_province_name);
EXPECT_EQ("US", subject.country_name);
EXPECT_EQ(0U, subject.street_addresses.size());
- EXPECT_EQ(1U, subject.organization_names.size());
+ ASSERT_EQ(1U, subject.organization_names.size());
EXPECT_EQ("Apple Inc.", subject.organization_names[0]);
- EXPECT_EQ(1U, subject.organization_unit_names.size());
+ ASSERT_EQ(1U, subject.organization_unit_names.size());
EXPECT_EQ("Mac OS Forge", subject.organization_unit_names[0]);
EXPECT_EQ(0U, subject.domain_components.size());
@@ -284,9 +284,9 @@ TEST(X509CertificateTest, WebkitCertParsing) {
EXPECT_EQ("Arizona", issuer.state_or_province_name);
EXPECT_EQ("US", issuer.country_name);
EXPECT_EQ(0U, issuer.street_addresses.size());
- EXPECT_EQ(1U, issuer.organization_names.size());
+ ASSERT_EQ(1U, issuer.organization_names.size());
EXPECT_EQ("GoDaddy.com, Inc.", issuer.organization_names[0]);
- EXPECT_EQ(1U, issuer.organization_unit_names.size());
+ ASSERT_EQ(1U, issuer.organization_unit_names.size());
EXPECT_EQ("http://certificates.godaddy.com/repository",
issuer.organization_unit_names[0]);
EXPECT_EQ(0U, issuer.domain_components.size());
@@ -304,7 +304,7 @@ TEST(X509CertificateTest, WebkitCertParsing) {
std::vector<std::string> dns_names;
webkit_cert->GetDNSNames(&dns_names);
- EXPECT_EQ(2U, dns_names.size());
+ ASSERT_EQ(2U, dns_names.size());
EXPECT_EQ("*.webkit.org", dns_names[0]);
EXPECT_EQ("webkit.org", dns_names[1]);
@@ -329,7 +329,7 @@ TEST(X509CertificateTest, ThawteCertParsing) {
EXPECT_EQ("California", subject.state_or_province_name);
EXPECT_EQ("US", subject.country_name);
EXPECT_EQ(0U, subject.street_addresses.size());
- EXPECT_EQ(1U, subject.organization_names.size());
+ ASSERT_EQ(1U, subject.organization_names.size());
EXPECT_EQ("Thawte Inc", subject.organization_names[0]);
EXPECT_EQ(0U, subject.organization_unit_names.size());
EXPECT_EQ(0U, subject.domain_components.size());
@@ -340,9 +340,9 @@ TEST(X509CertificateTest, ThawteCertParsing) {
EXPECT_EQ("", issuer.state_or_province_name);
EXPECT_EQ("US", issuer.country_name);
EXPECT_EQ(0U, issuer.street_addresses.size());
- EXPECT_EQ(1U, issuer.organization_names.size());
+ ASSERT_EQ(1U, issuer.organization_names.size());
EXPECT_EQ("thawte, Inc.", issuer.organization_names[0]);
- EXPECT_EQ(1U, issuer.organization_unit_names.size());
+ ASSERT_EQ(1U, issuer.organization_unit_names.size());
EXPECT_EQ("Terms of use at https://www.thawte.com/cps (c)06",
issuer.organization_unit_names[0]);
EXPECT_EQ(0U, issuer.domain_components.size());
@@ -360,7 +360,7 @@ TEST(X509CertificateTest, ThawteCertParsing) {
std::vector<std::string> dns_names;
thawte_cert->GetDNSNames(&dns_names);
- EXPECT_EQ(1U, dns_names.size());
+ ASSERT_EQ(1U, dns_names.size());
EXPECT_EQ("www.thawte.com", dns_names[0]);
#if TEST_EV
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698