OLD | NEW |
(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/metrics/field_trial_params.h" |
| 9 |
| 10 constexpr base::Feature kFeature{"NoCompileFeature"}; |
| 11 |
| 12 enum Param { FOO, BAR }; |
| 13 |
| 14 #if defined(NCTEST_NO_PARAM_TYPE) |
| 15 |
| 16 constexpr base::FieldParam<> kParam{ // ["need error string"] |
| 17 &kFeature, "Param"}; |
| 18 |
| 19 #elif defined(NCTEST_VOID_PARAM_TYPE) |
| 20 |
| 21 constexpr base::FieldParam<> kParam{ // ["need error string"] |
| 22 &kFeature, "Param"}; |
| 23 |
| 24 #elif defined(NCTEST_INVALID_PARAM_TYPE) |
| 25 |
| 26 constexpr base::FieldParam<unsigned> kParam{ // ["need error string"] |
| 27 &kFeature, "Param", 1u}; |
| 28 |
| 29 #elif defined(NCTEST_ENUM_NULL_OPTIONS) |
| 30 |
| 31 constexpr base::FieldParam<Param> kParam{ // ["need error string"] |
| 32 &kFeature, "Param", FOO, nullptr}; |
| 33 |
| 34 #elif defined(NCTEST_ENUM_EMPTY_OPTIONS) |
| 35 |
| 36 constexpr base::FieldParam<Param>::Option[] kParamOptions = {}; |
| 37 constexpr base::FieldParam<Param> kParam{ |
| 38 &kFeature, "Param", FOO, &kParamOptions}; |
| 39 |
| 40 #endif |
OLD | NEW |