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

Side by Side Diff: testing/gtest_mac_unittest.mm

Issue 3028047: This adds adds four macros when compiling using GTEST_OS_MAC: (Closed)
Patch Set: Fix compile 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 unified diff | Download patch
« testing/gtest_mac.mm ('K') | « 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
(Empty)
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
3 // found in the LICENSE file.
4
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
7 // or run GTest's internal test suite.
8
9 #import "testing/gtest_mac.h"
10
11 #import <Foundation/Foundation.h>
12
13 #include "base/scoped_nsautorelease_pool.h"
14 #include "testing/gtest/include/gtest/internal/gtest-port.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 TEST(GTestMac, ExpectNSEQ) {
18 base::ScopedNSAutoreleasePool pool;
19
20 EXPECT_NSEQ(@"a", @"a");
21
22 NSString* s1 = [NSString stringWithUTF8String:"a"];
23 NSString* s2 = [NSString stringWithString:@"a"];
24 EXPECT_NE(s1, s2);
25 EXPECT_NSEQ(s1, s2);
26 }
27
28 TEST(GTestMac, AssertNSEQ) {
29 base::ScopedNSAutoreleasePool pool;
30
31 NSNumber* n1 = [NSNumber numberWithInt:42];
32 NSNumber* n2 = [NSNumber numberWithInt:42];
33 EXPECT_NE(n1, n2);
Avi (use Gerrit) 2010/08/05 23:51:15 Is this a valid assumption?
34 ASSERT_NSEQ(n1, n2);
35 }
36
37 TEST(GTestMac, ExpectNSNE) {
38 base::ScopedNSAutoreleasePool pool;
39
40 EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]);
41 }
42
43 TEST(GTestMac, AssertNSNE) {
44 base::ScopedNSAutoreleasePool pool;
45
46 ASSERT_NSNE(@"a", @"b");
47 }
OLDNEW
« testing/gtest_mac.mm ('K') | « testing/gtest_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698