1 #include <fuzzer/FuzzedDataProvider.h>
8 "Sequence",
"Fallback",
"ParallelAll",
9 "ReactiveSequence",
"ReactiveFallback",
"IfThenElse",
10 "WhileDoElse",
"Inverter",
"RetryUntilSuccessful",
11 "Repeat",
"Timeout",
"Delay",
12 "ForceSuccess",
"ForceFailure",
"AlwaysSuccess",
13 "AlwaysFailure",
"SetBlackboard",
"SubTree"
18 "port_2",
"timeout_ms",
"delay_ms",
19 "threshold",
"max_repeats" };
26 return "<AlwaysSuccess/>";
30 const std::string node_type = fdp.PickValueInArray(
NODE_TYPES);
32 xml +=
"<" + node_type;
34 size_t num_attributes = fdp.ConsumeIntegralInRange<
size_t>(0, 3);
35 for(
size_t i = 0; i < num_attributes; i++)
38 std::string
value = fdp.ConsumeRandomLengthString(10);
39 xml +=
" " + attr +
"=\"" +
value +
"\"";
42 if(depth > 3 || fdp.ConsumeBool())
50 size_t num_children = fdp.ConsumeIntegralInRange<
size_t>(0, 2);
51 for(
size_t i = 0; i < num_children; i++)
55 xml +=
"</" + node_type +
">";
68 FuzzedDataProvider fdp(data,
size);
76 std::string random_xml = fdp.ConsumeRandomLengthString(
size - 1);
81 catch(
const std::exception&)
88 <root BTCPP_format="4">
89 <BehaviorTree ID="MainTree">)";
91 size_t num_nodes = fdp.ConsumeIntegralInRange<
size_t>(1, 5);
92 for(
size_t i = 0; i < num_nodes; i++)
103 switch(fdp.ConsumeIntegralInRange<
int>(0, 2))
121 catch(
const std::exception&)