Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef TESTING_GTEST_MAC_H_ |
michael@0 | 6 | #define TESTING_GTEST_MAC_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <gtest/internal/gtest-port.h> |
michael@0 | 9 | #include <gtest/gtest.h> |
michael@0 | 10 | |
michael@0 | 11 | #ifdef GTEST_OS_MAC |
michael@0 | 12 | |
michael@0 | 13 | #import <Foundation/Foundation.h> |
michael@0 | 14 | |
michael@0 | 15 | namespace testing { |
michael@0 | 16 | namespace internal { |
michael@0 | 17 | |
michael@0 | 18 | // This overloaded version allows comparison between ObjC objects that conform |
michael@0 | 19 | // to the NSObject protocol. Used to implement {ASSERT|EXPECT}_EQ(). |
michael@0 | 20 | GTEST_API_ AssertionResult CmpHelperNSEQ(const char* expected_expression, |
michael@0 | 21 | const char* actual_expression, |
michael@0 | 22 | id<NSObject> expected, |
michael@0 | 23 | id<NSObject> actual); |
michael@0 | 24 | |
michael@0 | 25 | // This overloaded version allows comparison between ObjC objects that conform |
michael@0 | 26 | // to the NSObject protocol. Used to implement {ASSERT|EXPECT}_NE(). |
michael@0 | 27 | GTEST_API_ AssertionResult CmpHelperNSNE(const char* expected_expression, |
michael@0 | 28 | const char* actual_expression, |
michael@0 | 29 | id<NSObject> expected, |
michael@0 | 30 | id<NSObject> actual); |
michael@0 | 31 | |
michael@0 | 32 | } // namespace internal |
michael@0 | 33 | } // namespace testing |
michael@0 | 34 | |
michael@0 | 35 | // Tests that [expected isEqual:actual]. |
michael@0 | 36 | #define EXPECT_NSEQ(expected, actual) \ |
michael@0 | 37 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNSEQ, expected, actual) |
michael@0 | 38 | #define EXPECT_NSNE(val1, val2) \ |
michael@0 | 39 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNSNE, val1, val2) |
michael@0 | 40 | |
michael@0 | 41 | #define ASSERT_NSEQ(expected, actual) \ |
michael@0 | 42 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNSEQ, expected, actual) |
michael@0 | 43 | #define ASSERT_NSNE(val1, val2) \ |
michael@0 | 44 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNSNE, val1, val2) |
michael@0 | 45 | |
michael@0 | 46 | #endif // GTEST_OS_MAC |
michael@0 | 47 | |
michael@0 | 48 | #endif // TESTING_GTEST_MAC_H_ |