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

Unified Diff: base/logging_unittest.cc

Issue 1436403003: Make scoped enums output streamable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: operator<< Created 5 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
Index: base/logging_unittest.cc
diff --git a/base/logging_unittest.cc b/base/logging_unittest.cc
index e0619425f7542804b0c4604aba51603f619ef3b8..8f941a92736c41a25b42484d05fadcffd8dced6e 100644
--- a/base/logging_unittest.cc
+++ b/base/logging_unittest.cc
@@ -258,6 +258,14 @@ TEST_F(LoggingTest, CheckEqStatements) {
CHECK_EQ(false, true); // Unreached.
}
+// Test that scoped enums can be used with CHECK_EQ.
+TEST_F(LoggingTest, ScopedEnum) {
+ enum class TestEnum {
danakj 2015/11/20 19:42:28 can you check fixed signed and unsigned int also?
+ Value,
+ };
+ CHECK_EQ(TestEnum::Value, TestEnum::Value);
+}
+
// Test that defining an operator<< for a type in a namespace doesn't prevent
// other code in that namespace from calling the operator<<(ostream, wstring)
// defined by logging.h. This can fail if operator<<(ostream, wstring) can't be
« base/logging.h ('K') | « base/logging.h ('k') | ui/touch_selection/touch_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698