summaryrefslogtreecommitdiffstats
path: root/media/webrtc/trunk/testing/gtest_mac_unittest.mm
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /media/webrtc/trunk/testing/gtest_mac_unittest.mm
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/webrtc/trunk/testing/gtest_mac_unittest.mm')
-rw-r--r--media/webrtc/trunk/testing/gtest_mac_unittest.mm57
1 files changed, 57 insertions, 0 deletions
diff --git a/media/webrtc/trunk/testing/gtest_mac_unittest.mm b/media/webrtc/trunk/testing/gtest_mac_unittest.mm
new file mode 100644
index 000000000..1376ed1eb
--- /dev/null
+++ b/media/webrtc/trunk/testing/gtest_mac_unittest.mm
@@ -0,0 +1,57 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Note that while this file is in testing/ and tests GTest macros, it is built
+// as part of Chromium's unit_tests target because the project does not build
+// or run GTest's internal test suite.
+
+#import "testing/gtest_mac.h"
+
+#import <Foundation/Foundation.h>
+
+#include "base/mac/scoped_nsautorelease_pool.h"
+#include "testing/gtest/include/gtest/internal/gtest-port.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(GTestMac, ExpectNSEQ) {
+ base::mac::ScopedNSAutoreleasePool pool;
+
+ EXPECT_NSEQ(@"a", @"a");
+
+ NSString* s1 = [NSString stringWithUTF8String:"a"];
+ NSString* s2 = [NSString stringWithString:@"a"];
+ EXPECT_NE(s1, s2);
+ EXPECT_NSEQ(s1, s2);
+}
+
+TEST(GTestMac, AssertNSEQ) {
+ base::mac::ScopedNSAutoreleasePool pool;
+
+ NSNumber* n1 = [NSNumber numberWithInt:42];
+ NSNumber* n2 = [NSNumber numberWithInt:42];
+ EXPECT_NE(n1, n2);
+ ASSERT_NSEQ(n1, n2);
+}
+
+TEST(GTestMac, ExpectNSNE) {
+ base::mac::ScopedNSAutoreleasePool pool;
+
+ EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]);
+}
+
+TEST(GTestMac, AssertNSNE) {
+ base::mac::ScopedNSAutoreleasePool pool;
+
+ 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.
+}