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

Unified Diff: base/metrics/field_trial_params_unittest.nc

Issue 2804633003: Add base::FeatureParam<> struct (Closed)
Patch Set: rebase Created 3 years, 4 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
Index: base/metrics/field_trial_params_unittest.nc
diff --git a/base/metrics/field_trial_params_unittest.nc b/base/metrics/field_trial_params_unittest.nc
new file mode 100644
index 0000000000000000000000000000000000000000..3d280fd35817acc0af173d5d79ce82f86ac4c7cf
--- /dev/null
+++ b/base/metrics/field_trial_params_unittest.nc
@@ -0,0 +1,40 @@
+// Copyright 2017 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/field_trial_params.h"
+
+constexpr base::Feature kFeature{"NoCompileFeature"};
+
+enum Param { FOO, BAR };
+
+#if defined(NCTEST_NO_PARAM_TYPE)
+
+constexpr base::FieldParam<> kParam{ // ["need error string"]
+ &kFeature, "Param"};
+
+#elif defined(NCTEST_VOID_PARAM_TYPE)
+
+constexpr base::FieldParam<> kParam{ // ["need error string"]
+ &kFeature, "Param"};
+
+#elif defined(NCTEST_INVALID_PARAM_TYPE)
+
+constexpr base::FieldParam<unsigned> kParam{ // ["need error string"]
+ &kFeature, "Param", 1u};
+
+#elif defined(NCTEST_ENUM_NULL_OPTIONS)
+
+constexpr base::FieldParam<Param> kParam{ // ["need error string"]
+ &kFeature, "Param", FOO, nullptr};
+
+#elif defined(NCTEST_ENUM_EMPTY_OPTIONS)
+
+constexpr base::FieldParam<Param>::Option[] kParamOptions = {};
+constexpr base::FieldParam<Param> kParam{
+ &kFeature, "Param", FOO, &kParamOptions};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698