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

Side by Side Diff: testing/gtest_mac_unittest.mm

Issue 1211283003: Overload EXPECT_NSEQ to handle NSRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also handle NSPoint. Created 5 years, 5 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 unified diff | Download patch
« 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 TEST(GTestMac, ExpectNSNil) { 49 TEST(GTestMac, ExpectNSNil) {
50 base::mac::ScopedNSAutoreleasePool pool; 50 base::mac::ScopedNSAutoreleasePool pool;
51 51
52 EXPECT_NSEQ(nil, nil); 52 EXPECT_NSEQ(nil, nil);
53 EXPECT_NSNE(nil, @"a"); 53 EXPECT_NSNE(nil, @"a");
54 EXPECT_NSNE(@"a", nil); 54 EXPECT_NSNE(@"a", nil);
55 55
56 // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails. 56 // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails.
57 } 57 }
58
59 #if !defined(GTEST_OS_IOS)
60
61 TEST(GTestMac, ExpectNSEQRect) {
62 base::mac::ScopedNSAutoreleasePool pool;
63
64 EXPECT_NSEQ(NSMakeRect(1, 2, 3, 4), NSMakeRect(1, 2, 3, 4));
65 }
66
67 TEST(GTestMac, AssertNSEQRect) {
68 base::mac::ScopedNSAutoreleasePool pool;
69
70 ASSERT_NSEQ(NSMakeRect(1, 2, 3, 4), NSMakeRect(1, 2, 3, 4));
71 }
72
73 TEST(GTestMac, ExpectNSNERect) {
74 base::mac::ScopedNSAutoreleasePool pool;
75
76 EXPECT_NSNE(NSMakeRect(1, 2, 3, 4), NSMakeRect(5, 6, 7, 8));
77 }
78
79 TEST(GTestMac, AssertNSNERect) {
80 base::mac::ScopedNSAutoreleasePool pool;
81
82 ASSERT_NSNE(NSMakeRect(1, 2, 3, 4), NSMakeRect(5, 6, 7, 8));
83 }
84
85 TEST(GTestMac, ExpectNSEQPoint) {
86 base::mac::ScopedNSAutoreleasePool pool;
87
88 EXPECT_NSEQ(NSMakePoint(1, 2), NSMakePoint(1, 2));
89 }
90
91 TEST(GTestMac, AssertNSEQPoint) {
92 base::mac::ScopedNSAutoreleasePool pool;
93
94 ASSERT_NSEQ(NSMakePoint(1, 2), NSMakePoint(1, 2));
95 }
96
97 TEST(GTestMac, ExpectNSNEPoint) {
98 base::mac::ScopedNSAutoreleasePool pool;
99
100 EXPECT_NSNE(NSMakePoint(1, 2), NSMakePoint(3, 4));
101 }
102
103 TEST(GTestMac, AssertNSNEPoint) {
104 base::mac::ScopedNSAutoreleasePool pool;
105
106 ASSERT_NSNE(NSMakePoint(1, 2), NSMakePoint(3, 4));
107 }
108
109 #endif // !GTEST_OS_IOS
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