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

Unified Diff: testing/gtest_mac.h

Issue 1155623002: Added CGFloat comparison functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include gtest_mac.h from callers instead of adding it to ui_cocoa_test_helper.h Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | ui/gfx/test/ui_cocoa_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/gtest_mac.h
diff --git a/testing/gtest_mac.h b/testing/gtest_mac.h
index aa48c945431c8995889103eed8ee861cec1b9f81..7de8c3023d2fd3957ccca89b289d8d8f1293779d 100644
--- a/testing/gtest_mac.h
+++ b/testing/gtest_mac.h
@@ -43,6 +43,15 @@ GTEST_API_ AssertionResult CmpHelperNSNE(const char* expected_expression,
#define ASSERT_NSNE(val1, val2) \
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNSNE, val1, val2)
+// Tests CGFloat equality.
+#if CGFLOAT_IS_DOUBLE
+#define EXPECT_CGFLOAT_EQ(expected, actual) EXPECT_DOUBLE_EQ(expected, actual)
+#define ASSERT_CGFLOAT_EQ(expected, actual) ASSERT_DOUBLE_EQ(expected, actual)
+#else
+#define EXPECT_CGFLOAT_EQ(expected, actual) EXPECT_FLOAT_EQ(expected, actual)
+#define ASSERT_CGFLOAT_EQ(expected, actual) ASSERT_FLOAT_EQ(expected, actual)
+#endif // CGFLOAT_IS_DOUBLE
+
#endif // GTEST_OS_MAC
#endif // TESTING_GTEST_MAC_H_
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | ui/gfx/test/ui_cocoa_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698