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

Unified Diff: base/metrics/histogram_unittest.nc

Issue 2886733003: Add more no-compile test for UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_unittest.nc
diff --git a/base/metrics/histogram_unittest.nc b/base/metrics/histogram_unittest.nc
index 6f913e89f1475ca2dfa3a94317eaea2db9f7a674..ec56c85d1cf0590a325b2b26f25e10177ed2b83c 100644
--- a/base/metrics/histogram_unittest.nc
+++ b/base/metrics/histogram_unittest.nc
@@ -17,6 +17,22 @@ void WontCompile() {
UMA_HISTOGRAM_ENUMERATION("", A, B);
}
+#elif defined(NCTEST_DIFFERENT_ENUM_CLASS) // [r"\|sample\| and \|boundary\| shouldn't be of different enums"]
+
+void WontCompile() {
+ enum class TypeA { A };
+ enum class TypeB { B };
+ UMA_HISTOGRAM_ENUMERATION("", TypeA::A, TypeB::B);
+}
+
+#elif defined(NCTEST_DIFFERENT_ENUM_MIXED) // [r"\|sample\| and \|boundary\| shouldn't be of different enums"]
+
+void WontCompile() {
+ enum class TypeA { A };
+ enum TypeB { B };
+ UMA_HISTOGRAM_ENUMERATION("", TypeA::A, B);
+}
+
#elif defined(NCTEST_NEGATIVE_ENUM_MAX) // [r'static_assert failed "\|boundary\| is out of range of HistogramBase::Sample"']
void WontCompile() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698