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

Unified Diff: base/metrics/histogram_unittest.nc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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 | « base/metrics/histogram_macros_internal.h ('k') | chrome/browser/android/metrics/launch_metrics.cc » ('j') | 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 dee96c618902d95b2055b0f75fb6545b3f738157..c9c265799769c043511d251a0997d26f153aa35f 100644
--- a/base/metrics/histogram_unittest.nc
+++ b/base/metrics/histogram_unittest.nc
@@ -50,6 +50,13 @@ void WontCompile() {
UMA_HISTOGRAM_ENUMERATION("", TypeA::A, TypeA::A);
}
+#elif defined(NCTEST_SAMPLE_NOT_ENUM) // [r'static_assert failed "Unexpected: \|boundary\| is enum, but \|sample\| is not."']
+
+void WontCompile() {
+ enum TypeA { A };
+ UMA_HISTOGRAM_ENUMERATION("", 0, TypeA::A);
+}
+
#elif defined(NCTEST_FUNCTION_INT) // [r"Non enum passed to UmaHistogramEnumeration"]
void WontCompile() {
« no previous file with comments | « base/metrics/histogram_macros_internal.h ('k') | chrome/browser/android/metrics/launch_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698