diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-22 05:22:10 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-22 05:22:10 +0000 |
commit | a4057b2148d7a149c4c523109af6bd06dd1710bf (patch) | |
tree | d2f4978cefbff5703a308bf8f1a45ad0bb5660b8 /net | |
parent | e004a2d0d8d5f3e67483f52a48db29998882d7ff (diff) | |
download | chromium_src-a4057b2148d7a149c4c523109af6bd06dd1710bf.zip chromium_src-a4057b2148d7a149c4c523109af6bd06dd1710bf.tar.gz chromium_src-a4057b2148d7a149c4c523109af6bd06dd1710bf.tar.bz2 |
Mark X509CertificateParseTest as FLAKY on OS X (for 10.5 builders)
X509CertificateParseTest is failing for PKCS#7 data from PEM encoded blocks. When it fails, it crashes net_unittests because of an out-of-bounds read.
Mark the test as FLAKY on OS X, and change the EXPECT to an ASSERT to suppres the crash
BUG=49887
TEST=X509CertificateParseTest.CanParseFormat on OS X 10.5 no longer crashes
Review URL: http://codereview.chromium.org/2868064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/x509_certificate_unittest.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc index fbaad28..84a7e9f 100644 --- a/net/base/x509_certificate_unittest.cc +++ b/net/base/x509_certificate_unittest.cc @@ -209,7 +209,7 @@ void CheckGoogleCert(const scoped_refptr<X509Certificate>& google_cert, 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("Google Inc", subject.organization_names[0]); EXPECT_EQ(0U, subject.organization_unit_names.size()); EXPECT_EQ(0U, subject.domain_components.size()); @@ -220,7 +220,7 @@ void CheckGoogleCert(const scoped_refptr<X509Certificate>& google_cert, EXPECT_EQ("", issuer.state_or_province_name); EXPECT_EQ("ZA", 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 Consulting (Pty) Ltd.", issuer.organization_names[0]); EXPECT_EQ(0U, issuer.organization_unit_names.size()); EXPECT_EQ(0U, issuer.domain_components.size()); @@ -238,7 +238,7 @@ void CheckGoogleCert(const scoped_refptr<X509Certificate>& google_cert, std::vector<std::string> dns_names; google_cert->GetDNSNames(&dns_names); - EXPECT_EQ(1U, dns_names.size()); + ASSERT_EQ(1U, dns_names.size()); EXPECT_EQ("www.google.com", dns_names[0]); #if TEST_EV @@ -646,7 +646,18 @@ class X509CertificateParseTest CertificateFormatTestData test_data_; }; -TEST_P(X509CertificateParseTest, CanParseFormat) { +// OS X 10.5 builds are having trouble with PKCS#7 from PEM +// http://crbug.com/49887 . The wrapping syntax is to match the preprocessor +// resolution that happens for TEST() that does not happen for TEST_P() +#define WRAPPED_TEST_P(test_case_name, test_name) \ + TEST_P(test_case_name, test_name) +#if defined(OS_MACOSX) +#define MAYBE_CanParseFormat FLAKY_CanParseFormat +#else +#define MAYBE_CanParseFormat CanParseFormat +#endif + +WRAPPED_TEST_P(X509CertificateParseTest, MAYBE_CanParseFormat) { FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, test_data_.file_name, test_data_.format); |