|
8 | 8 |
|
9 | 9 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
10 | 10 | FuzzedDataProvider fdp(data, size); |
11 | | - std::string source = fdp.ConsumeRandomLengthString(256); |
12 | | - std::string base_source = fdp.ConsumeRandomLengthString(256); |
| 11 | + std::string source = fdp.ConsumeRandomLengthString(100); |
13 | 12 |
|
14 | 13 | // Without base or options |
15 | | - auto result = ada::parse_url_pattern(source, nullptr, nullptr); |
| 14 | + auto result = ada::parse_url_pattern(std::string_view(source), nullptr, nullptr); |
16 | 15 | (void)result; |
17 | 16 |
|
18 | | - // Testing with base_url |
19 | | - std::string_view base_source_view(base_source.data(), base_source.length()); |
20 | | - auto result_with_base = |
21 | | - ada::parse_url_pattern(source, &base_source_view, nullptr); |
22 | | - (void)result_with_base; |
23 | | - |
24 | | - // Testing with base_url and options |
25 | | - ada::url_pattern_options options{.ignore_case = true}; |
26 | | - auto result_with_base_and_options = |
27 | | - ada::parse_url_pattern(source, &base_source_view, &options); |
28 | | - (void)result_with_base_and_options; |
29 | | - |
30 | | - // Testing with url_pattern_init and base url. |
31 | | - ada::url_pattern_init init{.protocol = source, |
32 | | - .username = source, |
33 | | - .password = source, |
34 | | - .hostname = source, |
35 | | - .port = source, |
36 | | - .pathname = source, |
37 | | - .search = source, |
38 | | - .hash = source}; |
39 | | - auto result_with_init = |
40 | | - ada::parse_url_pattern(init, &base_source_view, nullptr); |
41 | | - (void)result_with_init; |
| 17 | +// // Testing with base_url |
| 18 | +// std::string_view base_source_view(base_source.data(), base_source.length()); |
| 19 | +// auto result_with_base = |
| 20 | +// ada::parse_url_pattern(source, &base_source_view, nullptr); |
| 21 | +// (void)result_with_base; |
| 22 | +// |
| 23 | +// // Testing with base_url and options |
| 24 | +// ada::url_pattern_options options{.ignore_case = true}; |
| 25 | +// auto result_with_base_and_options = |
| 26 | +// ada::parse_url_pattern(source, &base_source_view, &options); |
| 27 | +// (void)result_with_base_and_options; |
| 28 | +// |
| 29 | +// // Testing with url_pattern_init and base url. |
| 30 | +// ada::url_pattern_init init{.protocol = source, |
| 31 | +// .username = source, |
| 32 | +// .password = source, |
| 33 | +// .hostname = source, |
| 34 | +// .port = source, |
| 35 | +// .pathname = source, |
| 36 | +// .search = source, |
| 37 | +// .hash = source}; |
| 38 | +// auto result_with_init = |
| 39 | +// ada::parse_url_pattern(init, &base_source_view, nullptr); |
| 40 | +// (void)result_with_init; |
42 | 41 |
|
43 | 42 | return 0; |
44 | 43 | } |
0 commit comments