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

Unified Diff: testing/gtest_mac.mm

Issue 4697004: [Mac] Better handling of nil for testing macros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment about unable to test EXPECT_NSNE(nil, nil). Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/gtest_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/gtest_mac.mm
diff --git a/testing/gtest_mac.mm b/testing/gtest_mac.mm
index 3caacdff0ec9f9d814dfddea536627fb13c83a13..94c9a203df2e4396348575f529176e48d61299a7 100644
--- a/testing/gtest_mac.mm
+++ b/testing/gtest_mac.mm
@@ -21,7 +21,7 @@ GTEST_API_ AssertionResult CmpHelperNSEQ(const char* expected_expression,
const char* actual_expression,
id<NSObject> expected,
id<NSObject> actual) {
- if ([expected isEqual:actual]) {
+ if (expected == actual || [expected isEqual:actual]) {
return AssertionSuccess();
}
return EqFailure(expected_expression,
@@ -37,7 +37,7 @@ GTEST_API_ AssertionResult CmpHelperNSNE(const char* expected_expression,
const char* actual_expression,
id<NSObject> expected,
id<NSObject> actual) {
- if (![expected isEqual:actual]) {
+ if (expected != actual && ![expected isEqual:actual]) {
return AssertionSuccess();
}
Message msg;
« no previous file with comments | « no previous file | testing/gtest_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698