• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 //
16 // Automatically generated by tools/codegen/core/gen_config_vars.py
17 //
18 
19 #include "test/core/test_util/fuzz_config_vars.h"
20 
21 #include "test/core/test_util/fuzz_config_vars_helpers.h"
22 
23 namespace grpc_core {
24 
OverridesFromFuzzConfigVars(const grpc::testing::FuzzConfigVars & vars)25 ConfigVars::Overrides OverridesFromFuzzConfigVars(
26     const grpc::testing::FuzzConfigVars& vars) {
27   ConfigVars::Overrides overrides;
28   if (vars.has_enable_fork_support()) {
29     overrides.enable_fork_support = vars.enable_fork_support();
30   }
31   if (vars.has_dns_resolver()) {
32     overrides.dns_resolver = vars.dns_resolver();
33   }
34   if (vars.has_verbosity()) {
35     overrides.verbosity = vars.verbosity();
36   }
37   if (vars.has_experiments()) {
38     overrides.experiments =
39         ValidateExperimentsStringForFuzzing(vars.experiments());
40   }
41   if (vars.has_trace()) {
42     overrides.trace = vars.trace();
43   }
44   return overrides;
45 }
ApplyFuzzConfigVars(const grpc::testing::FuzzConfigVars & vars)46 void ApplyFuzzConfigVars(const grpc::testing::FuzzConfigVars& vars) {
47   ConfigVars::SetOverrides(OverridesFromFuzzConfigVars(vars));
48 }
49 
50 }  // namespace grpc_core
51