1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/trunk/testing/gtest_mac.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +// Copyright (c) 2010 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef TESTING_GTEST_MAC_H_ 1.9 +#define TESTING_GTEST_MAC_H_ 1.10 + 1.11 +#include <gtest/internal/gtest-port.h> 1.12 +#include <gtest/gtest.h> 1.13 + 1.14 +#ifdef GTEST_OS_MAC 1.15 + 1.16 +#import <Foundation/Foundation.h> 1.17 + 1.18 +namespace testing { 1.19 +namespace internal { 1.20 + 1.21 +// This overloaded version allows comparison between ObjC objects that conform 1.22 +// to the NSObject protocol. Used to implement {ASSERT|EXPECT}_EQ(). 1.23 +GTEST_API_ AssertionResult CmpHelperNSEQ(const char* expected_expression, 1.24 + const char* actual_expression, 1.25 + id<NSObject> expected, 1.26 + id<NSObject> actual); 1.27 + 1.28 +// This overloaded version allows comparison between ObjC objects that conform 1.29 +// to the NSObject protocol. Used to implement {ASSERT|EXPECT}_NE(). 1.30 +GTEST_API_ AssertionResult CmpHelperNSNE(const char* expected_expression, 1.31 + const char* actual_expression, 1.32 + id<NSObject> expected, 1.33 + id<NSObject> actual); 1.34 + 1.35 +} // namespace internal 1.36 +} // namespace testing 1.37 + 1.38 +// Tests that [expected isEqual:actual]. 1.39 +#define EXPECT_NSEQ(expected, actual) \ 1.40 + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNSEQ, expected, actual) 1.41 +#define EXPECT_NSNE(val1, val2) \ 1.42 + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNSNE, val1, val2) 1.43 + 1.44 +#define ASSERT_NSEQ(expected, actual) \ 1.45 + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNSEQ, expected, actual) 1.46 +#define ASSERT_NSNE(val1, val2) \ 1.47 + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNSNE, val1, val2) 1.48 + 1.49 +#endif // GTEST_OS_MAC 1.50 + 1.51 +#endif // TESTING_GTEST_MAC_H_