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

Side by Side Diff: base/metrics/field_trial_params_unittest.nc

Issue 2804633003: Add base::FeatureParam<> struct (Closed)
Patch Set: Remove constexpr for Windows Created 3 years, 3 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 unified diff | Download patch
« no previous file with comments | « base/metrics/field_trial_params_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This is a "No Compile Test" suite.
6 // http://dev.chromium.org/developers/testing/no-compile-tests
7
8 #include "base/feature_list.h"
9 #include "base/metrics/field_trial_params.h"
10
11 constexpr base::Feature kFeature{"NoCompileFeature"};
12
13 enum Param { FOO, BAR };
14
15 #if defined(NCTEST_NO_PARAM_TYPE) // [r"too few template arguments"]
16
17 constexpr base::FeatureParam<> kParam{
18 &kFeature, "Param"};
19
20 #elif defined(NCTEST_VOID_PARAM_TYPE) // [r"unsupported FeatureParam<> type"]
21
22 constexpr base::FeatureParam<void> kParam{
23 &kFeature, "Param"};
24
25 #elif defined(NCTEST_INVALID_PARAM_TYPE) // [r"unsupported FeatureParam<> type" ]
26
27 constexpr base::FeatureParam<size_t> kParam{
28 &kFeature, "Param", 1u};
29
30 #elif defined(NCTEST_ENUM_NULL_OPTIONS) // [r"candidate template ignored: could not match"]
31
32 constexpr base::FeatureParam<Param> kParam{
33 &kFeature, "Param", FOO, nullptr};
34
35 #elif defined(NCTEST_ENUM_EMPTY_OPTIONS) // [r"zero-length arrays are not permi tted"]
36
37 constexpr base::FeatureParam<Param>::Option kParamOptions[] = {};
38 constexpr base::FeatureParam<Param> kParam{
39 &kFeature, "Param", FOO, &kParamOptions};
40
41 #else
42
43 void suppress_unused_variable_warning() {
44 (void)kFeature;
45 }
46
47 #endif
OLDNEW
« no previous file with comments | « base/metrics/field_trial_params_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698