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

Side by Side Diff: testing/gtest_mac_unittest.mm

Issue 4697004: [Mac] Better handling of nil for testing macros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment about unable to test EXPECT_NSNE(nil, nil). Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « testing/gtest_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Note that while this file is in testing/ and tests GTest macros, it is built 5 // Note that while this file is in testing/ and tests GTest macros, it is built
6 // as part of Chromium's unit_tests target because the project does not build 6 // as part of Chromium's unit_tests target because the project does not build
7 // or run GTest's internal test suite. 7 // or run GTest's internal test suite.
8 8
9 #import "testing/gtest_mac.h" 9 #import "testing/gtest_mac.h"
10 10
(...skipping 27 matching lines...) Expand all
38 base::mac::ScopedNSAutoreleasePool pool; 38 base::mac::ScopedNSAutoreleasePool pool;
39 39
40 EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]); 40 EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]);
41 } 41 }
42 42
43 TEST(GTestMac, AssertNSNE) { 43 TEST(GTestMac, AssertNSNE) {
44 base::mac::ScopedNSAutoreleasePool pool; 44 base::mac::ScopedNSAutoreleasePool pool;
45 45
46 ASSERT_NSNE(@"a", @"b"); 46 ASSERT_NSNE(@"a", @"b");
47 } 47 }
48
49 TEST(GTestMac, ExpectNSNil) {
50 base::mac::ScopedNSAutoreleasePool pool;
51
52 EXPECT_NSEQ(nil, nil);
53 EXPECT_NSNE(nil, @"a");
54 EXPECT_NSNE(@"a", nil);
55
56 // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails.
57 }
OLDNEW
« no previous file with comments | « testing/gtest_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698