| 2563 | } |
| 2564 | |
| 2565 | void build_expected_complex_struct(DataVec& expected, FieldFilter field_filter, bool keyed) |
| 2566 | { |
| 2567 | DataVec all_contents; |
| 2568 | const bool include_possible_keyed = (field_filter != FieldFilter_KeyOnly) || keyed; |
| 2569 | const bool include_unkeyed = |
| 2570 | field_filter == FieldFilter_All || (!keyed && field_filter == FieldFilter_NestedKeyOnly); |
| 2571 | const FieldFilter nested_field_filter = |
| 2572 | field_filter == FieldFilter_All ? FieldFilter_All : FieldFilter_NestedKeyOnly; |
| 2573 | |
| 2574 | if (include_possible_keyed) { |
| 2575 | build_expected_basic_struct(all_contents, nested_field_filter, false); |
| 2576 | { |
| 2577 | DataVec array_contents; |
| 2578 | build_expected_basic_struct(array_contents, nested_field_filter, false); |
| 2579 | build_expected_basic_struct(array_contents, nested_field_filter, false); |
| 2580 | serialize_u32(all_contents, array_contents.size()); |
| 2581 | DataView(array_contents).copy_to(all_contents); |
| 2582 | } |
| 2583 | // TODO(iguessthislldo): unkeyed_struct_seq_value would go here |
| 2584 | |
| 2585 | build_expected_basic_struct(all_contents, nested_field_filter, true); |
| 2586 | { |
| 2587 | DataVec array_contents; |
| 2588 | build_expected_basic_struct(array_contents, nested_field_filter, true); |
| 2589 | build_expected_basic_struct(array_contents, nested_field_filter, true); |
| 2590 | serialize_u32(all_contents, array_contents.size()); |
| 2591 | DataView(array_contents).copy_to(all_contents); |
| 2592 | } |
| 2593 | // TODO(iguessthislldo): keyed_struct_seq_value would go here |
| 2594 | |
| 2595 | build_expected_union(all_contents, nested_field_filter, false); |
| 2596 | { |
| 2597 | DataVec array_contents; |
| 2598 | build_expected_union(array_contents, nested_field_filter, false); |
| 2599 | build_expected_union(array_contents, nested_field_filter, false); |
| 2600 | serialize_u32(all_contents, array_contents.size()); |
| 2601 | DataView(array_contents).copy_to(all_contents); |
| 2602 | } |
| 2603 | // TODO(iguessthislldo): unkeyed_union_seq_value would go here |
| 2604 | |
| 2605 | build_expected_union(all_contents, nested_field_filter, true); |
| 2606 | { |
| 2607 | DataVec array_contents; |
| 2608 | build_expected_union(array_contents, nested_field_filter, true); |
| 2609 | build_expected_union(array_contents, nested_field_filter, true); |
| 2610 | serialize_u32(all_contents, array_contents.size()); |
| 2611 | DataView(array_contents).copy_to(all_contents); |
| 2612 | } |
| 2613 | // TODO(iguessthislldo): keyed_union_seq_value would go here |
| 2614 | } |
| 2615 | |
| 2616 | if (include_unkeyed) { |
| 2617 | DataView(key_only_non_keys_expected_base).copy_to(all_contents); |
| 2618 | } |
| 2619 | |
| 2620 | serialize_u32(expected, all_contents.size()); |
| 2621 | DataView(all_contents).copy_to(expected); |
| 2622 | } |
no test coverage detected