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

Unified Diff: base/metrics/histogram_unittest.nc

Issue 2469993002: Assert enum type equivalence in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: add no-compile tests Created 4 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/metrics/histogram_unittest.nc
diff --git a/base/metrics/histogram_unittest.nc b/base/metrics/histogram_unittest.nc
new file mode 100644
index 0000000000000000000000000000000000000000..0dfe1af050accf102a4fbb3fb484825183f1d4a3
--- /dev/null
+++ b/base/metrics/histogram_unittest.nc
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This is a "No Compile Test" suite.
+// http://dev.chromium.org/developers/testing/no-compile-tests
+
+#include "base/metrics/histogram_macros.h"
+
+namespace base {
+
+#if defined(NCTEST_DIFFERENT_ENUM) // [r"\|sample\| and \|boundary\| shouldn't be of different enums"]
+
+void WontCompile() {
+ enum TypeA { A };
+ enum TypeB { B };
+ UMA_HISTOGRAM_ENUMERATION("", A, B);
+}
+
+#endif
+
+} // namespace base
« base/metrics/histogram_macros_internal.h ('K') | « base/metrics/histogram_macros_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698