Add fuzzer to Maybe & Dropdown.

This commit is contained in:
ArthurSonzogni 2021-09-26 15:59:01 +02:00 committed by Arthur Sonzogni
parent 76b2f17488
commit 31b5fac9c5

View File

@ -57,7 +57,7 @@ Component GeneratorComponent(const char*& data, size_t& size, int depth) {
if (depth <= 0) if (depth <= 0)
return Button(GeneratorString(data, size), [] {}); return Button(GeneratorString(data, size), [] {});
switch (value % 16) { switch (value % 18) {
case 1: case 1:
return Checkbox(GeneratorString(data, size), &g_bool); return Checkbox(GeneratorString(data, size), &g_bool);
case 2: case 2:
@ -102,6 +102,10 @@ Component GeneratorComponent(const char*& data, size_t& size, int depth) {
&g_int); &g_int);
case 15: case 15:
return Container::Tab(GeneratorComponents(data, size, depth - 1), &g_int); return Container::Tab(GeneratorComponents(data, size, depth - 1), &g_int);
case 16:
return Maybe(GeneratorComponent(data, size, depth - 1), &g_bool);
case 17:
return Dropdown(&g_list, &g_int);
default: default:
return Button(GeneratorString(data, size), [] {}); return Button(GeneratorString(data, size), [] {});
} }