diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 21:50:38 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 21:50:38 +0000 |
commit | 22f73595a4c5cdb62e398dc7915524528128db38 (patch) | |
tree | a1bff971c48b56118de01ee826a95c51654de521 /testing/gtest_mac_unittest.mm | |
parent | 3ed5a02c88c9176e62e290928f0796a853ca14a2 (diff) | |
download | chromium_src-22f73595a4c5cdb62e398dc7915524528128db38.zip chromium_src-22f73595a4c5cdb62e398dc7915524528128db38.tar.gz chromium_src-22f73595a4c5cdb62e398dc7915524528128db38.tar.bz2 |
[Mac] Better handling of nil for testing macros.
EXPECT_NSEQ() and EXPECT_NSNE() were implemented in terms of [x
isEqual:y]. This meant that EXPECT_NSEQ(nil, nil) failed, and
EXPECT_NSNE(nil, nil) succeeded. Add additional tests against the raw
pointers to resolve this.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4697004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/gtest_mac_unittest.mm')
-rw-r--r-- | testing/gtest_mac_unittest.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/gtest_mac_unittest.mm b/testing/gtest_mac_unittest.mm index c5bc47f..1376ed1 100644 --- a/testing/gtest_mac_unittest.mm +++ b/testing/gtest_mac_unittest.mm @@ -45,3 +45,13 @@ TEST(GTestMac, AssertNSNE) { ASSERT_NSNE(@"a", @"b"); } + +TEST(GTestMac, ExpectNSNil) { + base::mac::ScopedNSAutoreleasePool pool; + + EXPECT_NSEQ(nil, nil); + EXPECT_NSNE(nil, @"a"); + EXPECT_NSNE(@"a", nil); + + // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails. +} |