/src/simdutf/fuzz/conversion.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // this fuzzes the convert_ functions |
2 | | // by Paul Dreik 2024 |
3 | | |
4 | | #include <algorithm> |
5 | | #include <cstddef> |
6 | | #include <cstdint> |
7 | | #include <cstdlib> |
8 | | #include <functional> |
9 | | #include <iomanip> |
10 | | #include <iostream> |
11 | | #include <span> |
12 | | #include <vector> |
13 | | |
14 | | #include "helpers/common.h" |
15 | | #include "helpers/nameof.hpp" |
16 | | |
17 | | #include "simdutf.h" |
18 | | |
19 | | // clang-format off |
20 | | // suppress warnings from attributes when expanding function pointers in |
21 | | // nameof macros |
22 | | #if !defined(SIMDUTF_REGULAR_VISUAL_STUDIO) |
23 | | SIMDUTF_DISABLE_GCC_WARNING(-Wignored-attributes); |
24 | | #endif |
25 | | //clang-format on |
26 | | |
27 | | |
28 | | // these knobs tweak how the fuzzer works |
29 | | constexpr bool allow_implementations_to_differ = false; |
30 | | constexpr bool use_canary_in_output = true; |
31 | | constexpr bool use_separate_allocation = true; |
32 | | |
33 | | enum class UtfEncodings { UTF16BE, UTF16LE, UTF8, UTF32, LATIN1 }; |
34 | | |
35 | | template <UtfEncodings encoding> struct ValidationFunctionTrait {}; |
36 | | |
37 | | template <> struct ValidationFunctionTrait<UtfEncodings::UTF16BE> { |
38 | | static inline auto Validation = &simdutf::implementation::validate_utf16be; |
39 | | static inline auto ValidationWithErrors = |
40 | | &simdutf::implementation::validate_utf16be_with_errors; |
41 | | static inline std::string ValidationWithErrorsName{ |
42 | | NAMEOF(&simdutf::implementation::validate_utf16be_with_errors)}; |
43 | | static inline std::string ValidationName{ |
44 | | NAMEOF(&simdutf::implementation::validate_utf16be)}; |
45 | | using RawType = char16_t; |
46 | | }; |
47 | | template <> struct ValidationFunctionTrait<UtfEncodings::UTF16LE> { |
48 | | static inline auto Validation = &simdutf::implementation::validate_utf16le; |
49 | | static inline auto ValidationWithErrors = |
50 | | &simdutf::implementation::validate_utf16le_with_errors; |
51 | | static inline std::string ValidationWithErrorsName{ |
52 | | NAMEOF(&simdutf::implementation::validate_utf16le_with_errors)}; |
53 | | static inline std::string ValidationName{ |
54 | | NAMEOF(&simdutf::implementation::validate_utf16le)}; |
55 | | using RawType = char16_t; |
56 | | }; |
57 | | template <> struct ValidationFunctionTrait<UtfEncodings::UTF32> { |
58 | | static inline auto Validation = &simdutf::implementation::validate_utf32; |
59 | | static inline auto ValidationWithErrors = |
60 | | &simdutf::implementation::validate_utf32_with_errors; |
61 | | static inline std::string ValidationWithErrorsName{ |
62 | | NAMEOF(&simdutf::implementation::validate_utf32_with_errors)}; |
63 | | static inline std::string ValidationName{ |
64 | | NAMEOF(&simdutf::implementation::validate_utf32)}; |
65 | | using RawType = char32_t; |
66 | | }; |
67 | | template <> struct ValidationFunctionTrait<UtfEncodings::UTF8> { |
68 | | static inline auto Validation = &simdutf::implementation::validate_utf8; |
69 | | static inline auto ValidationWithErrors = |
70 | | &simdutf::implementation::validate_utf8_with_errors; |
71 | | static inline std::string ValidationWithErrorsName{ |
72 | | NAMEOF(&simdutf::implementation::validate_utf8_with_errors)}; |
73 | | static inline std::string ValidationName{ |
74 | | NAMEOF(&simdutf::implementation::validate_utf8)}; |
75 | | using RawType = char; |
76 | | }; |
77 | | template <> struct ValidationFunctionTrait<UtfEncodings::LATIN1> { |
78 | | // note - there are no validation functions for latin1, all input is valid. |
79 | | using RawType = char; |
80 | | }; |
81 | | |
82 | 0 | constexpr std::string_view nameoftype(char) { return "char"; } |
83 | 0 | constexpr std::string_view nameoftype(char16_t) { return "char16_t"; } |
84 | 0 | constexpr std::string_view nameoftype(char32_t) { return "char32_t"; } |
85 | | |
86 | | /// given the name of a conversion function, return the enum describing the |
87 | | /// *from* type. must be a macro because of string view not being sufficiently |
88 | | /// constexpr. |
89 | | #define ENCODING_FROM_CONVERSION_NAME(x) \ |
90 | | []() { \ |
91 | | using sv = std::string_view; \ |
92 | | using enum UtfEncodings; \ |
93 | | if constexpr (sv{NAMEOF(x)}.find("utf16be_to") != sv::npos) { \ |
94 | | return UTF16BE; \ |
95 | | } else if constexpr (sv{NAMEOF(x)}.find("utf16le_to") != sv::npos) { \ |
96 | | return UTF16LE; \ |
97 | | } else if constexpr (sv{NAMEOF(x)}.find("utf32_to") != sv::npos) { \ |
98 | | return UTF32; \ |
99 | | } else if constexpr (sv{NAMEOF(x)}.find("utf8_to") != sv::npos) { \ |
100 | | return UTF8; \ |
101 | | } else if constexpr (sv{NAMEOF(x)}.find("latin1_to") != sv::npos) { \ |
102 | | return LATIN1; \ |
103 | | } else { \ |
104 | | throw "oops"; \ |
105 | | } \ |
106 | | }() |
107 | | |
108 | | /// given the name of a conversion function, return the enum describing the |
109 | | /// *to* type. must be a macro because of string view not being sufficiently |
110 | | /// constexpr. |
111 | | #define ENCODING_TO_CONVERSION_NAME(x) \ |
112 | | []() { \ |
113 | | using sv = std::string_view; \ |
114 | | using enum UtfEncodings; \ |
115 | | if constexpr (sv{NAMEOF(x)}.find("to_utf16be") != sv::npos) { \ |
116 | | return UTF16BE; \ |
117 | | } else if constexpr (sv{NAMEOF(x)}.find("to_utf16le") != sv::npos) { \ |
118 | | return UTF16LE; \ |
119 | | } else if constexpr (sv{NAMEOF(x)}.find("to_utf32") != sv::npos) { \ |
120 | | return UTF32; \ |
121 | | } else if constexpr (sv{NAMEOF(x)}.find("to_utf8") != sv::npos) { \ |
122 | | return UTF8; \ |
123 | | } else if constexpr (sv{NAMEOF(x)}.find("to_latin1") != sv::npos) { \ |
124 | | return LATIN1; \ |
125 | | } else { \ |
126 | | throw "oops"; \ |
127 | | } \ |
128 | | }() |
129 | | |
130 | | template <typename R> struct result { |
131 | | R retval{}; |
132 | | std::string outputhash; |
133 | | auto operator<=>(const result<R>&) const = default; |
134 | | }; |
135 | | |
136 | | template <typename R> |
137 | 0 | std::ostream& operator<<(std::ostream& os, const result<R>& r) { |
138 | 0 | os << "[retval=" << r.retval << ", output hash=" << r.outputhash << "]"; |
139 | 0 | return os; |
140 | 0 | } Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >& operator<< <unsigned long>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, result<unsigned long> const&) Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >& operator<< <simdutf::result>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, result<simdutf::result> const&) |
141 | | |
142 | | template <UtfEncodings From, UtfEncodings To, |
143 | | member_function_pointer LengthFunction, |
144 | | member_function_pointer ConversionFunction> |
145 | | struct Conversion { |
146 | | LengthFunction lengthcalc; |
147 | | ConversionFunction conversion; |
148 | | std::string lengthcalcname; |
149 | | std::string name; |
150 | | |
151 | | using FromType = ValidationFunctionTrait<From>::RawType; |
152 | | using ToType = ValidationFunctionTrait<To>::RawType; |
153 | | |
154 | | using FromSpan = std::span<const FromType>; |
155 | | |
156 | | using ConversionResult = |
157 | | std::invoke_result<ConversionFunction, const simdutf::implementation*, |
158 | | const FromType*, std::size_t, ToType*>::type; |
159 | | |
160 | | struct validation_result { |
161 | | bool valid{}; |
162 | | bool implementations_agree{}; |
163 | | }; |
164 | | |
165 | | struct length_result { |
166 | | std::vector<std::size_t> length{}; |
167 | | bool implementations_agree{}; |
168 | | }; |
169 | | |
170 | | struct conversion_result { |
171 | | std::size_t written{}; |
172 | | bool implementations_agree{}; |
173 | | }; |
174 | | |
175 | 8.65k | void fuzz(std::span<const char> chardata) const { |
176 | | // assume the input is aligned to FromType |
177 | 8.65k | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), |
178 | 8.65k | chardata.size() / sizeof(FromType)}; |
179 | | |
180 | 8.65k | static const bool do_print_testcase = |
181 | 8.65k | std::getenv("PRINT_FUZZ_CASE") != nullptr; |
182 | | |
183 | 8.65k | if (do_print_testcase) { |
184 | 0 | dump_testcase(from, std::cerr); |
185 | 0 | std::exit(EXIT_SUCCESS); |
186 | 0 | } |
187 | | |
188 | 8.65k | do { |
189 | | // step 0 - is the input valid? |
190 | 8.65k | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); |
191 | 8.65k | if (!valid_input_agree && !allow_implementations_to_differ) |
192 | 0 | break; |
193 | | |
194 | | // step 1 - count the input (only makes sense for some of the encodings) |
195 | | if constexpr (From == UtfEncodings::UTF16BE || |
196 | | From == UtfEncodings::UTF16LE || |
197 | 5.86k | From == UtfEncodings::UTF8) { |
198 | 5.86k | if (!count_the_input(from) && !allow_implementations_to_differ) |
199 | 0 | break; |
200 | 5.86k | } |
201 | | |
202 | | // step 2 - what is the required size of the output? |
203 | 5.86k | const auto [output_length, length_agree] = |
204 | 8.65k | calculate_length(from, inputisvalid); |
205 | 8.65k | if (!length_agree && !allow_implementations_to_differ) |
206 | 0 | break; |
207 | | |
208 | 8.65k | if (!inputisvalid && name.find("valid") != std::string::npos) { |
209 | | // don't run the conversion step, it requires valid input |
210 | 102 | return; |
211 | 102 | } |
212 | | |
213 | | // step 3 - run the conversion |
214 | 8.55k | const auto [written, outputs_agree] = |
215 | 8.55k | do_conversion(from, output_length, inputisvalid); |
216 | 8.55k | if (!outputs_agree && !allow_implementations_to_differ) |
217 | 0 | break; |
218 | | |
219 | | // coming this far means no problems were found |
220 | 8.55k | return; |
221 | 8.55k | } while (0); |
222 | | // if we come here, something failed |
223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " |
224 | 0 | "reproducer to stderr\n"; |
225 | 0 | std::abort(); |
226 | 8.65k | } Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 178 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 178 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 178 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 178 | static const bool do_print_testcase = | 181 | 178 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 178 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 178 | do { | 189 | | // step 0 - is the input valid? | 190 | 178 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 178 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 178 | From == UtfEncodings::UTF8) { | 198 | 178 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 178 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 178 | const auto [output_length, length_agree] = | 204 | 178 | calculate_length(from, inputisvalid); | 205 | 178 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 178 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 18 | return; | 211 | 18 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 160 | const auto [written, outputs_agree] = | 215 | 160 | do_conversion(from, output_length, inputisvalid); | 216 | 160 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 160 | return; | 221 | 160 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 178 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 344 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 344 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 344 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 344 | static const bool do_print_testcase = | 181 | 344 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 344 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 344 | do { | 189 | | // step 0 - is the input valid? | 190 | 344 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 344 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 344 | From == UtfEncodings::UTF8) { | 198 | 344 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 344 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 344 | const auto [output_length, length_agree] = | 204 | 344 | calculate_length(from, inputisvalid); | 205 | 344 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 344 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 18 | return; | 211 | 18 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 326 | const auto [written, outputs_agree] = | 215 | 326 | do_conversion(from, output_length, inputisvalid); | 216 | 326 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 326 | return; | 221 | 326 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 344 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 183 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 183 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 183 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 183 | static const bool do_print_testcase = | 181 | 183 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 183 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 183 | do { | 189 | | // step 0 - is the input valid? | 190 | 183 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 183 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 183 | From == UtfEncodings::UTF8) { | 198 | 183 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 183 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 183 | const auto [output_length, length_agree] = | 204 | 183 | calculate_length(from, inputisvalid); | 205 | 183 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 183 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 3 | return; | 211 | 3 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 180 | const auto [written, outputs_agree] = | 215 | 180 | do_conversion(from, output_length, inputisvalid); | 216 | 180 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 180 | return; | 221 | 180 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 183 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 387 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 387 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 387 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 387 | static const bool do_print_testcase = | 181 | 387 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 387 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 387 | do { | 189 | | // step 0 - is the input valid? | 190 | 387 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 387 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 387 | From == UtfEncodings::UTF8) { | 198 | 387 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 387 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 387 | const auto [output_length, length_agree] = | 204 | 387 | calculate_length(from, inputisvalid); | 205 | 387 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 387 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 9 | return; | 211 | 9 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 378 | const auto [written, outputs_agree] = | 215 | 378 | do_conversion(from, output_length, inputisvalid); | 216 | 378 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 378 | return; | 221 | 378 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 387 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 292 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 292 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 292 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 292 | static const bool do_print_testcase = | 181 | 292 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 292 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 292 | do { | 189 | | // step 0 - is the input valid? | 190 | 292 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 292 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 292 | const auto [output_length, length_agree] = | 204 | 292 | calculate_length(from, inputisvalid); | 205 | 292 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 292 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 11 | return; | 211 | 11 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 281 | const auto [written, outputs_agree] = | 215 | 281 | do_conversion(from, output_length, inputisvalid); | 216 | 281 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 281 | return; | 221 | 281 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 292 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 253 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 253 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 253 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 253 | static const bool do_print_testcase = | 181 | 253 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 253 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 253 | do { | 189 | | // step 0 - is the input valid? | 190 | 253 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 253 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 253 | const auto [output_length, length_agree] = | 204 | 253 | calculate_length(from, inputisvalid); | 205 | 253 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 253 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 5 | return; | 211 | 5 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 248 | const auto [written, outputs_agree] = | 215 | 248 | do_conversion(from, output_length, inputisvalid); | 216 | 248 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 248 | return; | 221 | 248 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 253 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 499 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 499 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 499 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 499 | static const bool do_print_testcase = | 181 | 499 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 499 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 499 | do { | 189 | | // step 0 - is the input valid? | 190 | 499 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 499 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 499 | const auto [output_length, length_agree] = | 204 | 499 | calculate_length(from, inputisvalid); | 205 | 499 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 499 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 5 | return; | 211 | 5 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 494 | const auto [written, outputs_agree] = | 215 | 494 | do_conversion(from, output_length, inputisvalid); | 216 | 494 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 494 | return; | 221 | 494 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 499 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 645 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 645 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 645 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 645 | static const bool do_print_testcase = | 181 | 645 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 645 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 645 | do { | 189 | | // step 0 - is the input valid? | 190 | 645 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 645 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 645 | From == UtfEncodings::UTF8) { | 198 | 645 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 645 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 645 | const auto [output_length, length_agree] = | 204 | 645 | calculate_length(from, inputisvalid); | 205 | 645 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 645 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 13 | return; | 211 | 13 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 632 | const auto [written, outputs_agree] = | 215 | 632 | do_conversion(from, output_length, inputisvalid); | 216 | 632 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 632 | return; | 221 | 632 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 645 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 599 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 599 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 599 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 599 | static const bool do_print_testcase = | 181 | 599 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 599 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 599 | do { | 189 | | // step 0 - is the input valid? | 190 | 599 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 599 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 599 | From == UtfEncodings::UTF8) { | 198 | 599 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 599 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 599 | const auto [output_length, length_agree] = | 204 | 599 | calculate_length(from, inputisvalid); | 205 | 599 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 599 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 11 | return; | 211 | 11 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 588 | const auto [written, outputs_agree] = | 215 | 588 | do_conversion(from, output_length, inputisvalid); | 216 | 588 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 588 | return; | 221 | 588 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 599 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 636 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 636 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 636 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 636 | static const bool do_print_testcase = | 181 | 636 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 636 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 636 | do { | 189 | | // step 0 - is the input valid? | 190 | 636 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 636 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 636 | From == UtfEncodings::UTF8) { | 198 | 636 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 636 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 636 | const auto [output_length, length_agree] = | 204 | 636 | calculate_length(from, inputisvalid); | 205 | 636 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 636 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 9 | return; | 211 | 9 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 627 | const auto [written, outputs_agree] = | 215 | 627 | do_conversion(from, output_length, inputisvalid); | 216 | 627 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 627 | return; | 221 | 627 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 636 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 50 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 50 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 50 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 50 | static const bool do_print_testcase = | 181 | 50 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 50 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 50 | do { | 189 | | // step 0 - is the input valid? | 190 | 50 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 50 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 50 | From == UtfEncodings::UTF8) { | 198 | 50 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 50 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 50 | const auto [output_length, length_agree] = | 204 | 50 | calculate_length(from, inputisvalid); | 205 | 50 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 50 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 50 | const auto [written, outputs_agree] = | 215 | 50 | do_conversion(from, output_length, inputisvalid); | 216 | 50 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 50 | return; | 221 | 50 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 50 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 54 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 54 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 54 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 54 | static const bool do_print_testcase = | 181 | 54 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 54 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 54 | do { | 189 | | // step 0 - is the input valid? | 190 | 54 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 54 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 54 | From == UtfEncodings::UTF8) { | 198 | 54 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 54 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 54 | const auto [output_length, length_agree] = | 204 | 54 | calculate_length(from, inputisvalid); | 205 | 54 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 54 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 54 | const auto [written, outputs_agree] = | 215 | 54 | do_conversion(from, output_length, inputisvalid); | 216 | 54 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 54 | return; | 221 | 54 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 54 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 107 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 107 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 107 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 107 | static const bool do_print_testcase = | 181 | 107 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 107 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 107 | do { | 189 | | // step 0 - is the input valid? | 190 | 107 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 107 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 107 | const auto [output_length, length_agree] = | 204 | 107 | calculate_length(from, inputisvalid); | 205 | 107 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 107 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 107 | const auto [written, outputs_agree] = | 215 | 107 | do_conversion(from, output_length, inputisvalid); | 216 | 107 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 107 | return; | 221 | 107 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 107 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 277 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 277 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 277 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 277 | static const bool do_print_testcase = | 181 | 277 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 277 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 277 | do { | 189 | | // step 0 - is the input valid? | 190 | 277 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 277 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 277 | From == UtfEncodings::UTF8) { | 198 | 277 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 277 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 277 | const auto [output_length, length_agree] = | 204 | 277 | calculate_length(from, inputisvalid); | 205 | 277 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 277 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 277 | const auto [written, outputs_agree] = | 215 | 277 | do_conversion(from, output_length, inputisvalid); | 216 | 277 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 277 | return; | 221 | 277 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 277 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 122 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 122 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 122 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 122 | static const bool do_print_testcase = | 181 | 122 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 122 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 122 | do { | 189 | | // step 0 - is the input valid? | 190 | 122 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 122 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 122 | From == UtfEncodings::UTF8) { | 198 | 122 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 122 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 122 | const auto [output_length, length_agree] = | 204 | 122 | calculate_length(from, inputisvalid); | 205 | 122 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 122 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 122 | const auto [written, outputs_agree] = | 215 | 122 | do_conversion(from, output_length, inputisvalid); | 216 | 122 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 122 | return; | 221 | 122 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 122 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 166 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 166 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 166 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 166 | static const bool do_print_testcase = | 181 | 166 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 166 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 166 | do { | 189 | | // step 0 - is the input valid? | 190 | 166 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 166 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 166 | From == UtfEncodings::UTF8) { | 198 | 166 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 166 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 166 | const auto [output_length, length_agree] = | 204 | 166 | calculate_length(from, inputisvalid); | 205 | 166 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 166 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 166 | const auto [written, outputs_agree] = | 215 | 166 | do_conversion(from, output_length, inputisvalid); | 216 | 166 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 166 | return; | 221 | 166 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 166 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 355 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 355 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 355 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 355 | static const bool do_print_testcase = | 181 | 355 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 355 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 355 | do { | 189 | | // step 0 - is the input valid? | 190 | 355 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 355 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 355 | From == UtfEncodings::UTF8) { | 198 | 355 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 355 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 355 | const auto [output_length, length_agree] = | 204 | 355 | calculate_length(from, inputisvalid); | 205 | 355 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 355 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 355 | const auto [written, outputs_agree] = | 215 | 355 | do_conversion(from, output_length, inputisvalid); | 216 | 355 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 355 | return; | 221 | 355 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 355 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 113 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 113 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 113 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 113 | static const bool do_print_testcase = | 181 | 113 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 113 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 113 | do { | 189 | | // step 0 - is the input valid? | 190 | 113 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 113 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 113 | From == UtfEncodings::UTF8) { | 198 | 113 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 113 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 113 | const auto [output_length, length_agree] = | 204 | 113 | calculate_length(from, inputisvalid); | 205 | 113 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 113 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 113 | const auto [written, outputs_agree] = | 215 | 113 | do_conversion(from, output_length, inputisvalid); | 216 | 113 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 113 | return; | 221 | 113 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 113 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 156 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 156 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 156 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 156 | static const bool do_print_testcase = | 181 | 156 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 156 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 156 | do { | 189 | | // step 0 - is the input valid? | 190 | 156 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 156 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 156 | From == UtfEncodings::UTF8) { | 198 | 156 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 156 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 156 | const auto [output_length, length_agree] = | 204 | 156 | calculate_length(from, inputisvalid); | 205 | 156 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 156 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 156 | const auto [written, outputs_agree] = | 215 | 156 | do_conversion(from, output_length, inputisvalid); | 216 | 156 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 156 | return; | 221 | 156 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 156 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 307 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 307 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 307 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 307 | static const bool do_print_testcase = | 181 | 307 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 307 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 307 | do { | 189 | | // step 0 - is the input valid? | 190 | 307 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 307 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 307 | From == UtfEncodings::UTF8) { | 198 | 307 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 307 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 307 | const auto [output_length, length_agree] = | 204 | 307 | calculate_length(from, inputisvalid); | 205 | 307 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 307 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 307 | const auto [written, outputs_agree] = | 215 | 307 | do_conversion(from, output_length, inputisvalid); | 216 | 307 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 307 | return; | 221 | 307 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 307 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 201 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 201 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 201 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 201 | static const bool do_print_testcase = | 181 | 201 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 201 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 201 | do { | 189 | | // step 0 - is the input valid? | 190 | 201 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 201 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 201 | const auto [output_length, length_agree] = | 204 | 201 | calculate_length(from, inputisvalid); | 205 | 201 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 201 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 201 | const auto [written, outputs_agree] = | 215 | 201 | do_conversion(from, output_length, inputisvalid); | 216 | 201 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 201 | return; | 221 | 201 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 201 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 308 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 308 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 308 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 308 | static const bool do_print_testcase = | 181 | 308 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 308 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 308 | do { | 189 | | // step 0 - is the input valid? | 190 | 308 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 308 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 308 | const auto [output_length, length_agree] = | 204 | 308 | calculate_length(from, inputisvalid); | 205 | 308 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 308 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 308 | const auto [written, outputs_agree] = | 215 | 308 | do_conversion(from, output_length, inputisvalid); | 216 | 308 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 308 | return; | 221 | 308 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 308 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 285 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 285 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 285 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 285 | static const bool do_print_testcase = | 181 | 285 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 285 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 285 | do { | 189 | | // step 0 - is the input valid? | 190 | 285 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 285 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 285 | const auto [output_length, length_agree] = | 204 | 285 | calculate_length(from, inputisvalid); | 205 | 285 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 285 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 285 | const auto [written, outputs_agree] = | 215 | 285 | do_conversion(from, output_length, inputisvalid); | 216 | 285 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 285 | return; | 221 | 285 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 285 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 451 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 451 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 451 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 451 | static const bool do_print_testcase = | 181 | 451 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 451 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 451 | do { | 189 | | // step 0 - is the input valid? | 190 | 451 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 451 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 451 | const auto [output_length, length_agree] = | 204 | 451 | calculate_length(from, inputisvalid); | 205 | 451 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 451 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 451 | const auto [written, outputs_agree] = | 215 | 451 | do_conversion(from, output_length, inputisvalid); | 216 | 451 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 451 | return; | 221 | 451 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 284 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 284 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 284 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 284 | static const bool do_print_testcase = | 181 | 284 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 284 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 284 | do { | 189 | | // step 0 - is the input valid? | 190 | 284 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 284 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 284 | From == UtfEncodings::UTF8) { | 198 | 284 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 284 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 284 | const auto [output_length, length_agree] = | 204 | 284 | calculate_length(from, inputisvalid); | 205 | 284 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 284 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 284 | const auto [written, outputs_agree] = | 215 | 284 | do_conversion(from, output_length, inputisvalid); | 216 | 284 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 284 | return; | 221 | 284 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 353 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 353 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 353 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 353 | static const bool do_print_testcase = | 181 | 353 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 353 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 353 | do { | 189 | | // step 0 - is the input valid? | 190 | 353 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 353 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 353 | From == UtfEncodings::UTF8) { | 198 | 353 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 353 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 353 | const auto [output_length, length_agree] = | 204 | 353 | calculate_length(from, inputisvalid); | 205 | 353 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 353 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 353 | const auto [written, outputs_agree] = | 215 | 353 | do_conversion(from, output_length, inputisvalid); | 216 | 353 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 353 | return; | 221 | 353 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 353 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 284 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 284 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 284 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 284 | static const bool do_print_testcase = | 181 | 284 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 284 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 284 | do { | 189 | | // step 0 - is the input valid? | 190 | 284 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 284 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 284 | From == UtfEncodings::UTF8) { | 198 | 284 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 284 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 284 | const auto [output_length, length_agree] = | 204 | 284 | calculate_length(from, inputisvalid); | 205 | 284 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 284 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 284 | const auto [written, outputs_agree] = | 215 | 284 | do_conversion(from, output_length, inputisvalid); | 216 | 284 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 284 | return; | 221 | 284 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 376 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 376 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 376 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 376 | static const bool do_print_testcase = | 181 | 376 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 376 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 376 | do { | 189 | | // step 0 - is the input valid? | 190 | 376 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 376 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 376 | From == UtfEncodings::UTF8) { | 198 | 376 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 376 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 376 | const auto [output_length, length_agree] = | 204 | 376 | calculate_length(from, inputisvalid); | 205 | 376 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 376 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 376 | const auto [written, outputs_agree] = | 215 | 376 | do_conversion(from, output_length, inputisvalid); | 216 | 376 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 376 | return; | 221 | 376 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 376 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 40 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 40 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 40 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 40 | static const bool do_print_testcase = | 181 | 40 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 40 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 40 | do { | 189 | | // step 0 - is the input valid? | 190 | 40 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 40 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 40 | const auto [output_length, length_agree] = | 204 | 40 | calculate_length(from, inputisvalid); | 205 | 40 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 40 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 40 | const auto [written, outputs_agree] = | 215 | 40 | do_conversion(from, output_length, inputisvalid); | 216 | 40 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 40 | return; | 221 | 40 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 40 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 40 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 40 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 40 | static const bool do_print_testcase = | 181 | 40 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 40 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 40 | do { | 189 | | // step 0 - is the input valid? | 190 | 40 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 40 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 40 | const auto [output_length, length_agree] = | 204 | 40 | calculate_length(from, inputisvalid); | 205 | 40 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 40 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 40 | const auto [written, outputs_agree] = | 215 | 40 | do_conversion(from, output_length, inputisvalid); | 216 | 40 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 40 | return; | 221 | 40 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 27 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 27 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 27 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 27 | static const bool do_print_testcase = | 181 | 27 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 27 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 27 | do { | 189 | | // step 0 - is the input valid? | 190 | 27 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 27 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 27 | const auto [output_length, length_agree] = | 204 | 27 | calculate_length(from, inputisvalid); | 205 | 27 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 27 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 27 | const auto [written, outputs_agree] = | 215 | 27 | do_conversion(from, output_length, inputisvalid); | 216 | 27 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 27 | return; | 221 | 27 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 27 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 175 | 287 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 287 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 287 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 287 | static const bool do_print_testcase = | 181 | 287 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 287 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 287 | do { | 189 | | // step 0 - is the input valid? | 190 | 287 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 287 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 287 | const auto [output_length, length_agree] = | 204 | 287 | calculate_length(from, inputisvalid); | 205 | 287 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 287 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 287 | const auto [written, outputs_agree] = | 215 | 287 | do_conversion(from, output_length, inputisvalid); | 216 | 287 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 287 | return; | 221 | 287 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 287 | } |
|
227 | | |
228 | | template <typename Dummy = void> |
229 | | requires(From != UtfEncodings::LATIN1) |
230 | 8.26k | validation_result verify_valid_input(FromSpan src) const { |
231 | 8.26k | validation_result ret{}; |
232 | | |
233 | 8.26k | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; |
234 | 8.26k | const auto implementations = get_supported_implementations(); |
235 | 8.26k | std::vector<simdutf::result> results; |
236 | 8.26k | results.reserve(implementations.size()); |
237 | | |
238 | 24.7k | for (auto impl : implementations) { |
239 | 24.7k | results.push_back( |
240 | 24.7k | std::invoke(input_validation, impl, src.data(), src.size())); |
241 | | |
242 | | // make sure the validation variant that returns a bool agrees |
243 | 24.7k | const bool validation1 = results.back().error == simdutf::SUCCESS; |
244 | 24.7k | const bool validation2 = |
245 | 24.7k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, |
246 | 24.7k | src.data(), src.size()); |
247 | 24.7k | if (validation1 != validation2) { |
248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; |
249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName |
250 | 0 | << " gives " << validation1 << " while " |
251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " |
252 | 0 | << validation2 << " for implementation " << impl->name() |
253 | 0 | << '\n'; |
254 | 0 | std::cerr << "end errormessage\n"; |
255 | 0 | std::abort(); |
256 | 0 | } |
257 | 24.7k | } |
258 | | |
259 | 16.5k | auto neq = [](const auto& a, const auto& b) { return a != b; }; _ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 688 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 366 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 774 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 584 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 506 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 998 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 1.29k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 1.19k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 1.27k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 100 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 108 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 214 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_ Line | Count | Source | 259 | 554 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS5_S5_EEDaSJ_SM_ Line | Count | Source | 259 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 332 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 710 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS5_S5_EEDaSJ_SM_ Line | Count | Source | 259 | 226 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 312 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 614 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS5_S5_EEDaSJ_SM_ Line | Count | Source | 259 | 402 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 616 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 570 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 902 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 706 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_ Line | Count | Source | 259 | 752 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
260 | 8.26k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; |
262 | 0 | std::cerr << "in fuzz case for " |
263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName |
264 | 0 | << " invoked with " << src.size() << " elements:\n"; |
265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
266 | 0 | std::cerr << "got return " << std::dec << results[i] |
267 | 0 | << " from implementation " << implementations[i]->name() |
268 | 0 | << '\n'; |
269 | 0 | } |
270 | 0 | std::cerr << "end errormessage\n"; |
271 | 0 | ret.implementations_agree = false; |
272 | 8.26k | } else { |
273 | 8.26k | ret.implementations_agree = true; |
274 | 8.26k | } |
275 | 16.2k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { |
276 | 16.2k | return r.error == simdutf::SUCCESS; |
277 | 16.2k | }); _ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 406 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 406 | return r.error == simdutf::SUCCESS; | 277 | 406 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 850 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 850 | return r.error == simdutf::SUCCESS; | 277 | 850 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 397 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 397 | return r.error == simdutf::SUCCESS; | 277 | 397 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 993 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 993 | return r.error == simdutf::SUCCESS; | 277 | 993 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 510 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 510 | return r.error == simdutf::SUCCESS; | 277 | 510 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 487 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 487 | return r.error == simdutf::SUCCESS; | 277 | 487 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 933 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 933 | return r.error == simdutf::SUCCESS; | 277 | 933 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.29k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.29k | return r.error == simdutf::SUCCESS; | 277 | 1.29k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.21k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.21k | return r.error == simdutf::SUCCESS; | 277 | 1.21k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.27k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.27k | return r.error == simdutf::SUCCESS; | 277 | 1.27k | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 142 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 142 | return r.error == simdutf::SUCCESS; | 277 | 142 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 144 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 144 | return r.error == simdutf::SUCCESS; | 277 | 144 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 157 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 157 | return r.error == simdutf::SUCCESS; | 277 | 157 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 473 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 473 | return r.error == simdutf::SUCCESS; | 277 | 473 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 312 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 312 | return r.error == simdutf::SUCCESS; | 277 | 312 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 308 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 308 | return r.error == simdutf::SUCCESS; | 277 | 308 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 819 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 819 | return r.error == simdutf::SUCCESS; | 277 | 819 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 287 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 287 | return r.error == simdutf::SUCCESS; | 277 | 287 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 284 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 284 | return r.error == simdutf::SUCCESS; | 277 | 284 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 681 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 681 | return r.error == simdutf::SUCCESS; | 277 | 681 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 255 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 255 | return r.error == simdutf::SUCCESS; | 277 | 255 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 474 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 474 | return r.error == simdutf::SUCCESS; | 277 | 474 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 425 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 425 | return r.error == simdutf::SUCCESS; | 277 | 425 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 687 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 687 | return r.error == simdutf::SUCCESS; | 277 | 687 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 520 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 520 | return r.error == simdutf::SUCCESS; | 277 | 520 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 665 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 665 | return r.error == simdutf::SUCCESS; | 277 | 665 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 524 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 524 | return r.error == simdutf::SUCCESS; | 277 | 524 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 718 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 718 | return r.error == simdutf::SUCCESS; | 277 | 718 | }); |
|
278 | 8.26k | return ret; |
279 | 8.26k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 178 | validation_result verify_valid_input(FromSpan src) const { | 231 | 178 | validation_result ret{}; | 232 | | | 233 | 178 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 178 | const auto implementations = get_supported_implementations(); | 235 | 178 | std::vector<simdutf::result> results; | 236 | 178 | results.reserve(implementations.size()); | 237 | | | 238 | 534 | for (auto impl : implementations) { | 239 | 534 | results.push_back( | 240 | 534 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 534 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 534 | const bool validation2 = | 245 | 534 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 534 | src.data(), src.size()); | 247 | 534 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 534 | } | 258 | | | 259 | 178 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 178 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 178 | } else { | 273 | 178 | ret.implementations_agree = true; | 274 | 178 | } | 275 | 178 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 178 | return r.error == simdutf::SUCCESS; | 277 | 178 | }); | 278 | 178 | return ret; | 279 | 178 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 344 | validation_result verify_valid_input(FromSpan src) const { | 231 | 344 | validation_result ret{}; | 232 | | | 233 | 344 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 344 | const auto implementations = get_supported_implementations(); | 235 | 344 | std::vector<simdutf::result> results; | 236 | 344 | results.reserve(implementations.size()); | 237 | | | 238 | 1.03k | for (auto impl : implementations) { | 239 | 1.03k | results.push_back( | 240 | 1.03k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.03k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.03k | const bool validation2 = | 245 | 1.03k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.03k | src.data(), src.size()); | 247 | 1.03k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.03k | } | 258 | | | 259 | 344 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 344 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 344 | } else { | 273 | 344 | ret.implementations_agree = true; | 274 | 344 | } | 275 | 344 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 344 | return r.error == simdutf::SUCCESS; | 277 | 344 | }); | 278 | 344 | return ret; | 279 | 344 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 183 | validation_result verify_valid_input(FromSpan src) const { | 231 | 183 | validation_result ret{}; | 232 | | | 233 | 183 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 183 | const auto implementations = get_supported_implementations(); | 235 | 183 | std::vector<simdutf::result> results; | 236 | 183 | results.reserve(implementations.size()); | 237 | | | 238 | 549 | for (auto impl : implementations) { | 239 | 549 | results.push_back( | 240 | 549 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 549 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 549 | const bool validation2 = | 245 | 549 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 549 | src.data(), src.size()); | 247 | 549 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 549 | } | 258 | | | 259 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 183 | } else { | 273 | 183 | ret.implementations_agree = true; | 274 | 183 | } | 275 | 183 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 183 | return r.error == simdutf::SUCCESS; | 277 | 183 | }); | 278 | 183 | return ret; | 279 | 183 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 387 | validation_result verify_valid_input(FromSpan src) const { | 231 | 387 | validation_result ret{}; | 232 | | | 233 | 387 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 387 | const auto implementations = get_supported_implementations(); | 235 | 387 | std::vector<simdutf::result> results; | 236 | 387 | results.reserve(implementations.size()); | 237 | | | 238 | 1.16k | for (auto impl : implementations) { | 239 | 1.16k | results.push_back( | 240 | 1.16k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.16k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.16k | const bool validation2 = | 245 | 1.16k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.16k | src.data(), src.size()); | 247 | 1.16k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.16k | } | 258 | | | 259 | 387 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 387 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 387 | } else { | 273 | 387 | ret.implementations_agree = true; | 274 | 387 | } | 275 | 387 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 387 | return r.error == simdutf::SUCCESS; | 277 | 387 | }); | 278 | 387 | return ret; | 279 | 387 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 292 | validation_result verify_valid_input(FromSpan src) const { | 231 | 292 | validation_result ret{}; | 232 | | | 233 | 292 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 292 | const auto implementations = get_supported_implementations(); | 235 | 292 | std::vector<simdutf::result> results; | 236 | 292 | results.reserve(implementations.size()); | 237 | | | 238 | 876 | for (auto impl : implementations) { | 239 | 876 | results.push_back( | 240 | 876 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 876 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 876 | const bool validation2 = | 245 | 876 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 876 | src.data(), src.size()); | 247 | 876 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 876 | } | 258 | | | 259 | 292 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 292 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 292 | } else { | 273 | 292 | ret.implementations_agree = true; | 274 | 292 | } | 275 | 292 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 292 | return r.error == simdutf::SUCCESS; | 277 | 292 | }); | 278 | 292 | return ret; | 279 | 292 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 253 | validation_result verify_valid_input(FromSpan src) const { | 231 | 253 | validation_result ret{}; | 232 | | | 233 | 253 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 253 | const auto implementations = get_supported_implementations(); | 235 | 253 | std::vector<simdutf::result> results; | 236 | 253 | results.reserve(implementations.size()); | 237 | | | 238 | 759 | for (auto impl : implementations) { | 239 | 759 | results.push_back( | 240 | 759 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 759 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 759 | const bool validation2 = | 245 | 759 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 759 | src.data(), src.size()); | 247 | 759 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 759 | } | 258 | | | 259 | 253 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 253 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 253 | } else { | 273 | 253 | ret.implementations_agree = true; | 274 | 253 | } | 275 | 253 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 253 | return r.error == simdutf::SUCCESS; | 277 | 253 | }); | 278 | 253 | return ret; | 279 | 253 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 499 | validation_result verify_valid_input(FromSpan src) const { | 231 | 499 | validation_result ret{}; | 232 | | | 233 | 499 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 499 | const auto implementations = get_supported_implementations(); | 235 | 499 | std::vector<simdutf::result> results; | 236 | 499 | results.reserve(implementations.size()); | 237 | | | 238 | 1.49k | for (auto impl : implementations) { | 239 | 1.49k | results.push_back( | 240 | 1.49k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.49k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.49k | const bool validation2 = | 245 | 1.49k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.49k | src.data(), src.size()); | 247 | 1.49k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.49k | } | 258 | | | 259 | 499 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 499 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 499 | } else { | 273 | 499 | ret.implementations_agree = true; | 274 | 499 | } | 275 | 499 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 499 | return r.error == simdutf::SUCCESS; | 277 | 499 | }); | 278 | 499 | return ret; | 279 | 499 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 645 | validation_result verify_valid_input(FromSpan src) const { | 231 | 645 | validation_result ret{}; | 232 | | | 233 | 645 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 645 | const auto implementations = get_supported_implementations(); | 235 | 645 | std::vector<simdutf::result> results; | 236 | 645 | results.reserve(implementations.size()); | 237 | | | 238 | 1.93k | for (auto impl : implementations) { | 239 | 1.93k | results.push_back( | 240 | 1.93k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.93k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.93k | const bool validation2 = | 245 | 1.93k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.93k | src.data(), src.size()); | 247 | 1.93k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.93k | } | 258 | | | 259 | 645 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 645 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 645 | } else { | 273 | 645 | ret.implementations_agree = true; | 274 | 645 | } | 275 | 645 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 645 | return r.error == simdutf::SUCCESS; | 277 | 645 | }); | 278 | 645 | return ret; | 279 | 645 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 599 | validation_result verify_valid_input(FromSpan src) const { | 231 | 599 | validation_result ret{}; | 232 | | | 233 | 599 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 599 | const auto implementations = get_supported_implementations(); | 235 | 599 | std::vector<simdutf::result> results; | 236 | 599 | results.reserve(implementations.size()); | 237 | | | 238 | 1.79k | for (auto impl : implementations) { | 239 | 1.79k | results.push_back( | 240 | 1.79k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.79k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.79k | const bool validation2 = | 245 | 1.79k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.79k | src.data(), src.size()); | 247 | 1.79k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.79k | } | 258 | | | 259 | 599 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 599 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 599 | } else { | 273 | 599 | ret.implementations_agree = true; | 274 | 599 | } | 275 | 599 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 599 | return r.error == simdutf::SUCCESS; | 277 | 599 | }); | 278 | 599 | return ret; | 279 | 599 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 636 | validation_result verify_valid_input(FromSpan src) const { | 231 | 636 | validation_result ret{}; | 232 | | | 233 | 636 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 636 | const auto implementations = get_supported_implementations(); | 235 | 636 | std::vector<simdutf::result> results; | 236 | 636 | results.reserve(implementations.size()); | 237 | | | 238 | 1.90k | for (auto impl : implementations) { | 239 | 1.90k | results.push_back( | 240 | 1.90k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.90k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.90k | const bool validation2 = | 245 | 1.90k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.90k | src.data(), src.size()); | 247 | 1.90k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.90k | } | 258 | | | 259 | 636 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 636 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 636 | } else { | 273 | 636 | ret.implementations_agree = true; | 274 | 636 | } | 275 | 636 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 636 | return r.error == simdutf::SUCCESS; | 277 | 636 | }); | 278 | 636 | return ret; | 279 | 636 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 50 | validation_result verify_valid_input(FromSpan src) const { | 231 | 50 | validation_result ret{}; | 232 | | | 233 | 50 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 50 | const auto implementations = get_supported_implementations(); | 235 | 50 | std::vector<simdutf::result> results; | 236 | 50 | results.reserve(implementations.size()); | 237 | | | 238 | 150 | for (auto impl : implementations) { | 239 | 150 | results.push_back( | 240 | 150 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 150 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 150 | const bool validation2 = | 245 | 150 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 150 | src.data(), src.size()); | 247 | 150 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 150 | } | 258 | | | 259 | 50 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 50 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 50 | } else { | 273 | 50 | ret.implementations_agree = true; | 274 | 50 | } | 275 | 50 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 50 | return r.error == simdutf::SUCCESS; | 277 | 50 | }); | 278 | 50 | return ret; | 279 | 50 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 54 | validation_result verify_valid_input(FromSpan src) const { | 231 | 54 | validation_result ret{}; | 232 | | | 233 | 54 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 54 | const auto implementations = get_supported_implementations(); | 235 | 54 | std::vector<simdutf::result> results; | 236 | 54 | results.reserve(implementations.size()); | 237 | | | 238 | 162 | for (auto impl : implementations) { | 239 | 162 | results.push_back( | 240 | 162 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 162 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 162 | const bool validation2 = | 245 | 162 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 162 | src.data(), src.size()); | 247 | 162 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 162 | } | 258 | | | 259 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 54 | } else { | 273 | 54 | ret.implementations_agree = true; | 274 | 54 | } | 275 | 54 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 54 | return r.error == simdutf::SUCCESS; | 277 | 54 | }); | 278 | 54 | return ret; | 279 | 54 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 107 | validation_result verify_valid_input(FromSpan src) const { | 231 | 107 | validation_result ret{}; | 232 | | | 233 | 107 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 107 | const auto implementations = get_supported_implementations(); | 235 | 107 | std::vector<simdutf::result> results; | 236 | 107 | results.reserve(implementations.size()); | 237 | | | 238 | 321 | for (auto impl : implementations) { | 239 | 321 | results.push_back( | 240 | 321 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 321 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 321 | const bool validation2 = | 245 | 321 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 321 | src.data(), src.size()); | 247 | 321 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 321 | } | 258 | | | 259 | 107 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 107 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 107 | } else { | 273 | 107 | ret.implementations_agree = true; | 274 | 107 | } | 275 | 107 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 107 | return r.error == simdutf::SUCCESS; | 277 | 107 | }); | 278 | 107 | return ret; | 279 | 107 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 277 | validation_result verify_valid_input(FromSpan src) const { | 231 | 277 | validation_result ret{}; | 232 | | | 233 | 277 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 277 | const auto implementations = get_supported_implementations(); | 235 | 277 | std::vector<simdutf::result> results; | 236 | 277 | results.reserve(implementations.size()); | 237 | | | 238 | 831 | for (auto impl : implementations) { | 239 | 831 | results.push_back( | 240 | 831 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 831 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 831 | const bool validation2 = | 245 | 831 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 831 | src.data(), src.size()); | 247 | 831 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 831 | } | 258 | | | 259 | 277 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 277 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 277 | } else { | 273 | 277 | ret.implementations_agree = true; | 274 | 277 | } | 275 | 277 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 277 | return r.error == simdutf::SUCCESS; | 277 | 277 | }); | 278 | 277 | return ret; | 279 | 277 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 122 | validation_result verify_valid_input(FromSpan src) const { | 231 | 122 | validation_result ret{}; | 232 | | | 233 | 122 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 122 | const auto implementations = get_supported_implementations(); | 235 | 122 | std::vector<simdutf::result> results; | 236 | 122 | results.reserve(implementations.size()); | 237 | | | 238 | 366 | for (auto impl : implementations) { | 239 | 366 | results.push_back( | 240 | 366 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 366 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 366 | const bool validation2 = | 245 | 366 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 366 | src.data(), src.size()); | 247 | 366 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 366 | } | 258 | | | 259 | 122 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 122 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 122 | } else { | 273 | 122 | ret.implementations_agree = true; | 274 | 122 | } | 275 | 122 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 122 | return r.error == simdutf::SUCCESS; | 277 | 122 | }); | 278 | 122 | return ret; | 279 | 122 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 166 | validation_result verify_valid_input(FromSpan src) const { | 231 | 166 | validation_result ret{}; | 232 | | | 233 | 166 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 166 | const auto implementations = get_supported_implementations(); | 235 | 166 | std::vector<simdutf::result> results; | 236 | 166 | results.reserve(implementations.size()); | 237 | | | 238 | 498 | for (auto impl : implementations) { | 239 | 498 | results.push_back( | 240 | 498 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 498 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 498 | const bool validation2 = | 245 | 498 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 498 | src.data(), src.size()); | 247 | 498 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 498 | } | 258 | | | 259 | 166 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 166 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 166 | } else { | 273 | 166 | ret.implementations_agree = true; | 274 | 166 | } | 275 | 166 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 166 | return r.error == simdutf::SUCCESS; | 277 | 166 | }); | 278 | 166 | return ret; | 279 | 166 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 355 | validation_result verify_valid_input(FromSpan src) const { | 231 | 355 | validation_result ret{}; | 232 | | | 233 | 355 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 355 | const auto implementations = get_supported_implementations(); | 235 | 355 | std::vector<simdutf::result> results; | 236 | 355 | results.reserve(implementations.size()); | 237 | | | 238 | 1.06k | for (auto impl : implementations) { | 239 | 1.06k | results.push_back( | 240 | 1.06k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.06k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.06k | const bool validation2 = | 245 | 1.06k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.06k | src.data(), src.size()); | 247 | 1.06k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.06k | } | 258 | | | 259 | 355 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 355 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 355 | } else { | 273 | 355 | ret.implementations_agree = true; | 274 | 355 | } | 275 | 355 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 355 | return r.error == simdutf::SUCCESS; | 277 | 355 | }); | 278 | 355 | return ret; | 279 | 355 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 113 | validation_result verify_valid_input(FromSpan src) const { | 231 | 113 | validation_result ret{}; | 232 | | | 233 | 113 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 113 | const auto implementations = get_supported_implementations(); | 235 | 113 | std::vector<simdutf::result> results; | 236 | 113 | results.reserve(implementations.size()); | 237 | | | 238 | 339 | for (auto impl : implementations) { | 239 | 339 | results.push_back( | 240 | 339 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 339 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 339 | const bool validation2 = | 245 | 339 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 339 | src.data(), src.size()); | 247 | 339 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 339 | } | 258 | | | 259 | 113 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 113 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 113 | } else { | 273 | 113 | ret.implementations_agree = true; | 274 | 113 | } | 275 | 113 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 113 | return r.error == simdutf::SUCCESS; | 277 | 113 | }); | 278 | 113 | return ret; | 279 | 113 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 156 | validation_result verify_valid_input(FromSpan src) const { | 231 | 156 | validation_result ret{}; | 232 | | | 233 | 156 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 156 | const auto implementations = get_supported_implementations(); | 235 | 156 | std::vector<simdutf::result> results; | 236 | 156 | results.reserve(implementations.size()); | 237 | | | 238 | 468 | for (auto impl : implementations) { | 239 | 468 | results.push_back( | 240 | 468 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 468 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 468 | const bool validation2 = | 245 | 468 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 468 | src.data(), src.size()); | 247 | 468 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 468 | } | 258 | | | 259 | 156 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 156 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 156 | } else { | 273 | 156 | ret.implementations_agree = true; | 274 | 156 | } | 275 | 156 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 156 | return r.error == simdutf::SUCCESS; | 277 | 156 | }); | 278 | 156 | return ret; | 279 | 156 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 307 | validation_result verify_valid_input(FromSpan src) const { | 231 | 307 | validation_result ret{}; | 232 | | | 233 | 307 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 307 | const auto implementations = get_supported_implementations(); | 235 | 307 | std::vector<simdutf::result> results; | 236 | 307 | results.reserve(implementations.size()); | 237 | | | 238 | 921 | for (auto impl : implementations) { | 239 | 921 | results.push_back( | 240 | 921 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 921 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 921 | const bool validation2 = | 245 | 921 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 921 | src.data(), src.size()); | 247 | 921 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 921 | } | 258 | | | 259 | 307 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 307 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 307 | } else { | 273 | 307 | ret.implementations_agree = true; | 274 | 307 | } | 275 | 307 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 307 | return r.error == simdutf::SUCCESS; | 277 | 307 | }); | 278 | 307 | return ret; | 279 | 307 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 201 | validation_result verify_valid_input(FromSpan src) const { | 231 | 201 | validation_result ret{}; | 232 | | | 233 | 201 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 201 | const auto implementations = get_supported_implementations(); | 235 | 201 | std::vector<simdutf::result> results; | 236 | 201 | results.reserve(implementations.size()); | 237 | | | 238 | 603 | for (auto impl : implementations) { | 239 | 603 | results.push_back( | 240 | 603 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 603 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 603 | const bool validation2 = | 245 | 603 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 603 | src.data(), src.size()); | 247 | 603 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 603 | } | 258 | | | 259 | 201 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 201 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 201 | } else { | 273 | 201 | ret.implementations_agree = true; | 274 | 201 | } | 275 | 201 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 201 | return r.error == simdutf::SUCCESS; | 277 | 201 | }); | 278 | 201 | return ret; | 279 | 201 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 308 | validation_result verify_valid_input(FromSpan src) const { | 231 | 308 | validation_result ret{}; | 232 | | | 233 | 308 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 308 | const auto implementations = get_supported_implementations(); | 235 | 308 | std::vector<simdutf::result> results; | 236 | 308 | results.reserve(implementations.size()); | 237 | | | 238 | 924 | for (auto impl : implementations) { | 239 | 924 | results.push_back( | 240 | 924 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 924 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 924 | const bool validation2 = | 245 | 924 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 924 | src.data(), src.size()); | 247 | 924 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 924 | } | 258 | | | 259 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 308 | } else { | 273 | 308 | ret.implementations_agree = true; | 274 | 308 | } | 275 | 308 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 308 | return r.error == simdutf::SUCCESS; | 277 | 308 | }); | 278 | 308 | return ret; | 279 | 308 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 285 | validation_result verify_valid_input(FromSpan src) const { | 231 | 285 | validation_result ret{}; | 232 | | | 233 | 285 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 285 | const auto implementations = get_supported_implementations(); | 235 | 285 | std::vector<simdutf::result> results; | 236 | 285 | results.reserve(implementations.size()); | 237 | | | 238 | 855 | for (auto impl : implementations) { | 239 | 855 | results.push_back( | 240 | 855 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 855 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 855 | const bool validation2 = | 245 | 855 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 855 | src.data(), src.size()); | 247 | 855 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 855 | } | 258 | | | 259 | 285 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 285 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 285 | } else { | 273 | 285 | ret.implementations_agree = true; | 274 | 285 | } | 275 | 285 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 285 | return r.error == simdutf::SUCCESS; | 277 | 285 | }); | 278 | 285 | return ret; | 279 | 285 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 451 | validation_result verify_valid_input(FromSpan src) const { | 231 | 451 | validation_result ret{}; | 232 | | | 233 | 451 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 451 | const auto implementations = get_supported_implementations(); | 235 | 451 | std::vector<simdutf::result> results; | 236 | 451 | results.reserve(implementations.size()); | 237 | | | 238 | 1.35k | for (auto impl : implementations) { | 239 | 1.35k | results.push_back( | 240 | 1.35k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.35k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.35k | const bool validation2 = | 245 | 1.35k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.35k | src.data(), src.size()); | 247 | 1.35k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.35k | } | 258 | | | 259 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 451 | } else { | 273 | 451 | ret.implementations_agree = true; | 274 | 451 | } | 275 | 451 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 451 | return r.error == simdutf::SUCCESS; | 277 | 451 | }); | 278 | 451 | return ret; | 279 | 451 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 284 | validation_result verify_valid_input(FromSpan src) const { | 231 | 284 | validation_result ret{}; | 232 | | | 233 | 284 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 284 | const auto implementations = get_supported_implementations(); | 235 | 284 | std::vector<simdutf::result> results; | 236 | 284 | results.reserve(implementations.size()); | 237 | | | 238 | 852 | for (auto impl : implementations) { | 239 | 852 | results.push_back( | 240 | 852 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 852 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 852 | const bool validation2 = | 245 | 852 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 852 | src.data(), src.size()); | 247 | 852 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 852 | } | 258 | | | 259 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 284 | } else { | 273 | 284 | ret.implementations_agree = true; | 274 | 284 | } | 275 | 284 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 284 | return r.error == simdutf::SUCCESS; | 277 | 284 | }); | 278 | 284 | return ret; | 279 | 284 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 353 | validation_result verify_valid_input(FromSpan src) const { | 231 | 353 | validation_result ret{}; | 232 | | | 233 | 353 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 353 | const auto implementations = get_supported_implementations(); | 235 | 353 | std::vector<simdutf::result> results; | 236 | 353 | results.reserve(implementations.size()); | 237 | | | 238 | 1.05k | for (auto impl : implementations) { | 239 | 1.05k | results.push_back( | 240 | 1.05k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.05k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.05k | const bool validation2 = | 245 | 1.05k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.05k | src.data(), src.size()); | 247 | 1.05k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.05k | } | 258 | | | 259 | 353 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 353 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 353 | } else { | 273 | 353 | ret.implementations_agree = true; | 274 | 353 | } | 275 | 353 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 353 | return r.error == simdutf::SUCCESS; | 277 | 353 | }); | 278 | 353 | return ret; | 279 | 353 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 284 | validation_result verify_valid_input(FromSpan src) const { | 231 | 284 | validation_result ret{}; | 232 | | | 233 | 284 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 284 | const auto implementations = get_supported_implementations(); | 235 | 284 | std::vector<simdutf::result> results; | 236 | 284 | results.reserve(implementations.size()); | 237 | | | 238 | 852 | for (auto impl : implementations) { | 239 | 852 | results.push_back( | 240 | 852 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 852 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 852 | const bool validation2 = | 245 | 852 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 852 | src.data(), src.size()); | 247 | 852 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 852 | } | 258 | | | 259 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 284 | } else { | 273 | 284 | ret.implementations_agree = true; | 274 | 284 | } | 275 | 284 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 284 | return r.error == simdutf::SUCCESS; | 277 | 284 | }); | 278 | 284 | return ret; | 279 | 284 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 376 | validation_result verify_valid_input(FromSpan src) const { | 231 | 376 | validation_result ret{}; | 232 | | | 233 | 376 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 376 | const auto implementations = get_supported_implementations(); | 235 | 376 | std::vector<simdutf::result> results; | 236 | 376 | results.reserve(implementations.size()); | 237 | | | 238 | 1.12k | for (auto impl : implementations) { | 239 | 1.12k | results.push_back( | 240 | 1.12k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.12k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.12k | const bool validation2 = | 245 | 1.12k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.12k | src.data(), src.size()); | 247 | 1.12k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.12k | } | 258 | | | 259 | 376 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 376 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 376 | } else { | 273 | 376 | ret.implementations_agree = true; | 274 | 376 | } | 275 | 376 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 376 | return r.error == simdutf::SUCCESS; | 277 | 376 | }); | 278 | 376 | return ret; | 279 | 376 | } |
|
280 | | |
281 | | template <typename Dummy = void> |
282 | | requires(From == UtfEncodings::LATIN1) |
283 | 394 | validation_result verify_valid_input(FromSpan) const { |
284 | | // all latin1 input is valid. there is no simdutf validation function for |
285 | | // it. |
286 | 394 | return validation_result{.valid = true, .implementations_agree = true}; |
287 | 394 | } _ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 40 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 40 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 40 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 40 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 40 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 40 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 27 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 27 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 27 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 283 | 287 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 287 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 287 | } |
|
288 | | |
289 | 5.86k | bool count_the_input(FromSpan src) const { |
290 | 5.86k | const auto implementations = get_supported_implementations(); |
291 | 5.86k | std::vector<std::size_t> results; |
292 | 5.86k | results.reserve(implementations.size()); |
293 | | |
294 | 17.6k | for (auto impl : implementations) { |
295 | 17.6k | std::size_t ret; |
296 | 17.6k | if constexpr (From == UtfEncodings::UTF16BE) { |
297 | 3.64k | ret = impl->count_utf16be(src.data(), src.size()); |
298 | 3.64k | } else if constexpr (From == UtfEncodings::UTF16LE) { |
299 | 3.60k | ret = impl->count_utf16le(src.data(), src.size()); |
300 | 10.3k | } else if constexpr (From == UtfEncodings::UTF8) { |
301 | 10.3k | ret = impl->count_utf8(src.data(), src.size()); |
302 | 10.3k | } |
303 | 17.6k | results.push_back(ret); |
304 | 17.6k | } |
305 | 11.7k | auto neq = [](const auto& a, const auto& b) { return a != b; }; auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 688 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 366 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 774 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 1.29k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 1.19k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 1.27k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 100 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 108 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 554 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 332 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 710 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 226 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 312 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 614 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 706 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 305 | 752 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
306 | 5.86k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; |
308 | 0 | std::cerr << "in fuzz case for " |
309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName |
310 | 0 | << " invoked with " << src.size() << " elements:\n"; |
311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
312 | 0 | std::cerr << "got return " << std::dec << results[i] |
313 | 0 | << " from implementation " << implementations[i]->name() |
314 | 0 | << '\n'; |
315 | 0 | } |
316 | 0 | std::cerr << "end errormessage\n"; |
317 | 0 | return false; |
318 | 0 | } |
319 | | |
320 | 5.86k | return true; |
321 | 5.86k | } Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 178 | bool count_the_input(FromSpan src) const { | 290 | 178 | const auto implementations = get_supported_implementations(); | 291 | 178 | std::vector<std::size_t> results; | 292 | 178 | results.reserve(implementations.size()); | 293 | | | 294 | 534 | for (auto impl : implementations) { | 295 | 534 | std::size_t ret; | 296 | 534 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 534 | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 534 | results.push_back(ret); | 304 | 534 | } | 305 | 178 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 178 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 178 | return true; | 321 | 178 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 344 | bool count_the_input(FromSpan src) const { | 290 | 344 | const auto implementations = get_supported_implementations(); | 291 | 344 | std::vector<std::size_t> results; | 292 | 344 | results.reserve(implementations.size()); | 293 | | | 294 | 1.03k | for (auto impl : implementations) { | 295 | 1.03k | std::size_t ret; | 296 | 1.03k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.03k | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 1.03k | results.push_back(ret); | 304 | 1.03k | } | 305 | 344 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 344 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 344 | return true; | 321 | 344 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 183 | bool count_the_input(FromSpan src) const { | 290 | 183 | const auto implementations = get_supported_implementations(); | 291 | 183 | std::vector<std::size_t> results; | 292 | 183 | results.reserve(implementations.size()); | 293 | | | 294 | 549 | for (auto impl : implementations) { | 295 | 549 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 549 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 549 | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 549 | results.push_back(ret); | 304 | 549 | } | 305 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 183 | return true; | 321 | 183 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 387 | bool count_the_input(FromSpan src) const { | 290 | 387 | const auto implementations = get_supported_implementations(); | 291 | 387 | std::vector<std::size_t> results; | 292 | 387 | results.reserve(implementations.size()); | 293 | | | 294 | 1.16k | for (auto impl : implementations) { | 295 | 1.16k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.16k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.16k | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 1.16k | results.push_back(ret); | 304 | 1.16k | } | 305 | 387 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 387 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 387 | return true; | 321 | 387 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 645 | bool count_the_input(FromSpan src) const { | 290 | 645 | const auto implementations = get_supported_implementations(); | 291 | 645 | std::vector<std::size_t> results; | 292 | 645 | results.reserve(implementations.size()); | 293 | | | 294 | 1.93k | for (auto impl : implementations) { | 295 | 1.93k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 1.93k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.93k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.93k | } | 303 | 1.93k | results.push_back(ret); | 304 | 1.93k | } | 305 | 645 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 645 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 645 | return true; | 321 | 645 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 599 | bool count_the_input(FromSpan src) const { | 290 | 599 | const auto implementations = get_supported_implementations(); | 291 | 599 | std::vector<std::size_t> results; | 292 | 599 | results.reserve(implementations.size()); | 293 | | | 294 | 1.79k | for (auto impl : implementations) { | 295 | 1.79k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 1.79k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.79k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.79k | } | 303 | 1.79k | results.push_back(ret); | 304 | 1.79k | } | 305 | 599 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 599 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 599 | return true; | 321 | 599 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 636 | bool count_the_input(FromSpan src) const { | 290 | 636 | const auto implementations = get_supported_implementations(); | 291 | 636 | std::vector<std::size_t> results; | 292 | 636 | results.reserve(implementations.size()); | 293 | | | 294 | 1.90k | for (auto impl : implementations) { | 295 | 1.90k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 1.90k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.90k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.90k | } | 303 | 1.90k | results.push_back(ret); | 304 | 1.90k | } | 305 | 636 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 636 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 636 | return true; | 321 | 636 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 50 | bool count_the_input(FromSpan src) const { | 290 | 50 | const auto implementations = get_supported_implementations(); | 291 | 50 | std::vector<std::size_t> results; | 292 | 50 | results.reserve(implementations.size()); | 293 | | | 294 | 150 | for (auto impl : implementations) { | 295 | 150 | std::size_t ret; | 296 | 150 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 150 | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 150 | results.push_back(ret); | 304 | 150 | } | 305 | 50 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 50 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 50 | return true; | 321 | 50 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 54 | bool count_the_input(FromSpan src) const { | 290 | 54 | const auto implementations = get_supported_implementations(); | 291 | 54 | std::vector<std::size_t> results; | 292 | 54 | results.reserve(implementations.size()); | 293 | | | 294 | 162 | for (auto impl : implementations) { | 295 | 162 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 162 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 162 | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 162 | results.push_back(ret); | 304 | 162 | } | 305 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 54 | return true; | 321 | 54 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 277 | bool count_the_input(FromSpan src) const { | 290 | 277 | const auto implementations = get_supported_implementations(); | 291 | 277 | std::vector<std::size_t> results; | 292 | 277 | results.reserve(implementations.size()); | 293 | | | 294 | 831 | for (auto impl : implementations) { | 295 | 831 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 831 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 831 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 831 | } | 303 | 831 | results.push_back(ret); | 304 | 831 | } | 305 | 277 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 277 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 277 | return true; | 321 | 277 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 122 | bool count_the_input(FromSpan src) const { | 290 | 122 | const auto implementations = get_supported_implementations(); | 291 | 122 | std::vector<std::size_t> results; | 292 | 122 | results.reserve(implementations.size()); | 293 | | | 294 | 366 | for (auto impl : implementations) { | 295 | 366 | std::size_t ret; | 296 | 366 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 366 | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 366 | results.push_back(ret); | 304 | 366 | } | 305 | 122 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 122 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 122 | return true; | 321 | 122 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 166 | bool count_the_input(FromSpan src) const { | 290 | 166 | const auto implementations = get_supported_implementations(); | 291 | 166 | std::vector<std::size_t> results; | 292 | 166 | results.reserve(implementations.size()); | 293 | | | 294 | 498 | for (auto impl : implementations) { | 295 | 498 | std::size_t ret; | 296 | 498 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 498 | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 498 | results.push_back(ret); | 304 | 498 | } | 305 | 166 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 166 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 166 | return true; | 321 | 166 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 355 | bool count_the_input(FromSpan src) const { | 290 | 355 | const auto implementations = get_supported_implementations(); | 291 | 355 | std::vector<std::size_t> results; | 292 | 355 | results.reserve(implementations.size()); | 293 | | | 294 | 1.06k | for (auto impl : implementations) { | 295 | 1.06k | std::size_t ret; | 296 | 1.06k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.06k | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 1.06k | results.push_back(ret); | 304 | 1.06k | } | 305 | 355 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 355 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 355 | return true; | 321 | 355 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 113 | bool count_the_input(FromSpan src) const { | 290 | 113 | const auto implementations = get_supported_implementations(); | 291 | 113 | std::vector<std::size_t> results; | 292 | 113 | results.reserve(implementations.size()); | 293 | | | 294 | 339 | for (auto impl : implementations) { | 295 | 339 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 339 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 339 | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 339 | results.push_back(ret); | 304 | 339 | } | 305 | 113 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 113 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 113 | return true; | 321 | 113 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 156 | bool count_the_input(FromSpan src) const { | 290 | 156 | const auto implementations = get_supported_implementations(); | 291 | 156 | std::vector<std::size_t> results; | 292 | 156 | results.reserve(implementations.size()); | 293 | | | 294 | 468 | for (auto impl : implementations) { | 295 | 468 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 468 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 468 | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 468 | results.push_back(ret); | 304 | 468 | } | 305 | 156 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 156 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 156 | return true; | 321 | 156 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const Line | Count | Source | 289 | 307 | bool count_the_input(FromSpan src) const { | 290 | 307 | const auto implementations = get_supported_implementations(); | 291 | 307 | std::vector<std::size_t> results; | 292 | 307 | results.reserve(implementations.size()); | 293 | | | 294 | 921 | for (auto impl : implementations) { | 295 | 921 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 921 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 921 | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 921 | results.push_back(ret); | 304 | 921 | } | 305 | 307 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 307 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 307 | return true; | 321 | 307 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 284 | bool count_the_input(FromSpan src) const { | 290 | 284 | const auto implementations = get_supported_implementations(); | 291 | 284 | std::vector<std::size_t> results; | 292 | 284 | results.reserve(implementations.size()); | 293 | | | 294 | 852 | for (auto impl : implementations) { | 295 | 852 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 852 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 852 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 852 | } | 303 | 852 | results.push_back(ret); | 304 | 852 | } | 305 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 284 | return true; | 321 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 353 | bool count_the_input(FromSpan src) const { | 290 | 353 | const auto implementations = get_supported_implementations(); | 291 | 353 | std::vector<std::size_t> results; | 292 | 353 | results.reserve(implementations.size()); | 293 | | | 294 | 1.05k | for (auto impl : implementations) { | 295 | 1.05k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 1.05k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.05k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.05k | } | 303 | 1.05k | results.push_back(ret); | 304 | 1.05k | } | 305 | 353 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 353 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 353 | return true; | 321 | 353 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 284 | bool count_the_input(FromSpan src) const { | 290 | 284 | const auto implementations = get_supported_implementations(); | 291 | 284 | std::vector<std::size_t> results; | 292 | 284 | results.reserve(implementations.size()); | 293 | | | 294 | 852 | for (auto impl : implementations) { | 295 | 852 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 852 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 852 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 852 | } | 303 | 852 | results.push_back(ret); | 304 | 852 | } | 305 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 284 | return true; | 321 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 289 | 376 | bool count_the_input(FromSpan src) const { | 290 | 376 | const auto implementations = get_supported_implementations(); | 291 | 376 | std::vector<std::size_t> results; | 292 | 376 | results.reserve(implementations.size()); | 293 | | | 294 | 1.12k | for (auto impl : implementations) { | 295 | 1.12k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | | ret = impl->count_utf16le(src.data(), src.size()); | 300 | 1.12k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.12k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.12k | } | 303 | 1.12k | results.push_back(ret); | 304 | 1.12k | } | 305 | 376 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 376 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 376 | return true; | 321 | 376 | } |
|
322 | | |
323 | | // this quirk is needed because length calculations do not have consistent |
324 | | // signatures since some of them do not look at the input data, just the |
325 | | // length of it. |
326 | | template <typename Dummy = void> |
327 | | requires std::is_invocable_v<LengthFunction, const simdutf::implementation*, |
328 | | const FromType*, std::size_t> |
329 | | std::size_t invoke_lengthcalc(const simdutf::implementation* impl, |
330 | 23.7k | FromSpan src) const { |
331 | 23.7k | return std::invoke(lengthcalc, impl, src.data(), src.size()); |
332 | 23.7k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 534 | FromSpan src) const { | 331 | 534 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 534 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.03k | FromSpan src) const { | 331 | 1.03k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.03k | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 549 | FromSpan src) const { | 331 | 549 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 549 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.16k | FromSpan src) const { | 331 | 1.16k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.16k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 876 | FromSpan src) const { | 331 | 876 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 876 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 759 | FromSpan src) const { | 331 | 759 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 759 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.49k | FromSpan src) const { | 331 | 1.49k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.49k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.93k | FromSpan src) const { | 331 | 1.93k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.93k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.79k | FromSpan src) const { | 331 | 1.79k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.79k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.90k | FromSpan src) const { | 331 | 1.90k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.90k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 831 | FromSpan src) const { | 331 | 831 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 831 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 498 | FromSpan src) const { | 331 | 498 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 498 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.06k | FromSpan src) const { | 331 | 1.06k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.06k | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 468 | FromSpan src) const { | 331 | 468 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 468 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 921 | FromSpan src) const { | 331 | 921 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 921 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 924 | FromSpan src) const { | 331 | 924 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 924 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 855 | FromSpan src) const { | 331 | 855 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 855 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.35k | FromSpan src) const { | 331 | 1.35k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.35k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 852 | FromSpan src) const { | 331 | 852 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 852 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.05k | FromSpan src) const { | 331 | 1.05k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.05k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 852 | FromSpan src) const { | 331 | 852 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 852 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.12k | FromSpan src) const { | 331 | 1.12k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.12k | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 861 | FromSpan src) const { | 331 | 861 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 861 | } |
|
333 | | template <typename Dummy = void> |
334 | | requires std::is_invocable_v<LengthFunction, const simdutf::implementation*, |
335 | | // const FromType *, |
336 | | std::size_t> |
337 | | std::size_t invoke_lengthcalc(const simdutf::implementation* impl, |
338 | 2.26k | FromSpan src) const { |
339 | 2.26k | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); |
340 | 2.26k | } _ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 150 | FromSpan src) const { | 339 | 150 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 150 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 162 | FromSpan src) const { | 339 | 162 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 162 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 321 | FromSpan src) const { | 339 | 321 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 321 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 366 | FromSpan src) const { | 339 | 366 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 366 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 339 | FromSpan src) const { | 339 | 339 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 339 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 603 | FromSpan src) const { | 339 | 603 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 603 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 120 | FromSpan src) const { | 339 | 120 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 120 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 120 | FromSpan src) const { | 339 | 120 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 120 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 81 | FromSpan src) const { | 339 | 81 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 81 | } |
|
341 | | |
342 | 8.65k | length_result calculate_length(FromSpan src, const bool inputisvalid) const { |
343 | 8.65k | length_result ret{}; |
344 | | |
345 | 8.65k | const auto implementations = get_supported_implementations(); |
346 | 8.65k | std::vector<std::size_t> results; |
347 | 8.65k | results.reserve(implementations.size()); |
348 | | |
349 | 25.9k | for (auto impl : implementations) { |
350 | 25.9k | const auto len = invoke_lengthcalc(impl, src); |
351 | 25.9k | results.push_back(len); |
352 | 25.9k | ret.length.push_back(len); |
353 | 25.9k | } |
354 | | |
355 | 17.3k | auto neq = [](const auto& a, const auto& b) { return a != b; }; auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 688 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 366 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 774 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 584 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 506 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 998 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 1.29k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 1.19k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 1.27k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 100 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 108 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 214 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 554 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 332 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 710 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 226 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 312 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 614 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 402 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 616 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 570 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 902 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 706 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 752 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 80 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 80 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const Line | Count | Source | 355 | 574 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
356 | 8.65k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; |
358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " |
359 | 0 | << src.size() << " elements with valid input=" << inputisvalid |
360 | 0 | << ":\n"; |
361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
362 | 0 | std::cerr << "got return " << std::dec << results[i] |
363 | 0 | << " from implementation " << implementations[i]->name() |
364 | 0 | << '\n'; |
365 | 0 | } |
366 | 0 | std::cerr << "end errormessage\n"; |
367 | 0 | if (inputisvalid) { |
368 | 0 | ret.implementations_agree = false; |
369 | 0 | } else { |
370 | 0 | std::cerr |
371 | 0 | << "impementations are allowed to disagree on invalid input\n"; |
372 | 0 | ret.implementations_agree = true; |
373 | 0 | } |
374 | 8.65k | } else { |
375 | 8.65k | ret.implementations_agree = true; |
376 | 8.65k | } |
377 | 8.65k | return ret; |
378 | 8.65k | } Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 178 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 178 | length_result ret{}; | 344 | | | 345 | 178 | const auto implementations = get_supported_implementations(); | 346 | 178 | std::vector<std::size_t> results; | 347 | 178 | results.reserve(implementations.size()); | 348 | | | 349 | 534 | for (auto impl : implementations) { | 350 | 534 | const auto len = invoke_lengthcalc(impl, src); | 351 | 534 | results.push_back(len); | 352 | 534 | ret.length.push_back(len); | 353 | 534 | } | 354 | | | 355 | 178 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 178 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 178 | } else { | 375 | 178 | ret.implementations_agree = true; | 376 | 178 | } | 377 | 178 | return ret; | 378 | 178 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 344 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 344 | length_result ret{}; | 344 | | | 345 | 344 | const auto implementations = get_supported_implementations(); | 346 | 344 | std::vector<std::size_t> results; | 347 | 344 | results.reserve(implementations.size()); | 348 | | | 349 | 1.03k | for (auto impl : implementations) { | 350 | 1.03k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.03k | results.push_back(len); | 352 | 1.03k | ret.length.push_back(len); | 353 | 1.03k | } | 354 | | | 355 | 344 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 344 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 344 | } else { | 375 | 344 | ret.implementations_agree = true; | 376 | 344 | } | 377 | 344 | return ret; | 378 | 344 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 183 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 183 | length_result ret{}; | 344 | | | 345 | 183 | const auto implementations = get_supported_implementations(); | 346 | 183 | std::vector<std::size_t> results; | 347 | 183 | results.reserve(implementations.size()); | 348 | | | 349 | 549 | for (auto impl : implementations) { | 350 | 549 | const auto len = invoke_lengthcalc(impl, src); | 351 | 549 | results.push_back(len); | 352 | 549 | ret.length.push_back(len); | 353 | 549 | } | 354 | | | 355 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 183 | } else { | 375 | 183 | ret.implementations_agree = true; | 376 | 183 | } | 377 | 183 | return ret; | 378 | 183 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 387 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 387 | length_result ret{}; | 344 | | | 345 | 387 | const auto implementations = get_supported_implementations(); | 346 | 387 | std::vector<std::size_t> results; | 347 | 387 | results.reserve(implementations.size()); | 348 | | | 349 | 1.16k | for (auto impl : implementations) { | 350 | 1.16k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.16k | results.push_back(len); | 352 | 1.16k | ret.length.push_back(len); | 353 | 1.16k | } | 354 | | | 355 | 387 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 387 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 387 | } else { | 375 | 387 | ret.implementations_agree = true; | 376 | 387 | } | 377 | 387 | return ret; | 378 | 387 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 292 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 292 | length_result ret{}; | 344 | | | 345 | 292 | const auto implementations = get_supported_implementations(); | 346 | 292 | std::vector<std::size_t> results; | 347 | 292 | results.reserve(implementations.size()); | 348 | | | 349 | 876 | for (auto impl : implementations) { | 350 | 876 | const auto len = invoke_lengthcalc(impl, src); | 351 | 876 | results.push_back(len); | 352 | 876 | ret.length.push_back(len); | 353 | 876 | } | 354 | | | 355 | 292 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 292 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 292 | } else { | 375 | 292 | ret.implementations_agree = true; | 376 | 292 | } | 377 | 292 | return ret; | 378 | 292 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 253 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 253 | length_result ret{}; | 344 | | | 345 | 253 | const auto implementations = get_supported_implementations(); | 346 | 253 | std::vector<std::size_t> results; | 347 | 253 | results.reserve(implementations.size()); | 348 | | | 349 | 759 | for (auto impl : implementations) { | 350 | 759 | const auto len = invoke_lengthcalc(impl, src); | 351 | 759 | results.push_back(len); | 352 | 759 | ret.length.push_back(len); | 353 | 759 | } | 354 | | | 355 | 253 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 253 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 253 | } else { | 375 | 253 | ret.implementations_agree = true; | 376 | 253 | } | 377 | 253 | return ret; | 378 | 253 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 499 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 499 | length_result ret{}; | 344 | | | 345 | 499 | const auto implementations = get_supported_implementations(); | 346 | 499 | std::vector<std::size_t> results; | 347 | 499 | results.reserve(implementations.size()); | 348 | | | 349 | 1.49k | for (auto impl : implementations) { | 350 | 1.49k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.49k | results.push_back(len); | 352 | 1.49k | ret.length.push_back(len); | 353 | 1.49k | } | 354 | | | 355 | 499 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 499 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 499 | } else { | 375 | 499 | ret.implementations_agree = true; | 376 | 499 | } | 377 | 499 | return ret; | 378 | 499 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 645 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 645 | length_result ret{}; | 344 | | | 345 | 645 | const auto implementations = get_supported_implementations(); | 346 | 645 | std::vector<std::size_t> results; | 347 | 645 | results.reserve(implementations.size()); | 348 | | | 349 | 1.93k | for (auto impl : implementations) { | 350 | 1.93k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.93k | results.push_back(len); | 352 | 1.93k | ret.length.push_back(len); | 353 | 1.93k | } | 354 | | | 355 | 645 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 645 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 645 | } else { | 375 | 645 | ret.implementations_agree = true; | 376 | 645 | } | 377 | 645 | return ret; | 378 | 645 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 599 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 599 | length_result ret{}; | 344 | | | 345 | 599 | const auto implementations = get_supported_implementations(); | 346 | 599 | std::vector<std::size_t> results; | 347 | 599 | results.reserve(implementations.size()); | 348 | | | 349 | 1.79k | for (auto impl : implementations) { | 350 | 1.79k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.79k | results.push_back(len); | 352 | 1.79k | ret.length.push_back(len); | 353 | 1.79k | } | 354 | | | 355 | 599 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 599 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 599 | } else { | 375 | 599 | ret.implementations_agree = true; | 376 | 599 | } | 377 | 599 | return ret; | 378 | 599 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 636 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 636 | length_result ret{}; | 344 | | | 345 | 636 | const auto implementations = get_supported_implementations(); | 346 | 636 | std::vector<std::size_t> results; | 347 | 636 | results.reserve(implementations.size()); | 348 | | | 349 | 1.90k | for (auto impl : implementations) { | 350 | 1.90k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.90k | results.push_back(len); | 352 | 1.90k | ret.length.push_back(len); | 353 | 1.90k | } | 354 | | | 355 | 636 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 636 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 636 | } else { | 375 | 636 | ret.implementations_agree = true; | 376 | 636 | } | 377 | 636 | return ret; | 378 | 636 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 50 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 50 | length_result ret{}; | 344 | | | 345 | 50 | const auto implementations = get_supported_implementations(); | 346 | 50 | std::vector<std::size_t> results; | 347 | 50 | results.reserve(implementations.size()); | 348 | | | 349 | 150 | for (auto impl : implementations) { | 350 | 150 | const auto len = invoke_lengthcalc(impl, src); | 351 | 150 | results.push_back(len); | 352 | 150 | ret.length.push_back(len); | 353 | 150 | } | 354 | | | 355 | 50 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 50 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 50 | } else { | 375 | 50 | ret.implementations_agree = true; | 376 | 50 | } | 377 | 50 | return ret; | 378 | 50 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 54 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 54 | length_result ret{}; | 344 | | | 345 | 54 | const auto implementations = get_supported_implementations(); | 346 | 54 | std::vector<std::size_t> results; | 347 | 54 | results.reserve(implementations.size()); | 348 | | | 349 | 162 | for (auto impl : implementations) { | 350 | 162 | const auto len = invoke_lengthcalc(impl, src); | 351 | 162 | results.push_back(len); | 352 | 162 | ret.length.push_back(len); | 353 | 162 | } | 354 | | | 355 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 54 | } else { | 375 | 54 | ret.implementations_agree = true; | 376 | 54 | } | 377 | 54 | return ret; | 378 | 54 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 107 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 107 | length_result ret{}; | 344 | | | 345 | 107 | const auto implementations = get_supported_implementations(); | 346 | 107 | std::vector<std::size_t> results; | 347 | 107 | results.reserve(implementations.size()); | 348 | | | 349 | 321 | for (auto impl : implementations) { | 350 | 321 | const auto len = invoke_lengthcalc(impl, src); | 351 | 321 | results.push_back(len); | 352 | 321 | ret.length.push_back(len); | 353 | 321 | } | 354 | | | 355 | 107 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 107 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 107 | } else { | 375 | 107 | ret.implementations_agree = true; | 376 | 107 | } | 377 | 107 | return ret; | 378 | 107 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 277 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 277 | length_result ret{}; | 344 | | | 345 | 277 | const auto implementations = get_supported_implementations(); | 346 | 277 | std::vector<std::size_t> results; | 347 | 277 | results.reserve(implementations.size()); | 348 | | | 349 | 831 | for (auto impl : implementations) { | 350 | 831 | const auto len = invoke_lengthcalc(impl, src); | 351 | 831 | results.push_back(len); | 352 | 831 | ret.length.push_back(len); | 353 | 831 | } | 354 | | | 355 | 277 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 277 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 277 | } else { | 375 | 277 | ret.implementations_agree = true; | 376 | 277 | } | 377 | 277 | return ret; | 378 | 277 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 122 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 122 | length_result ret{}; | 344 | | | 345 | 122 | const auto implementations = get_supported_implementations(); | 346 | 122 | std::vector<std::size_t> results; | 347 | 122 | results.reserve(implementations.size()); | 348 | | | 349 | 366 | for (auto impl : implementations) { | 350 | 366 | const auto len = invoke_lengthcalc(impl, src); | 351 | 366 | results.push_back(len); | 352 | 366 | ret.length.push_back(len); | 353 | 366 | } | 354 | | | 355 | 122 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 122 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 122 | } else { | 375 | 122 | ret.implementations_agree = true; | 376 | 122 | } | 377 | 122 | return ret; | 378 | 122 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 166 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 166 | length_result ret{}; | 344 | | | 345 | 166 | const auto implementations = get_supported_implementations(); | 346 | 166 | std::vector<std::size_t> results; | 347 | 166 | results.reserve(implementations.size()); | 348 | | | 349 | 498 | for (auto impl : implementations) { | 350 | 498 | const auto len = invoke_lengthcalc(impl, src); | 351 | 498 | results.push_back(len); | 352 | 498 | ret.length.push_back(len); | 353 | 498 | } | 354 | | | 355 | 166 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 166 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 166 | } else { | 375 | 166 | ret.implementations_agree = true; | 376 | 166 | } | 377 | 166 | return ret; | 378 | 166 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 355 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 355 | length_result ret{}; | 344 | | | 345 | 355 | const auto implementations = get_supported_implementations(); | 346 | 355 | std::vector<std::size_t> results; | 347 | 355 | results.reserve(implementations.size()); | 348 | | | 349 | 1.06k | for (auto impl : implementations) { | 350 | 1.06k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.06k | results.push_back(len); | 352 | 1.06k | ret.length.push_back(len); | 353 | 1.06k | } | 354 | | | 355 | 355 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 355 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 355 | } else { | 375 | 355 | ret.implementations_agree = true; | 376 | 355 | } | 377 | 355 | return ret; | 378 | 355 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 113 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 113 | length_result ret{}; | 344 | | | 345 | 113 | const auto implementations = get_supported_implementations(); | 346 | 113 | std::vector<std::size_t> results; | 347 | 113 | results.reserve(implementations.size()); | 348 | | | 349 | 339 | for (auto impl : implementations) { | 350 | 339 | const auto len = invoke_lengthcalc(impl, src); | 351 | 339 | results.push_back(len); | 352 | 339 | ret.length.push_back(len); | 353 | 339 | } | 354 | | | 355 | 113 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 113 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 113 | } else { | 375 | 113 | ret.implementations_agree = true; | 376 | 113 | } | 377 | 113 | return ret; | 378 | 113 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 156 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 156 | length_result ret{}; | 344 | | | 345 | 156 | const auto implementations = get_supported_implementations(); | 346 | 156 | std::vector<std::size_t> results; | 347 | 156 | results.reserve(implementations.size()); | 348 | | | 349 | 468 | for (auto impl : implementations) { | 350 | 468 | const auto len = invoke_lengthcalc(impl, src); | 351 | 468 | results.push_back(len); | 352 | 468 | ret.length.push_back(len); | 353 | 468 | } | 354 | | | 355 | 156 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 156 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 156 | } else { | 375 | 156 | ret.implementations_agree = true; | 376 | 156 | } | 377 | 156 | return ret; | 378 | 156 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 307 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 307 | length_result ret{}; | 344 | | | 345 | 307 | const auto implementations = get_supported_implementations(); | 346 | 307 | std::vector<std::size_t> results; | 347 | 307 | results.reserve(implementations.size()); | 348 | | | 349 | 921 | for (auto impl : implementations) { | 350 | 921 | const auto len = invoke_lengthcalc(impl, src); | 351 | 921 | results.push_back(len); | 352 | 921 | ret.length.push_back(len); | 353 | 921 | } | 354 | | | 355 | 307 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 307 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 307 | } else { | 375 | 307 | ret.implementations_agree = true; | 376 | 307 | } | 377 | 307 | return ret; | 378 | 307 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 201 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 201 | length_result ret{}; | 344 | | | 345 | 201 | const auto implementations = get_supported_implementations(); | 346 | 201 | std::vector<std::size_t> results; | 347 | 201 | results.reserve(implementations.size()); | 348 | | | 349 | 603 | for (auto impl : implementations) { | 350 | 603 | const auto len = invoke_lengthcalc(impl, src); | 351 | 603 | results.push_back(len); | 352 | 603 | ret.length.push_back(len); | 353 | 603 | } | 354 | | | 355 | 201 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 201 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 201 | } else { | 375 | 201 | ret.implementations_agree = true; | 376 | 201 | } | 377 | 201 | return ret; | 378 | 201 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 308 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 308 | length_result ret{}; | 344 | | | 345 | 308 | const auto implementations = get_supported_implementations(); | 346 | 308 | std::vector<std::size_t> results; | 347 | 308 | results.reserve(implementations.size()); | 348 | | | 349 | 924 | for (auto impl : implementations) { | 350 | 924 | const auto len = invoke_lengthcalc(impl, src); | 351 | 924 | results.push_back(len); | 352 | 924 | ret.length.push_back(len); | 353 | 924 | } | 354 | | | 355 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 308 | } else { | 375 | 308 | ret.implementations_agree = true; | 376 | 308 | } | 377 | 308 | return ret; | 378 | 308 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 285 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 285 | length_result ret{}; | 344 | | | 345 | 285 | const auto implementations = get_supported_implementations(); | 346 | 285 | std::vector<std::size_t> results; | 347 | 285 | results.reserve(implementations.size()); | 348 | | | 349 | 855 | for (auto impl : implementations) { | 350 | 855 | const auto len = invoke_lengthcalc(impl, src); | 351 | 855 | results.push_back(len); | 352 | 855 | ret.length.push_back(len); | 353 | 855 | } | 354 | | | 355 | 285 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 285 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 285 | } else { | 375 | 285 | ret.implementations_agree = true; | 376 | 285 | } | 377 | 285 | return ret; | 378 | 285 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 451 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 451 | length_result ret{}; | 344 | | | 345 | 451 | const auto implementations = get_supported_implementations(); | 346 | 451 | std::vector<std::size_t> results; | 347 | 451 | results.reserve(implementations.size()); | 348 | | | 349 | 1.35k | for (auto impl : implementations) { | 350 | 1.35k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.35k | results.push_back(len); | 352 | 1.35k | ret.length.push_back(len); | 353 | 1.35k | } | 354 | | | 355 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 451 | } else { | 375 | 451 | ret.implementations_agree = true; | 376 | 451 | } | 377 | 451 | return ret; | 378 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 284 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 284 | length_result ret{}; | 344 | | | 345 | 284 | const auto implementations = get_supported_implementations(); | 346 | 284 | std::vector<std::size_t> results; | 347 | 284 | results.reserve(implementations.size()); | 348 | | | 349 | 852 | for (auto impl : implementations) { | 350 | 852 | const auto len = invoke_lengthcalc(impl, src); | 351 | 852 | results.push_back(len); | 352 | 852 | ret.length.push_back(len); | 353 | 852 | } | 354 | | | 355 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 284 | } else { | 375 | 284 | ret.implementations_agree = true; | 376 | 284 | } | 377 | 284 | return ret; | 378 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 353 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 353 | length_result ret{}; | 344 | | | 345 | 353 | const auto implementations = get_supported_implementations(); | 346 | 353 | std::vector<std::size_t> results; | 347 | 353 | results.reserve(implementations.size()); | 348 | | | 349 | 1.05k | for (auto impl : implementations) { | 350 | 1.05k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.05k | results.push_back(len); | 352 | 1.05k | ret.length.push_back(len); | 353 | 1.05k | } | 354 | | | 355 | 353 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 353 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 353 | } else { | 375 | 353 | ret.implementations_agree = true; | 376 | 353 | } | 377 | 353 | return ret; | 378 | 353 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 284 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 284 | length_result ret{}; | 344 | | | 345 | 284 | const auto implementations = get_supported_implementations(); | 346 | 284 | std::vector<std::size_t> results; | 347 | 284 | results.reserve(implementations.size()); | 348 | | | 349 | 852 | for (auto impl : implementations) { | 350 | 852 | const auto len = invoke_lengthcalc(impl, src); | 351 | 852 | results.push_back(len); | 352 | 852 | ret.length.push_back(len); | 353 | 852 | } | 354 | | | 355 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 284 | } else { | 375 | 284 | ret.implementations_agree = true; | 376 | 284 | } | 377 | 284 | return ret; | 378 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 376 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 376 | length_result ret{}; | 344 | | | 345 | 376 | const auto implementations = get_supported_implementations(); | 346 | 376 | std::vector<std::size_t> results; | 347 | 376 | results.reserve(implementations.size()); | 348 | | | 349 | 1.12k | for (auto impl : implementations) { | 350 | 1.12k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.12k | results.push_back(len); | 352 | 1.12k | ret.length.push_back(len); | 353 | 1.12k | } | 354 | | | 355 | 376 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 376 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 376 | } else { | 375 | 376 | ret.implementations_agree = true; | 376 | 376 | } | 377 | 376 | return ret; | 378 | 376 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 40 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 40 | length_result ret{}; | 344 | | | 345 | 40 | const auto implementations = get_supported_implementations(); | 346 | 40 | std::vector<std::size_t> results; | 347 | 40 | results.reserve(implementations.size()); | 348 | | | 349 | 120 | for (auto impl : implementations) { | 350 | 120 | const auto len = invoke_lengthcalc(impl, src); | 351 | 120 | results.push_back(len); | 352 | 120 | ret.length.push_back(len); | 353 | 120 | } | 354 | | | 355 | 40 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 40 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 40 | } else { | 375 | 40 | ret.implementations_agree = true; | 376 | 40 | } | 377 | 40 | return ret; | 378 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 40 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 40 | length_result ret{}; | 344 | | | 345 | 40 | const auto implementations = get_supported_implementations(); | 346 | 40 | std::vector<std::size_t> results; | 347 | 40 | results.reserve(implementations.size()); | 348 | | | 349 | 120 | for (auto impl : implementations) { | 350 | 120 | const auto len = invoke_lengthcalc(impl, src); | 351 | 120 | results.push_back(len); | 352 | 120 | ret.length.push_back(len); | 353 | 120 | } | 354 | | | 355 | 40 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 40 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 40 | } else { | 375 | 40 | ret.implementations_agree = true; | 376 | 40 | } | 377 | 40 | return ret; | 378 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 27 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 27 | length_result ret{}; | 344 | | | 345 | 27 | const auto implementations = get_supported_implementations(); | 346 | 27 | std::vector<std::size_t> results; | 347 | 27 | results.reserve(implementations.size()); | 348 | | | 349 | 81 | for (auto impl : implementations) { | 350 | 81 | const auto len = invoke_lengthcalc(impl, src); | 351 | 81 | results.push_back(len); | 352 | 81 | ret.length.push_back(len); | 353 | 81 | } | 354 | | | 355 | 27 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 27 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 27 | } else { | 375 | 27 | ret.implementations_agree = true; | 376 | 27 | } | 377 | 27 | return ret; | 378 | 27 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const Line | Count | Source | 342 | 287 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 287 | length_result ret{}; | 344 | | | 345 | 287 | const auto implementations = get_supported_implementations(); | 346 | 287 | std::vector<std::size_t> results; | 347 | 287 | results.reserve(implementations.size()); | 348 | | | 349 | 861 | for (auto impl : implementations) { | 350 | 861 | const auto len = invoke_lengthcalc(impl, src); | 351 | 861 | results.push_back(len); | 352 | 861 | ret.length.push_back(len); | 353 | 861 | } | 354 | | | 355 | 287 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 287 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 287 | } else { | 375 | 287 | ret.implementations_agree = true; | 376 | 287 | } | 377 | 287 | return ret; | 378 | 287 | } |
|
379 | | |
380 | | conversion_result do_conversion(FromSpan src, |
381 | | const std::vector<std::size_t>& outlength, |
382 | 8.55k | const bool inputisvalid) const { |
383 | 8.55k | conversion_result ret{}; |
384 | | |
385 | 8.55k | const auto implementations = get_supported_implementations(); |
386 | | |
387 | 8.55k | std::vector<result<ConversionResult>> results; |
388 | 8.55k | results.reserve(implementations.size()); |
389 | | |
390 | | // put the output in a separate allocation to make access violations easier |
391 | | // to catch |
392 | 8.55k | std::vector<std::vector<ToType>> outputbuffers; |
393 | 8.55k | outputbuffers.reserve(implementations.size()); |
394 | 34.2k | for (std::size_t i = 0; i < implementations.size(); ++i) { |
395 | 25.6k | auto impl = implementations[i]; |
396 | 25.6k | const ToType canary1{42}; |
397 | 25.6k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); |
398 | 25.6k | const auto implret1 = std::invoke(conversion, impl, src.data(), |
399 | 25.6k | src.size(), outputbuffer.data()); |
400 | | // was the conversion successful? |
401 | 25.6k | const auto success = [](const ConversionResult& r) -> bool { |
402 | 25.6k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { |
403 | 14.3k | return r != 0; |
404 | 14.3k | } else { |
405 | 11.2k | return r.error == simdutf::error_code::SUCCESS; |
406 | 11.2k | } |
407 | 25.6k | }(implret1); Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 480 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 480 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 480 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 480 | }(implret1); |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 978 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 978 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 978 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 978 | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 540 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 540 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 540 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 540 | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 1.13k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.13k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.13k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.13k | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 843 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 843 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 843 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 843 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 744 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 744 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 744 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 744 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 1.48k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.48k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.48k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.48k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 1.89k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.89k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.89k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.89k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 1.76k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.76k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.76k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.76k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 1.88k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.88k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.88k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.88k | }(implret1); |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 150 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 150 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 150 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 150 | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 162 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 162 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 162 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 162 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 321 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 321 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 321 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 321 | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 831 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 831 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 831 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 831 | }(implret1); |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 366 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 366 | } else { | 405 | 366 | return r.error == simdutf::error_code::SUCCESS; | 406 | 366 | } | 407 | 366 | }(implret1); |
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 498 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 498 | } else { | 405 | 498 | return r.error == simdutf::error_code::SUCCESS; | 406 | 498 | } | 407 | 498 | }(implret1); |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 1.06k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.06k | } else { | 405 | 1.06k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.06k | } | 407 | 1.06k | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 339 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 339 | } else { | 405 | 339 | return r.error == simdutf::error_code::SUCCESS; | 406 | 339 | } | 407 | 339 | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 468 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 468 | } else { | 405 | 468 | return r.error == simdutf::error_code::SUCCESS; | 406 | 468 | } | 407 | 468 | }(implret1); |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 921 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 921 | } else { | 405 | 921 | return r.error == simdutf::error_code::SUCCESS; | 406 | 921 | } | 407 | 921 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 603 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 603 | } else { | 405 | 603 | return r.error == simdutf::error_code::SUCCESS; | 406 | 603 | } | 407 | 603 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 924 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 924 | } else { | 405 | 924 | return r.error == simdutf::error_code::SUCCESS; | 406 | 924 | } | 407 | 924 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 855 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 855 | } else { | 405 | 855 | return r.error == simdutf::error_code::SUCCESS; | 406 | 855 | } | 407 | 855 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 1.35k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.35k | } else { | 405 | 1.35k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.35k | } | 407 | 1.35k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 852 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 852 | } else { | 405 | 852 | return r.error == simdutf::error_code::SUCCESS; | 406 | 852 | } | 407 | 852 | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 1.05k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.05k | } else { | 405 | 1.05k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.05k | } | 407 | 1.05k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 852 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 852 | } else { | 405 | 852 | return r.error == simdutf::error_code::SUCCESS; | 406 | 852 | } | 407 | 852 | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const Line | Count | Source | 401 | 1.12k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.12k | } else { | 405 | 1.12k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.12k | } | 407 | 1.12k | }(implret1); |
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 120 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 120 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 120 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 120 | }(implret1); |
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 120 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 120 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 120 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 120 | }(implret1); |
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 81 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 81 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 81 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 81 | }(implret1); |
Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const Line | Count | Source | 401 | 861 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 861 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 861 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 861 | }(implret1); |
|
408 | 25.6k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); |
409 | 25.6k | if constexpr (use_canary_in_output) { |
410 | | // optionally convert again, this time with the buffer filled with |
411 | | // a different value. if the output differs, it means some of the buffer |
412 | | // was not written to by the conversion function. |
413 | 25.6k | const ToType canary2{25}; |
414 | 25.6k | const auto outputbuffer_first_run = outputbuffer; |
415 | 25.6k | std::ranges::fill(outputbuffer, canary2); |
416 | 25.6k | const auto implret2 = std::invoke(conversion, impl, src.data(), |
417 | 25.6k | src.size(), outputbuffer.data()); |
418 | | |
419 | 25.6k | if (implret1 != implret2) { |
420 | 0 | std::cerr << "different return value the second time!\n"; |
421 | 0 | std::abort(); |
422 | 0 | } |
423 | 25.6k | if (inputisvalid && success) { |
424 | | // only care about the output if the input is valid |
425 | 12.4k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); |
426 | 12.4k | if (hash1 != hash2) { |
427 | 0 | std::cerr << "different output the second time!\n"; |
428 | 0 | std::cerr << "implementation " << impl->name() << " " << name |
429 | 0 | << '\n'; |
430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; |
431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; |
432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; |
433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { |
434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] |
435 | 0 | << '\t' << +outputbuffer[j] << '\n'; |
436 | 0 | } |
437 | 0 | std::abort(); |
438 | 0 | } |
439 | 12.4k | } |
440 | 25.6k | } |
441 | 25.6k | results.emplace_back(implret1, success ? hash1 : ""); |
442 | 25.6k | } |
443 | | |
444 | | // do not require implementations to give the same output if |
445 | | // the input is not valid. |
446 | 8.55k | if (!inputisvalid) { |
447 | 12.5k | for (auto& e : results) { |
448 | 12.5k | e.outputhash.clear(); |
449 | 12.5k | } |
450 | 4.18k | } |
451 | | |
452 | 17.1k | auto neq = [](const auto& a, const auto& b) { return a != b; }; auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 320 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 652 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 360 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 756 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 562 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 496 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 988 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 1.26k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 1.17k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 1.25k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 100 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 108 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 214 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 554 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 332 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 710 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 226 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 312 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 614 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 402 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 616 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 570 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 902 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 706 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 568 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const Line | Count | Source | 452 | 752 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 80 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 80 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const Line | Count | Source | 452 | 574 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
453 | 8.55k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; |
455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() |
456 | 0 | << " elements:\n"; |
457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; |
458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
459 | 0 | std::cerr << "got return " << std::dec << results[i] |
460 | 0 | << " from implementation " << implementations[i]->name() |
461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; |
462 | 0 | } |
463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
464 | 0 | std::cerr << "implementation " << implementations[i]->name() |
465 | 0 | << " out: "; |
466 | 0 | for (const auto e : outputbuffers.at(i)) { |
467 | 0 | std::cerr << +e << ", "; |
468 | 0 | } |
469 | 0 | std::cerr << '\n'; |
470 | 0 | } |
471 | 0 | std::cerr << "end errormessage\n"; |
472 | 0 | ret.implementations_agree = false; |
473 | 8.55k | } else { |
474 | 8.55k | ret.implementations_agree = true; |
475 | 8.55k | } |
476 | 8.55k | return ret; |
477 | 8.55k | } Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 160 | const bool inputisvalid) const { | 383 | 160 | conversion_result ret{}; | 384 | | | 385 | 160 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 160 | std::vector<result<ConversionResult>> results; | 388 | 160 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 160 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 160 | outputbuffers.reserve(implementations.size()); | 394 | 640 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 480 | auto impl = implementations[i]; | 396 | 480 | const ToType canary1{42}; | 397 | 480 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 480 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 480 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 480 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 480 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 480 | return r != 0; | 404 | 480 | } else { | 405 | 480 | return r.error == simdutf::error_code::SUCCESS; | 406 | 480 | } | 407 | 480 | }(implret1); | 408 | 480 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 480 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 480 | const ToType canary2{25}; | 414 | 480 | const auto outputbuffer_first_run = outputbuffer; | 415 | 480 | std::ranges::fill(outputbuffer, canary2); | 416 | 480 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 480 | src.size(), outputbuffer.data()); | 418 | | | 419 | 480 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 480 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 330 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 330 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 330 | } | 440 | 480 | } | 441 | 480 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 480 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 160 | if (!inputisvalid) { | 447 | 138 | for (auto& e : results) { | 448 | 138 | e.outputhash.clear(); | 449 | 138 | } | 450 | 46 | } | 451 | | | 452 | 160 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 160 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 160 | } else { | 474 | 160 | ret.implementations_agree = true; | 475 | 160 | } | 476 | 160 | return ret; | 477 | 160 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 326 | const bool inputisvalid) const { | 383 | 326 | conversion_result ret{}; | 384 | | | 385 | 326 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 326 | std::vector<result<ConversionResult>> results; | 388 | 326 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 326 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 326 | outputbuffers.reserve(implementations.size()); | 394 | 1.30k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 978 | auto impl = implementations[i]; | 396 | 978 | const ToType canary1{42}; | 397 | 978 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 978 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 978 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 978 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 978 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 978 | return r != 0; | 404 | 978 | } else { | 405 | 978 | return r.error == simdutf::error_code::SUCCESS; | 406 | 978 | } | 407 | 978 | }(implret1); | 408 | 978 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 978 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 978 | const ToType canary2{25}; | 414 | 978 | const auto outputbuffer_first_run = outputbuffer; | 415 | 978 | std::ranges::fill(outputbuffer, canary2); | 416 | 978 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 978 | src.size(), outputbuffer.data()); | 418 | | | 419 | 978 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 978 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 747 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 747 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 747 | } | 440 | 978 | } | 441 | 978 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 978 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 326 | if (!inputisvalid) { | 447 | 219 | for (auto& e : results) { | 448 | 219 | e.outputhash.clear(); | 449 | 219 | } | 450 | 73 | } | 451 | | | 452 | 326 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 326 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 326 | } else { | 474 | 326 | ret.implementations_agree = true; | 475 | 326 | } | 476 | 326 | return ret; | 477 | 326 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 180 | const bool inputisvalid) const { | 383 | 180 | conversion_result ret{}; | 384 | | | 385 | 180 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 180 | std::vector<result<ConversionResult>> results; | 388 | 180 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 180 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 180 | outputbuffers.reserve(implementations.size()); | 394 | 720 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 540 | auto impl = implementations[i]; | 396 | 540 | const ToType canary1{42}; | 397 | 540 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 540 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 540 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 540 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 540 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 540 | return r != 0; | 404 | 540 | } else { | 405 | 540 | return r.error == simdutf::error_code::SUCCESS; | 406 | 540 | } | 407 | 540 | }(implret1); | 408 | 540 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 540 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 540 | const ToType canary2{25}; | 414 | 540 | const auto outputbuffer_first_run = outputbuffer; | 415 | 540 | std::ranges::fill(outputbuffer, canary2); | 416 | 540 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 540 | src.size(), outputbuffer.data()); | 418 | | | 419 | 540 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 540 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 309 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 309 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 309 | } | 440 | 540 | } | 441 | 540 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 540 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 180 | if (!inputisvalid) { | 447 | 219 | for (auto& e : results) { | 448 | 219 | e.outputhash.clear(); | 449 | 219 | } | 450 | 73 | } | 451 | | | 452 | 180 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 180 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 180 | } else { | 474 | 180 | ret.implementations_agree = true; | 475 | 180 | } | 476 | 180 | return ret; | 477 | 180 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 378 | const bool inputisvalid) const { | 383 | 378 | conversion_result ret{}; | 384 | | | 385 | 378 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 378 | std::vector<result<ConversionResult>> results; | 388 | 378 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 378 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 378 | outputbuffers.reserve(implementations.size()); | 394 | 1.51k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.13k | auto impl = implementations[i]; | 396 | 1.13k | const ToType canary1{42}; | 397 | 1.13k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.13k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.13k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.13k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.13k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.13k | return r != 0; | 404 | 1.13k | } else { | 405 | 1.13k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.13k | } | 407 | 1.13k | }(implret1); | 408 | 1.13k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.13k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.13k | const ToType canary2{25}; | 414 | 1.13k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.13k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.13k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.13k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.13k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.13k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 897 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 897 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 897 | } | 440 | 1.13k | } | 441 | 1.13k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.13k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 378 | if (!inputisvalid) { | 447 | 225 | for (auto& e : results) { | 448 | 225 | e.outputhash.clear(); | 449 | 225 | } | 450 | 75 | } | 451 | | | 452 | 378 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 378 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 378 | } else { | 474 | 378 | ret.implementations_agree = true; | 475 | 378 | } | 476 | 378 | return ret; | 477 | 378 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 281 | const bool inputisvalid) const { | 383 | 281 | conversion_result ret{}; | 384 | | | 385 | 281 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 281 | std::vector<result<ConversionResult>> results; | 388 | 281 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 281 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 281 | outputbuffers.reserve(implementations.size()); | 394 | 1.12k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 843 | auto impl = implementations[i]; | 396 | 843 | const ToType canary1{42}; | 397 | 843 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 843 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 843 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 843 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 843 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 843 | return r != 0; | 404 | 843 | } else { | 405 | 843 | return r.error == simdutf::error_code::SUCCESS; | 406 | 843 | } | 407 | 843 | }(implret1); | 408 | 843 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 843 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 843 | const ToType canary2{25}; | 414 | 843 | const auto outputbuffer_first_run = outputbuffer; | 415 | 843 | std::ranges::fill(outputbuffer, canary2); | 416 | 843 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 843 | src.size(), outputbuffer.data()); | 418 | | | 419 | 843 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 843 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 318 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 318 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 318 | } | 440 | 843 | } | 441 | 843 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 843 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 281 | if (!inputisvalid) { | 447 | 516 | for (auto& e : results) { | 448 | 516 | e.outputhash.clear(); | 449 | 516 | } | 450 | 172 | } | 451 | | | 452 | 281 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 281 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 281 | } else { | 474 | 281 | ret.implementations_agree = true; | 475 | 281 | } | 476 | 281 | return ret; | 477 | 281 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 248 | const bool inputisvalid) const { | 383 | 248 | conversion_result ret{}; | 384 | | | 385 | 248 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 248 | std::vector<result<ConversionResult>> results; | 388 | 248 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 248 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 248 | outputbuffers.reserve(implementations.size()); | 394 | 992 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 744 | auto impl = implementations[i]; | 396 | 744 | const ToType canary1{42}; | 397 | 744 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 744 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 744 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 744 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 744 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 744 | return r != 0; | 404 | 744 | } else { | 405 | 744 | return r.error == simdutf::error_code::SUCCESS; | 406 | 744 | } | 407 | 744 | }(implret1); | 408 | 744 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 744 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 744 | const ToType canary2{25}; | 414 | 744 | const auto outputbuffer_first_run = outputbuffer; | 415 | 744 | std::ranges::fill(outputbuffer, canary2); | 416 | 744 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 744 | src.size(), outputbuffer.data()); | 418 | | | 419 | 744 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 744 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 342 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 342 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 342 | } | 440 | 744 | } | 441 | 744 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 744 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 248 | if (!inputisvalid) { | 447 | 393 | for (auto& e : results) { | 448 | 393 | e.outputhash.clear(); | 449 | 393 | } | 450 | 131 | } | 451 | | | 452 | 248 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 248 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 248 | } else { | 474 | 248 | ret.implementations_agree = true; | 475 | 248 | } | 476 | 248 | return ret; | 477 | 248 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 494 | const bool inputisvalid) const { | 383 | 494 | conversion_result ret{}; | 384 | | | 385 | 494 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 494 | std::vector<result<ConversionResult>> results; | 388 | 494 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 494 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 494 | outputbuffers.reserve(implementations.size()); | 394 | 1.97k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.48k | auto impl = implementations[i]; | 396 | 1.48k | const ToType canary1{42}; | 397 | 1.48k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.48k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.48k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.48k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.48k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.48k | return r != 0; | 404 | 1.48k | } else { | 405 | 1.48k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.48k | } | 407 | 1.48k | }(implret1); | 408 | 1.48k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.48k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.48k | const ToType canary2{25}; | 414 | 1.48k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.48k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.48k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.48k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.48k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.48k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 639 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 639 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 639 | } | 440 | 1.48k | } | 441 | 1.48k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.48k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 494 | if (!inputisvalid) { | 447 | 831 | for (auto& e : results) { | 448 | 831 | e.outputhash.clear(); | 449 | 831 | } | 450 | 277 | } | 451 | | | 452 | 494 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 494 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 494 | } else { | 474 | 494 | ret.implementations_agree = true; | 475 | 494 | } | 476 | 494 | return ret; | 477 | 494 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 632 | const bool inputisvalid) const { | 383 | 632 | conversion_result ret{}; | 384 | | | 385 | 632 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 632 | std::vector<result<ConversionResult>> results; | 388 | 632 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 632 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 632 | outputbuffers.reserve(implementations.size()); | 394 | 2.52k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.89k | auto impl = implementations[i]; | 396 | 1.89k | const ToType canary1{42}; | 397 | 1.89k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.89k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.89k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.89k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.89k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.89k | return r != 0; | 404 | 1.89k | } else { | 405 | 1.89k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.89k | } | 407 | 1.89k | }(implret1); | 408 | 1.89k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.89k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.89k | const ToType canary2{25}; | 414 | 1.89k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.89k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.89k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.89k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.89k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.89k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 966 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 966 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 966 | } | 440 | 1.89k | } | 441 | 1.89k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.89k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 632 | if (!inputisvalid) { | 447 | 924 | for (auto& e : results) { | 448 | 924 | e.outputhash.clear(); | 449 | 924 | } | 450 | 308 | } | 451 | | | 452 | 632 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 632 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 632 | } else { | 474 | 632 | ret.implementations_agree = true; | 475 | 632 | } | 476 | 632 | return ret; | 477 | 632 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 588 | const bool inputisvalid) const { | 383 | 588 | conversion_result ret{}; | 384 | | | 385 | 588 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 588 | std::vector<result<ConversionResult>> results; | 388 | 588 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 588 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 588 | outputbuffers.reserve(implementations.size()); | 394 | 2.35k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.76k | auto impl = implementations[i]; | 396 | 1.76k | const ToType canary1{42}; | 397 | 1.76k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.76k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.76k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.76k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.76k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.76k | return r != 0; | 404 | 1.76k | } else { | 405 | 1.76k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.76k | } | 407 | 1.76k | }(implret1); | 408 | 1.76k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.76k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.76k | const ToType canary2{25}; | 414 | 1.76k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.76k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.76k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.76k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.76k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.76k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 915 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 915 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 915 | } | 440 | 1.76k | } | 441 | 1.76k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.76k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 588 | if (!inputisvalid) { | 447 | 843 | for (auto& e : results) { | 448 | 843 | e.outputhash.clear(); | 449 | 843 | } | 450 | 281 | } | 451 | | | 452 | 588 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 588 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 588 | } else { | 474 | 588 | ret.implementations_agree = true; | 475 | 588 | } | 476 | 588 | return ret; | 477 | 588 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 627 | const bool inputisvalid) const { | 383 | 627 | conversion_result ret{}; | 384 | | | 385 | 627 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 627 | std::vector<result<ConversionResult>> results; | 388 | 627 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 627 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 627 | outputbuffers.reserve(implementations.size()); | 394 | 2.50k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.88k | auto impl = implementations[i]; | 396 | 1.88k | const ToType canary1{42}; | 397 | 1.88k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.88k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.88k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.88k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.88k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.88k | return r != 0; | 404 | 1.88k | } else { | 405 | 1.88k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.88k | } | 407 | 1.88k | }(implret1); | 408 | 1.88k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.88k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.88k | const ToType canary2{25}; | 414 | 1.88k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.88k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.88k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.88k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.88k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.88k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 942 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 942 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 942 | } | 440 | 1.88k | } | 441 | 1.88k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.88k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 627 | if (!inputisvalid) { | 447 | 930 | for (auto& e : results) { | 448 | 930 | e.outputhash.clear(); | 449 | 930 | } | 450 | 310 | } | 451 | | | 452 | 627 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 627 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 627 | } else { | 474 | 627 | ret.implementations_agree = true; | 475 | 627 | } | 476 | 627 | return ret; | 477 | 627 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 50 | const bool inputisvalid) const { | 383 | 50 | conversion_result ret{}; | 384 | | | 385 | 50 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 50 | std::vector<result<ConversionResult>> results; | 388 | 50 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 50 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 50 | outputbuffers.reserve(implementations.size()); | 394 | 200 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 150 | auto impl = implementations[i]; | 396 | 150 | const ToType canary1{42}; | 397 | 150 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 150 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 150 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 150 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 150 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 150 | return r != 0; | 404 | 150 | } else { | 405 | 150 | return r.error == simdutf::error_code::SUCCESS; | 406 | 150 | } | 407 | 150 | }(implret1); | 408 | 150 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 150 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 150 | const ToType canary2{25}; | 414 | 150 | const auto outputbuffer_first_run = outputbuffer; | 415 | 150 | std::ranges::fill(outputbuffer, canary2); | 416 | 150 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 150 | src.size(), outputbuffer.data()); | 418 | | | 419 | 150 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 150 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 66 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 66 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 66 | } | 440 | 150 | } | 441 | 150 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 150 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 50 | if (!inputisvalid) { | 447 | 12 | for (auto& e : results) { | 448 | 12 | e.outputhash.clear(); | 449 | 12 | } | 450 | 4 | } | 451 | | | 452 | 50 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 50 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 50 | } else { | 474 | 50 | ret.implementations_agree = true; | 475 | 50 | } | 476 | 50 | return ret; | 477 | 50 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 54 | const bool inputisvalid) const { | 383 | 54 | conversion_result ret{}; | 384 | | | 385 | 54 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 54 | std::vector<result<ConversionResult>> results; | 388 | 54 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 54 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 54 | outputbuffers.reserve(implementations.size()); | 394 | 216 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 162 | auto impl = implementations[i]; | 396 | 162 | const ToType canary1{42}; | 397 | 162 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 162 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 162 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 162 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 162 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 162 | return r != 0; | 404 | 162 | } else { | 405 | 162 | return r.error == simdutf::error_code::SUCCESS; | 406 | 162 | } | 407 | 162 | }(implret1); | 408 | 162 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 162 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 162 | const ToType canary2{25}; | 414 | 162 | const auto outputbuffer_first_run = outputbuffer; | 415 | 162 | std::ranges::fill(outputbuffer, canary2); | 416 | 162 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 162 | src.size(), outputbuffer.data()); | 418 | | | 419 | 162 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 162 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 63 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 63 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 63 | } | 440 | 162 | } | 441 | 162 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 162 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 54 | if (!inputisvalid) { | 447 | 27 | for (auto& e : results) { | 448 | 27 | e.outputhash.clear(); | 449 | 27 | } | 450 | 9 | } | 451 | | | 452 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 54 | } else { | 474 | 54 | ret.implementations_agree = true; | 475 | 54 | } | 476 | 54 | return ret; | 477 | 54 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 107 | const bool inputisvalid) const { | 383 | 107 | conversion_result ret{}; | 384 | | | 385 | 107 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 107 | std::vector<result<ConversionResult>> results; | 388 | 107 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 107 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 107 | outputbuffers.reserve(implementations.size()); | 394 | 428 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 321 | auto impl = implementations[i]; | 396 | 321 | const ToType canary1{42}; | 397 | 321 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 321 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 321 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 321 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 321 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 321 | return r != 0; | 404 | 321 | } else { | 405 | 321 | return r.error == simdutf::error_code::SUCCESS; | 406 | 321 | } | 407 | 321 | }(implret1); | 408 | 321 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 321 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 321 | const ToType canary2{25}; | 414 | 321 | const auto outputbuffer_first_run = outputbuffer; | 415 | 321 | std::ranges::fill(outputbuffer, canary2); | 416 | 321 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 321 | src.size(), outputbuffer.data()); | 418 | | | 419 | 321 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 321 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 66 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 66 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 66 | } | 440 | 321 | } | 441 | 321 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 321 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 107 | if (!inputisvalid) { | 447 | 246 | for (auto& e : results) { | 448 | 246 | e.outputhash.clear(); | 449 | 246 | } | 450 | 82 | } | 451 | | | 452 | 107 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 107 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 107 | } else { | 474 | 107 | ret.implementations_agree = true; | 475 | 107 | } | 476 | 107 | return ret; | 477 | 107 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 277 | const bool inputisvalid) const { | 383 | 277 | conversion_result ret{}; | 384 | | | 385 | 277 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 277 | std::vector<result<ConversionResult>> results; | 388 | 277 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 277 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 277 | outputbuffers.reserve(implementations.size()); | 394 | 1.10k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 831 | auto impl = implementations[i]; | 396 | 831 | const ToType canary1{42}; | 397 | 831 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 831 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 831 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 831 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 831 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 831 | return r != 0; | 404 | 831 | } else { | 405 | 831 | return r.error == simdutf::error_code::SUCCESS; | 406 | 831 | } | 407 | 831 | }(implret1); | 408 | 831 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 831 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 831 | const ToType canary2{25}; | 414 | 831 | const auto outputbuffer_first_run = outputbuffer; | 415 | 831 | std::ranges::fill(outputbuffer, canary2); | 416 | 831 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 831 | src.size(), outputbuffer.data()); | 418 | | | 419 | 831 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 831 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 258 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 258 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 258 | } | 440 | 831 | } | 441 | 831 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 831 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 277 | if (!inputisvalid) { | 447 | 537 | for (auto& e : results) { | 448 | 537 | e.outputhash.clear(); | 449 | 537 | } | 450 | 179 | } | 451 | | | 452 | 277 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 277 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 277 | } else { | 474 | 277 | ret.implementations_agree = true; | 475 | 277 | } | 476 | 277 | return ret; | 477 | 277 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 122 | const bool inputisvalid) const { | 383 | 122 | conversion_result ret{}; | 384 | | | 385 | 122 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 122 | std::vector<result<ConversionResult>> results; | 388 | 122 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 122 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 122 | outputbuffers.reserve(implementations.size()); | 394 | 488 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 366 | auto impl = implementations[i]; | 396 | 366 | const ToType canary1{42}; | 397 | 366 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 366 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 366 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 366 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 366 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 366 | return r != 0; | 404 | 366 | } else { | 405 | 366 | return r.error == simdutf::error_code::SUCCESS; | 406 | 366 | } | 407 | 366 | }(implret1); | 408 | 366 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 366 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 366 | const ToType canary2{25}; | 414 | 366 | const auto outputbuffer_first_run = outputbuffer; | 415 | 366 | std::ranges::fill(outputbuffer, canary2); | 416 | 366 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 366 | src.size(), outputbuffer.data()); | 418 | | | 419 | 366 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 366 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 96 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 96 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 96 | } | 440 | 366 | } | 441 | 366 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 366 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 122 | if (!inputisvalid) { | 447 | 81 | for (auto& e : results) { | 448 | 81 | e.outputhash.clear(); | 449 | 81 | } | 450 | 27 | } | 451 | | | 452 | 122 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 122 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 122 | } else { | 474 | 122 | ret.implementations_agree = true; | 475 | 122 | } | 476 | 122 | return ret; | 477 | 122 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 166 | const bool inputisvalid) const { | 383 | 166 | conversion_result ret{}; | 384 | | | 385 | 166 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 166 | std::vector<result<ConversionResult>> results; | 388 | 166 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 166 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 166 | outputbuffers.reserve(implementations.size()); | 394 | 664 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 498 | auto impl = implementations[i]; | 396 | 498 | const ToType canary1{42}; | 397 | 498 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 498 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 498 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 498 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 498 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 498 | return r != 0; | 404 | 498 | } else { | 405 | 498 | return r.error == simdutf::error_code::SUCCESS; | 406 | 498 | } | 407 | 498 | }(implret1); | 408 | 498 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 498 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 498 | const ToType canary2{25}; | 414 | 498 | const auto outputbuffer_first_run = outputbuffer; | 415 | 498 | std::ranges::fill(outputbuffer, canary2); | 416 | 498 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 498 | src.size(), outputbuffer.data()); | 418 | | | 419 | 498 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 498 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 213 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 213 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 213 | } | 440 | 498 | } | 441 | 498 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 498 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 166 | if (!inputisvalid) { | 447 | 285 | for (auto& e : results) { | 448 | 285 | e.outputhash.clear(); | 449 | 285 | } | 450 | 95 | } | 451 | | | 452 | 166 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 166 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 166 | } else { | 474 | 166 | ret.implementations_agree = true; | 475 | 166 | } | 476 | 166 | return ret; | 477 | 166 | } |
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 355 | const bool inputisvalid) const { | 383 | 355 | conversion_result ret{}; | 384 | | | 385 | 355 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 355 | std::vector<result<ConversionResult>> results; | 388 | 355 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 355 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 355 | outputbuffers.reserve(implementations.size()); | 394 | 1.42k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.06k | auto impl = implementations[i]; | 396 | 1.06k | const ToType canary1{42}; | 397 | 1.06k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.06k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.06k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.06k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.06k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.06k | return r != 0; | 404 | 1.06k | } else { | 405 | 1.06k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.06k | } | 407 | 1.06k | }(implret1); | 408 | 1.06k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.06k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.06k | const ToType canary2{25}; | 414 | 1.06k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.06k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.06k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.06k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.06k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.06k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 696 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 696 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 696 | } | 440 | 1.06k | } | 441 | 1.06k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.06k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 355 | if (!inputisvalid) { | 447 | 369 | for (auto& e : results) { | 448 | 369 | e.outputhash.clear(); | 449 | 369 | } | 450 | 123 | } | 451 | | | 452 | 355 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 355 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 355 | } else { | 474 | 355 | ret.implementations_agree = true; | 475 | 355 | } | 476 | 355 | return ret; | 477 | 355 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 113 | const bool inputisvalid) const { | 383 | 113 | conversion_result ret{}; | 384 | | | 385 | 113 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 113 | std::vector<result<ConversionResult>> results; | 388 | 113 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 113 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 113 | outputbuffers.reserve(implementations.size()); | 394 | 452 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 339 | auto impl = implementations[i]; | 396 | 339 | const ToType canary1{42}; | 397 | 339 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 339 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 339 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 339 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 339 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 339 | return r != 0; | 404 | 339 | } else { | 405 | 339 | return r.error == simdutf::error_code::SUCCESS; | 406 | 339 | } | 407 | 339 | }(implret1); | 408 | 339 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 339 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 339 | const ToType canary2{25}; | 414 | 339 | const auto outputbuffer_first_run = outputbuffer; | 415 | 339 | std::ranges::fill(outputbuffer, canary2); | 416 | 339 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 339 | src.size(), outputbuffer.data()); | 418 | | | 419 | 339 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 339 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 99 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 99 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 99 | } | 440 | 339 | } | 441 | 339 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 339 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 113 | if (!inputisvalid) { | 447 | 78 | for (auto& e : results) { | 448 | 78 | e.outputhash.clear(); | 449 | 78 | } | 450 | 26 | } | 451 | | | 452 | 113 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 113 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 113 | } else { | 474 | 113 | ret.implementations_agree = true; | 475 | 113 | } | 476 | 113 | return ret; | 477 | 113 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 156 | const bool inputisvalid) const { | 383 | 156 | conversion_result ret{}; | 384 | | | 385 | 156 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 156 | std::vector<result<ConversionResult>> results; | 388 | 156 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 156 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 156 | outputbuffers.reserve(implementations.size()); | 394 | 624 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 468 | auto impl = implementations[i]; | 396 | 468 | const ToType canary1{42}; | 397 | 468 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 468 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 468 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 468 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 468 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 468 | return r != 0; | 404 | 468 | } else { | 405 | 468 | return r.error == simdutf::error_code::SUCCESS; | 406 | 468 | } | 407 | 468 | }(implret1); | 408 | 468 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 468 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 468 | const ToType canary2{25}; | 414 | 468 | const auto outputbuffer_first_run = outputbuffer; | 415 | 468 | std::ranges::fill(outputbuffer, canary2); | 416 | 468 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 468 | src.size(), outputbuffer.data()); | 418 | | | 419 | 468 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 468 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 192 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 192 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 192 | } | 440 | 468 | } | 441 | 468 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 468 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 156 | if (!inputisvalid) { | 447 | 276 | for (auto& e : results) { | 448 | 276 | e.outputhash.clear(); | 449 | 276 | } | 450 | 92 | } | 451 | | | 452 | 156 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 156 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 156 | } else { | 474 | 156 | ret.implementations_agree = true; | 475 | 156 | } | 476 | 156 | return ret; | 477 | 156 | } |
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 307 | const bool inputisvalid) const { | 383 | 307 | conversion_result ret{}; | 384 | | | 385 | 307 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 307 | std::vector<result<ConversionResult>> results; | 388 | 307 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 307 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 307 | outputbuffers.reserve(implementations.size()); | 394 | 1.22k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 921 | auto impl = implementations[i]; | 396 | 921 | const ToType canary1{42}; | 397 | 921 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 921 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 921 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 921 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 921 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 921 | return r != 0; | 404 | 921 | } else { | 405 | 921 | return r.error == simdutf::error_code::SUCCESS; | 406 | 921 | } | 407 | 921 | }(implret1); | 408 | 921 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 921 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 921 | const ToType canary2{25}; | 414 | 921 | const auto outputbuffer_first_run = outputbuffer; | 415 | 921 | std::ranges::fill(outputbuffer, canary2); | 416 | 921 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 921 | src.size(), outputbuffer.data()); | 418 | | | 419 | 921 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 921 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 561 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 561 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 561 | } | 440 | 921 | } | 441 | 921 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 921 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 307 | if (!inputisvalid) { | 447 | 360 | for (auto& e : results) { | 448 | 360 | e.outputhash.clear(); | 449 | 360 | } | 450 | 120 | } | 451 | | | 452 | 307 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 307 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 307 | } else { | 474 | 307 | ret.implementations_agree = true; | 475 | 307 | } | 476 | 307 | return ret; | 477 | 307 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 201 | const bool inputisvalid) const { | 383 | 201 | conversion_result ret{}; | 384 | | | 385 | 201 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 201 | std::vector<result<ConversionResult>> results; | 388 | 201 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 201 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 201 | outputbuffers.reserve(implementations.size()); | 394 | 804 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 603 | auto impl = implementations[i]; | 396 | 603 | const ToType canary1{42}; | 397 | 603 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 603 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 603 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 603 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 603 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 603 | return r != 0; | 404 | 603 | } else { | 405 | 603 | return r.error == simdutf::error_code::SUCCESS; | 406 | 603 | } | 407 | 603 | }(implret1); | 408 | 603 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 603 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 603 | const ToType canary2{25}; | 414 | 603 | const auto outputbuffer_first_run = outputbuffer; | 415 | 603 | std::ranges::fill(outputbuffer, canary2); | 416 | 603 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 603 | src.size(), outputbuffer.data()); | 418 | | | 419 | 603 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 603 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 63 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 63 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 63 | } | 440 | 603 | } | 441 | 603 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 603 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 201 | if (!inputisvalid) { | 447 | 522 | for (auto& e : results) { | 448 | 522 | e.outputhash.clear(); | 449 | 522 | } | 450 | 174 | } | 451 | | | 452 | 201 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 201 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 201 | } else { | 474 | 201 | ret.implementations_agree = true; | 475 | 201 | } | 476 | 201 | return ret; | 477 | 201 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 308 | const bool inputisvalid) const { | 383 | 308 | conversion_result ret{}; | 384 | | | 385 | 308 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 308 | std::vector<result<ConversionResult>> results; | 388 | 308 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 308 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 308 | outputbuffers.reserve(implementations.size()); | 394 | 1.23k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 924 | auto impl = implementations[i]; | 396 | 924 | const ToType canary1{42}; | 397 | 924 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 924 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 924 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 924 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 924 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 924 | return r != 0; | 404 | 924 | } else { | 405 | 924 | return r.error == simdutf::error_code::SUCCESS; | 406 | 924 | } | 407 | 924 | }(implret1); | 408 | 924 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 924 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 924 | const ToType canary2{25}; | 414 | 924 | const auto outputbuffer_first_run = outputbuffer; | 415 | 924 | std::ranges::fill(outputbuffer, canary2); | 416 | 924 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 924 | src.size(), outputbuffer.data()); | 418 | | | 419 | 924 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 924 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 249 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 249 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 249 | } | 440 | 924 | } | 441 | 924 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 924 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 308 | if (!inputisvalid) { | 447 | 675 | for (auto& e : results) { | 448 | 675 | e.outputhash.clear(); | 449 | 675 | } | 450 | 225 | } | 451 | | | 452 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 308 | } else { | 474 | 308 | ret.implementations_agree = true; | 475 | 308 | } | 476 | 308 | return ret; | 477 | 308 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 285 | const bool inputisvalid) const { | 383 | 285 | conversion_result ret{}; | 384 | | | 385 | 285 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 285 | std::vector<result<ConversionResult>> results; | 388 | 285 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 285 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 285 | outputbuffers.reserve(implementations.size()); | 394 | 1.14k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 855 | auto impl = implementations[i]; | 396 | 855 | const ToType canary1{42}; | 397 | 855 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 855 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 855 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 855 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 855 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 855 | return r != 0; | 404 | 855 | } else { | 405 | 855 | return r.error == simdutf::error_code::SUCCESS; | 406 | 855 | } | 407 | 855 | }(implret1); | 408 | 855 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 855 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 855 | const ToType canary2{25}; | 414 | 855 | const auto outputbuffer_first_run = outputbuffer; | 415 | 855 | std::ranges::fill(outputbuffer, canary2); | 416 | 855 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 855 | src.size(), outputbuffer.data()); | 418 | | | 419 | 855 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 855 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 210 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 210 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 210 | } | 440 | 855 | } | 441 | 855 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 855 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 285 | if (!inputisvalid) { | 447 | 645 | for (auto& e : results) { | 448 | 645 | e.outputhash.clear(); | 449 | 645 | } | 450 | 215 | } | 451 | | | 452 | 285 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 285 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 285 | } else { | 474 | 285 | ret.implementations_agree = true; | 475 | 285 | } | 476 | 285 | return ret; | 477 | 285 | } |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 451 | const bool inputisvalid) const { | 383 | 451 | conversion_result ret{}; | 384 | | | 385 | 451 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 451 | std::vector<result<ConversionResult>> results; | 388 | 451 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 451 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 451 | outputbuffers.reserve(implementations.size()); | 394 | 1.80k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.35k | auto impl = implementations[i]; | 396 | 1.35k | const ToType canary1{42}; | 397 | 1.35k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.35k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.35k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.35k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.35k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.35k | return r != 0; | 404 | 1.35k | } else { | 405 | 1.35k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.35k | } | 407 | 1.35k | }(implret1); | 408 | 1.35k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.35k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.35k | const ToType canary2{25}; | 414 | 1.35k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.35k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.35k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.35k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.35k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.35k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 354 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 354 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 354 | } | 440 | 1.35k | } | 441 | 1.35k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.35k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 451 | if (!inputisvalid) { | 447 | 999 | for (auto& e : results) { | 448 | 999 | e.outputhash.clear(); | 449 | 999 | } | 450 | 333 | } | 451 | | | 452 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 451 | } else { | 474 | 451 | ret.implementations_agree = true; | 475 | 451 | } | 476 | 451 | return ret; | 477 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 284 | const bool inputisvalid) const { | 383 | 284 | conversion_result ret{}; | 384 | | | 385 | 284 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 284 | std::vector<result<ConversionResult>> results; | 388 | 284 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 284 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 284 | outputbuffers.reserve(implementations.size()); | 394 | 1.13k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 852 | auto impl = implementations[i]; | 396 | 852 | const ToType canary1{42}; | 397 | 852 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 852 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 852 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 852 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 852 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 852 | return r != 0; | 404 | 852 | } else { | 405 | 852 | return r.error == simdutf::error_code::SUCCESS; | 406 | 852 | } | 407 | 852 | }(implret1); | 408 | 852 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 852 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 852 | const ToType canary2{25}; | 414 | 852 | const auto outputbuffer_first_run = outputbuffer; | 415 | 852 | std::ranges::fill(outputbuffer, canary2); | 416 | 852 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 852 | src.size(), outputbuffer.data()); | 418 | | | 419 | 852 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 852 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 324 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 324 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 324 | } | 440 | 852 | } | 441 | 852 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 852 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 284 | if (!inputisvalid) { | 447 | 498 | for (auto& e : results) { | 448 | 498 | e.outputhash.clear(); | 449 | 498 | } | 450 | 166 | } | 451 | | | 452 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 284 | } else { | 474 | 284 | ret.implementations_agree = true; | 475 | 284 | } | 476 | 284 | return ret; | 477 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 353 | const bool inputisvalid) const { | 383 | 353 | conversion_result ret{}; | 384 | | | 385 | 353 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 353 | std::vector<result<ConversionResult>> results; | 388 | 353 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 353 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 353 | outputbuffers.reserve(implementations.size()); | 394 | 1.41k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.05k | auto impl = implementations[i]; | 396 | 1.05k | const ToType canary1{42}; | 397 | 1.05k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.05k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.05k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.05k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.05k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.05k | return r != 0; | 404 | 1.05k | } else { | 405 | 1.05k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.05k | } | 407 | 1.05k | }(implret1); | 408 | 1.05k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.05k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.05k | const ToType canary2{25}; | 414 | 1.05k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.05k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.05k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.05k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.05k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.05k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 468 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 468 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 468 | } | 440 | 1.05k | } | 441 | 1.05k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.05k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 353 | if (!inputisvalid) { | 447 | 591 | for (auto& e : results) { | 448 | 591 | e.outputhash.clear(); | 449 | 591 | } | 450 | 197 | } | 451 | | | 452 | 353 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 353 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 353 | } else { | 474 | 353 | ret.implementations_agree = true; | 475 | 353 | } | 476 | 353 | return ret; | 477 | 353 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 284 | const bool inputisvalid) const { | 383 | 284 | conversion_result ret{}; | 384 | | | 385 | 284 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 284 | std::vector<result<ConversionResult>> results; | 388 | 284 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 284 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 284 | outputbuffers.reserve(implementations.size()); | 394 | 1.13k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 852 | auto impl = implementations[i]; | 396 | 852 | const ToType canary1{42}; | 397 | 852 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 852 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 852 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 852 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 852 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 852 | return r != 0; | 404 | 852 | } else { | 405 | 852 | return r.error == simdutf::error_code::SUCCESS; | 406 | 852 | } | 407 | 852 | }(implret1); | 408 | 852 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 852 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 852 | const ToType canary2{25}; | 414 | 852 | const auto outputbuffer_first_run = outputbuffer; | 415 | 852 | std::ranges::fill(outputbuffer, canary2); | 416 | 852 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 852 | src.size(), outputbuffer.data()); | 418 | | | 419 | 852 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 852 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 360 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 360 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 360 | } | 440 | 852 | } | 441 | 852 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 852 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 284 | if (!inputisvalid) { | 447 | 492 | for (auto& e : results) { | 448 | 492 | e.outputhash.clear(); | 449 | 492 | } | 450 | 164 | } | 451 | | | 452 | 284 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 284 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 284 | } else { | 474 | 284 | ret.implementations_agree = true; | 475 | 284 | } | 476 | 284 | return ret; | 477 | 284 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 376 | const bool inputisvalid) const { | 383 | 376 | conversion_result ret{}; | 384 | | | 385 | 376 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 376 | std::vector<result<ConversionResult>> results; | 388 | 376 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 376 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 376 | outputbuffers.reserve(implementations.size()); | 394 | 1.50k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.12k | auto impl = implementations[i]; | 396 | 1.12k | const ToType canary1{42}; | 397 | 1.12k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.12k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.12k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.12k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.12k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.12k | return r != 0; | 404 | 1.12k | } else { | 405 | 1.12k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.12k | } | 407 | 1.12k | }(implret1); | 408 | 1.12k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.12k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.12k | const ToType canary2{25}; | 414 | 1.12k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.12k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.12k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.12k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.12k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.12k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 513 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 513 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 513 | } | 440 | 1.12k | } | 441 | 1.12k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.12k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 376 | if (!inputisvalid) { | 447 | 615 | for (auto& e : results) { | 448 | 615 | e.outputhash.clear(); | 449 | 615 | } | 450 | 205 | } | 451 | | | 452 | 376 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 376 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 376 | } else { | 474 | 376 | ret.implementations_agree = true; | 475 | 376 | } | 476 | 376 | return ret; | 477 | 376 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 40 | const bool inputisvalid) const { | 383 | 40 | conversion_result ret{}; | 384 | | | 385 | 40 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 40 | std::vector<result<ConversionResult>> results; | 388 | 40 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 40 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 40 | outputbuffers.reserve(implementations.size()); | 394 | 160 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 120 | auto impl = implementations[i]; | 396 | 120 | const ToType canary1{42}; | 397 | 120 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 120 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 120 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 120 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 120 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 120 | return r != 0; | 404 | 120 | } else { | 405 | 120 | return r.error == simdutf::error_code::SUCCESS; | 406 | 120 | } | 407 | 120 | }(implret1); | 408 | 120 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 120 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 120 | const ToType canary2{25}; | 414 | 120 | const auto outputbuffer_first_run = outputbuffer; | 415 | 120 | std::ranges::fill(outputbuffer, canary2); | 416 | 120 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 120 | src.size(), outputbuffer.data()); | 418 | | | 419 | 120 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 120 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 114 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 114 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 114 | } | 440 | 120 | } | 441 | 120 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 120 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 40 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 40 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 40 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 40 | } else { | 474 | 40 | ret.implementations_agree = true; | 475 | 40 | } | 476 | 40 | return ret; | 477 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 40 | const bool inputisvalid) const { | 383 | 40 | conversion_result ret{}; | 384 | | | 385 | 40 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 40 | std::vector<result<ConversionResult>> results; | 388 | 40 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 40 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 40 | outputbuffers.reserve(implementations.size()); | 394 | 160 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 120 | auto impl = implementations[i]; | 396 | 120 | const ToType canary1{42}; | 397 | 120 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 120 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 120 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 120 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 120 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 120 | return r != 0; | 404 | 120 | } else { | 405 | 120 | return r.error == simdutf::error_code::SUCCESS; | 406 | 120 | } | 407 | 120 | }(implret1); | 408 | 120 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 120 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 120 | const ToType canary2{25}; | 414 | 120 | const auto outputbuffer_first_run = outputbuffer; | 415 | 120 | std::ranges::fill(outputbuffer, canary2); | 416 | 120 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 120 | src.size(), outputbuffer.data()); | 418 | | | 419 | 120 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 120 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 114 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 114 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 114 | } | 440 | 120 | } | 441 | 120 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 120 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 40 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 40 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 40 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 40 | } else { | 474 | 40 | ret.implementations_agree = true; | 475 | 40 | } | 476 | 40 | return ret; | 477 | 40 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 27 | const bool inputisvalid) const { | 383 | 27 | conversion_result ret{}; | 384 | | | 385 | 27 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 27 | std::vector<result<ConversionResult>> results; | 388 | 27 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 27 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 27 | outputbuffers.reserve(implementations.size()); | 394 | 108 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 81 | auto impl = implementations[i]; | 396 | 81 | const ToType canary1{42}; | 397 | 81 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 81 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 81 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 81 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 81 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 81 | return r != 0; | 404 | 81 | } else { | 405 | 81 | return r.error == simdutf::error_code::SUCCESS; | 406 | 81 | } | 407 | 81 | }(implret1); | 408 | 81 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 81 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 81 | const ToType canary2{25}; | 414 | 81 | const auto outputbuffer_first_run = outputbuffer; | 415 | 81 | std::ranges::fill(outputbuffer, canary2); | 416 | 81 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 81 | src.size(), outputbuffer.data()); | 418 | | | 419 | 81 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 81 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 75 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 75 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 75 | } | 440 | 81 | } | 441 | 81 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 81 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 27 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 27 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 27 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 27 | } else { | 474 | 27 | ret.implementations_agree = true; | 475 | 27 | } | 476 | 27 | return ret; | 477 | 27 | } |
Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const Line | Count | Source | 382 | 287 | const bool inputisvalid) const { | 383 | 287 | conversion_result ret{}; | 384 | | | 385 | 287 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 287 | std::vector<result<ConversionResult>> results; | 388 | 287 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 287 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 287 | outputbuffers.reserve(implementations.size()); | 394 | 1.14k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 861 | auto impl = implementations[i]; | 396 | 861 | const ToType canary1{42}; | 397 | 861 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 861 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 861 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 861 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 861 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 861 | return r != 0; | 404 | 861 | } else { | 405 | 861 | return r.error == simdutf::error_code::SUCCESS; | 406 | 861 | } | 407 | 861 | }(implret1); | 408 | 861 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 861 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 861 | const ToType canary2{25}; | 414 | 861 | const auto outputbuffer_first_run = outputbuffer; | 415 | 861 | std::ranges::fill(outputbuffer, canary2); | 416 | 861 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 861 | src.size(), outputbuffer.data()); | 418 | | | 419 | 861 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 861 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 855 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 855 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 855 | } | 440 | 861 | } | 441 | 861 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 861 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 287 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 287 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 287 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 287 | } else { | 474 | 287 | ret.implementations_agree = true; | 475 | 287 | } | 476 | 287 | return ret; | 477 | 287 | } |
|
478 | | |
479 | 0 | void dump_testcase(FromSpan typedspan, std::ostream& os) const { |
480 | 0 | const auto testhash = FNV1A_hash::as_str(name, typedspan); |
481 | |
|
482 | 0 | os << "// begin testcase\n"; |
483 | 0 | os << "TEST(issue_" << name << "_" << testhash << ") {\n"; |
484 | 0 | os << " alignas(" << sizeof(FromType) << ") const unsigned char data[]={"; |
485 | 0 | const auto first = reinterpret_cast<const unsigned char*>(typedspan.data()); |
486 | 0 | const auto last = first + typedspan.size_bytes(); |
487 | 0 | for (auto it = first; it != last; ++it) { |
488 | 0 | os << "0x" << std::hex << std::setfill('0') << std::setw(2) << (+*it) |
489 | 0 | << (it + 1 == last ? "};\n" : ", "); |
490 | 0 | } |
491 | 0 | os << " constexpr std::size_t data_len_bytes=sizeof(data);\n"; |
492 | 0 | os << " constexpr std::size_t data_len=data_len_bytes/sizeof(" |
493 | 0 | << nameoftype(FromType{}) << ");\n"; |
494 | 0 | if constexpr (From != UtfEncodings::LATIN1) { |
495 | 0 | os << "const auto validation1=implementation." |
496 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName |
497 | 0 | << "((const " << nameoftype(FromType{}) << "*) data,\n data_len);\n"; |
498 | 0 | os << " ASSERT_EQUAL(validation1.count, 1234);\n"; |
499 | 0 | os << " ASSERT_EQUAL(validation1.error, " |
500 | 0 | "simdutf::error_code::SUCCESS);\n"; |
501 | 0 | os << '\n'; |
502 | 0 | os << "const bool validation2=implementation." |
503 | 0 | << ValidationFunctionTrait<From>::ValidationName << "((const " |
504 | 0 | << nameoftype(FromType{}) << "*) data,\n data_len);\n"; |
505 | 0 | os << " " |
506 | 0 | "ASSERT_EQUAL(validation1.error==simdutf::error_code::SUCCESS," |
507 | 0 | "validation2);\n"; |
508 | 0 | os << '\n'; |
509 | 0 | os << " if(validation1.error!= simdutf::error_code::SUCCESS) {return;}\n"; |
510 | 0 | } |
511 | |
|
512 | 0 | if (std::is_invocable_v<LengthFunction, const simdutf::implementation*, |
513 | 0 | const FromType*, std::size_t>) { |
514 | 0 | os << "const auto outlen=implementation." << lengthcalcname << "((const " |
515 | 0 | << nameoftype(FromType{}) << "*) data,\n data_len);\n"; |
516 | 0 | } else if (std::is_invocable_v<LengthFunction, |
517 | 0 | const simdutf::implementation*, |
518 | 0 | std::size_t>) { |
519 | 0 | os << "const auto outlen=implementation." << lengthcalcname |
520 | 0 | << "(data_len);\n"; |
521 | 0 | } else { |
522 | | // programming error |
523 | 0 | std::abort(); |
524 | 0 | } |
525 | 0 | os << "ASSERT_EQUAL(outlen, 1234);\n"; |
526 | 0 | os << "std::vector<" << nameoftype(ToType{}) << "> output(outlen);\n"; |
527 | 0 | os << "const auto r = implementation." << name << "((const " |
528 | 0 | << nameoftype(FromType{}) << "*) data\n, data_len\n, output.data());\n"; |
529 | |
|
530 | 0 | if constexpr (std::is_same_v<ConversionResult, simdutf::result>) { |
531 | 0 | os << " ASSERT_EQUAL(r.error,simdutf::error_code::SUCCESS);\n"; |
532 | 0 | os << " ASSERT_EQUAL(r.count,1234);\n"; |
533 | 0 | } else { |
534 | 0 | os << " ASSERT_EQUAL(r, 1234);\n"; |
535 | 0 | } |
536 | | |
537 | | // dump the output data |
538 | 0 | os << "const std::vector<" << nameoftype(ToType{}) << "> expected_out{};\n"; |
539 | 0 | os << " ASSERT_TRUE(output.size()==expected_out.size());\n"; |
540 | 0 | os << " for(std::size_t i=0; i<output.size(); ++i) { " |
541 | 0 | "ASSERT_EQUAL(+output.at(i),+expected_out.at(i));};\n"; |
542 | |
|
543 | 0 | os << "}\n"; |
544 | 0 | os << "// end testcase\n"; |
545 | 0 | } Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const |
546 | | }; |
547 | | |
548 | 1 | const auto populate_functions() { |
549 | 1 | using I = simdutf::implementation; |
550 | 1 | using FuzzSignature = void (*)(std::span<const char>); |
551 | | |
552 | 1 | #define ADD(lenfunc, conversionfunc) \ |
553 | 42 | FuzzSignature { \ |
554 | 8.65k | +[](std::span<const char> chardata) { \ |
555 | 8.65k | const auto c = \ |
556 | 8.65k | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ |
557 | 8.65k | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ |
558 | 8.65k | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ |
559 | 8.65k | &I::lenfunc, &I::conversionfunc, \ |
560 | 8.65k | std::string{NAMEOF(&I::lenfunc)}, \ |
561 | 8.65k | std::string{NAMEOF(&I::conversionfunc)}}; \ |
562 | 8.65k | c.fuzz(chardata); \ |
563 | 8.65k | } \ conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 94 | +[](std::span<const char> chardata) { \ | 555 | 94 | const auto c = \ | 556 | 94 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 94 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 94 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 94 | &I::lenfunc, &I::conversionfunc, \ | 560 | 94 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 94 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 94 | c.fuzz(chardata); \ | 563 | 94 | } \ |
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 192 | +[](std::span<const char> chardata) { \ | 555 | 192 | const auto c = \ | 556 | 192 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 192 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 192 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 192 | &I::lenfunc, &I::conversionfunc, \ | 560 | 192 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 192 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 192 | c.fuzz(chardata); \ | 563 | 192 | } \ |
conversion.cpp:populate_functions()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 50 | +[](std::span<const char> chardata) { \ | 555 | 50 | const auto c = \ | 556 | 50 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 50 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 50 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 50 | &I::lenfunc, &I::conversionfunc, \ | 560 | 50 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 50 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 50 | c.fuzz(chardata); \ | 563 | 50 | } \ |
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 213 | +[](std::span<const char> chardata) { \ | 555 | 213 | const auto c = \ | 556 | 213 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 213 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 213 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 213 | &I::lenfunc, &I::conversionfunc, \ | 560 | 213 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 213 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 213 | c.fuzz(chardata); \ | 563 | 213 | } \ |
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 62 | +[](std::span<const char> chardata) { \ | 555 | 62 | const auto c = \ | 556 | 62 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 62 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 62 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 62 | &I::lenfunc, &I::conversionfunc, \ | 560 | 62 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 62 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 62 | c.fuzz(chardata); \ | 563 | 62 | } \ |
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 59 | +[](std::span<const char> chardata) { \ | 555 | 59 | const auto c = \ | 556 | 59 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 59 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 59 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 59 | &I::lenfunc, &I::conversionfunc, \ | 560 | 59 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 59 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 59 | c.fuzz(chardata); \ | 563 | 59 | } \ |
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 105 | +[](std::span<const char> chardata) { \ | 555 | 105 | const auto c = \ | 556 | 105 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 105 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 105 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 105 | &I::lenfunc, &I::conversionfunc, \ | 560 | 105 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 105 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 105 | c.fuzz(chardata); \ | 563 | 105 | } \ |
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 234 | +[](std::span<const char> chardata) { \ | 555 | 234 | const auto c = \ | 556 | 234 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 234 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 234 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 234 | &I::lenfunc, &I::conversionfunc, \ | 560 | 234 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 234 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 234 | c.fuzz(chardata); \ | 563 | 234 | } \ |
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 185 | +[](std::span<const char> chardata) { \ | 555 | 185 | const auto c = \ | 556 | 185 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 185 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 185 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 185 | &I::lenfunc, &I::conversionfunc, \ | 560 | 185 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 185 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 185 | c.fuzz(chardata); \ | 563 | 185 | } \ |
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 218 | +[](std::span<const char> chardata) { \ | 555 | 218 | const auto c = \ | 556 | 218 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 218 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 218 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 218 | &I::lenfunc, &I::conversionfunc, \ | 560 | 218 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 218 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 218 | c.fuzz(chardata); \ | 563 | 218 | } \ |
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 50 | +[](std::span<const char> chardata) { \ | 555 | 50 | const auto c = \ | 556 | 50 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 50 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 50 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 50 | &I::lenfunc, &I::conversionfunc, \ | 560 | 50 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 50 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 50 | c.fuzz(chardata); \ | 563 | 50 | } \ |
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 84 | +[](std::span<const char> chardata) { \ | 555 | 84 | const auto c = \ | 556 | 84 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 84 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 84 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 84 | &I::lenfunc, &I::conversionfunc, \ | 560 | 84 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 84 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 84 | c.fuzz(chardata); \ | 563 | 84 | } \ |
conversion.cpp:populate_functions()::$_12::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 152 | +[](std::span<const char> chardata) { \ | 555 | 152 | const auto c = \ | 556 | 152 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 152 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 152 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 152 | &I::lenfunc, &I::conversionfunc, \ | 560 | 152 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 152 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 152 | c.fuzz(chardata); \ | 563 | 152 | } \ |
conversion.cpp:populate_functions()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 54 | +[](std::span<const char> chardata) { \ | 555 | 54 | const auto c = \ | 556 | 54 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 54 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 54 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 54 | &I::lenfunc, &I::conversionfunc, \ | 560 | 54 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 54 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 54 | c.fuzz(chardata); \ | 563 | 54 | } \ |
conversion.cpp:populate_functions()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 133 | +[](std::span<const char> chardata) { \ | 555 | 133 | const auto c = \ | 556 | 133 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 133 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 133 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 133 | &I::lenfunc, &I::conversionfunc, \ | 560 | 133 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 133 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 133 | c.fuzz(chardata); \ | 563 | 133 | } \ |
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 174 | +[](std::span<const char> chardata) { \ | 555 | 174 | const auto c = \ | 556 | 174 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 174 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 174 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 174 | &I::lenfunc, &I::conversionfunc, \ | 560 | 174 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 174 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 174 | c.fuzz(chardata); \ | 563 | 174 | } \ |
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 107 | +[](std::span<const char> chardata) { \ | 555 | 107 | const auto c = \ | 556 | 107 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 107 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 107 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 107 | &I::lenfunc, &I::conversionfunc, \ | 560 | 107 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 107 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 107 | c.fuzz(chardata); \ | 563 | 107 | } \ |
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 230 | +[](std::span<const char> chardata) { \ | 555 | 230 | const auto c = \ | 556 | 230 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 230 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 230 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 230 | &I::lenfunc, &I::conversionfunc, \ | 560 | 230 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 230 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 230 | c.fuzz(chardata); \ | 563 | 230 | } \ |
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 194 | +[](std::span<const char> chardata) { \ | 555 | 194 | const auto c = \ | 556 | 194 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 194 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 194 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 194 | &I::lenfunc, &I::conversionfunc, \ | 560 | 194 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 194 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 194 | c.fuzz(chardata); \ | 563 | 194 | } \ |
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 394 | +[](std::span<const char> chardata) { \ | 555 | 394 | const auto c = \ | 556 | 394 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 394 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 394 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 394 | &I::lenfunc, &I::conversionfunc, \ | 560 | 394 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 394 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 394 | c.fuzz(chardata); \ | 563 | 394 | } \ |
conversion.cpp:populate_functions()::$_20::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 277 | +[](std::span<const char> chardata) { \ | 555 | 277 | const auto c = \ | 556 | 277 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 277 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 277 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 277 | &I::lenfunc, &I::conversionfunc, \ | 560 | 277 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 277 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 277 | c.fuzz(chardata); \ | 563 | 277 | } \ |
conversion.cpp:populate_functions()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 411 | +[](std::span<const char> chardata) { \ | 555 | 411 | const auto c = \ | 556 | 411 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 411 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 411 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 411 | &I::lenfunc, &I::conversionfunc, \ | 560 | 411 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 411 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 411 | c.fuzz(chardata); \ | 563 | 411 | } \ |
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 414 | +[](std::span<const char> chardata) { \ | 555 | 414 | const auto c = \ | 556 | 414 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 414 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 414 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 414 | &I::lenfunc, &I::conversionfunc, \ | 560 | 414 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 414 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 414 | c.fuzz(chardata); \ | 563 | 414 | } \ |
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 418 | +[](std::span<const char> chardata) { \ | 555 | 418 | const auto c = \ | 556 | 418 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 418 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 418 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 418 | &I::lenfunc, &I::conversionfunc, \ | 560 | 418 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 418 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 418 | c.fuzz(chardata); \ | 563 | 418 | } \ |
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 122 | +[](std::span<const char> chardata) { \ | 555 | 122 | const auto c = \ | 556 | 122 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 122 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 122 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 122 | &I::lenfunc, &I::conversionfunc, \ | 560 | 122 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 122 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 122 | c.fuzz(chardata); \ | 563 | 122 | } \ |
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 166 | +[](std::span<const char> chardata) { \ | 555 | 166 | const auto c = \ | 556 | 166 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 166 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 166 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 166 | &I::lenfunc, &I::conversionfunc, \ | 560 | 166 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 166 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 166 | c.fuzz(chardata); \ | 563 | 166 | } \ |
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 355 | +[](std::span<const char> chardata) { \ | 555 | 355 | const auto c = \ | 556 | 355 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 355 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 355 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 355 | &I::lenfunc, &I::conversionfunc, \ | 560 | 355 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 355 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 355 | c.fuzz(chardata); \ | 563 | 355 | } \ |
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 113 | +[](std::span<const char> chardata) { \ | 555 | 113 | const auto c = \ | 556 | 113 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 113 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 113 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 113 | &I::lenfunc, &I::conversionfunc, \ | 560 | 113 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 113 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 113 | c.fuzz(chardata); \ | 563 | 113 | } \ |
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 156 | +[](std::span<const char> chardata) { \ | 555 | 156 | const auto c = \ | 556 | 156 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 156 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 156 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 156 | &I::lenfunc, &I::conversionfunc, \ | 560 | 156 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 156 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 156 | c.fuzz(chardata); \ | 563 | 156 | } \ |
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 307 | +[](std::span<const char> chardata) { \ | 555 | 307 | const auto c = \ | 556 | 307 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 307 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 307 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 307 | &I::lenfunc, &I::conversionfunc, \ | 560 | 307 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 307 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 307 | c.fuzz(chardata); \ | 563 | 307 | } \ |
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 201 | +[](std::span<const char> chardata) { \ | 555 | 201 | const auto c = \ | 556 | 201 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 201 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 201 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 201 | &I::lenfunc, &I::conversionfunc, \ | 560 | 201 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 201 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 201 | c.fuzz(chardata); \ | 563 | 201 | } \ |
conversion.cpp:populate_functions()::$_31::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 308 | +[](std::span<const char> chardata) { \ | 555 | 308 | const auto c = \ | 556 | 308 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 308 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 308 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 308 | &I::lenfunc, &I::conversionfunc, \ | 560 | 308 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 308 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 308 | c.fuzz(chardata); \ | 563 | 308 | } \ |
conversion.cpp:populate_functions()::$_32::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 285 | +[](std::span<const char> chardata) { \ | 555 | 285 | const auto c = \ | 556 | 285 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 285 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 285 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 285 | &I::lenfunc, &I::conversionfunc, \ | 560 | 285 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 285 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 285 | c.fuzz(chardata); \ | 563 | 285 | } \ |
conversion.cpp:populate_functions()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 451 | +[](std::span<const char> chardata) { \ | 555 | 451 | const auto c = \ | 556 | 451 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 451 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 451 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 451 | &I::lenfunc, &I::conversionfunc, \ | 560 | 451 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 451 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 451 | c.fuzz(chardata); \ | 563 | 451 | } \ |
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 284 | +[](std::span<const char> chardata) { \ | 555 | 284 | const auto c = \ | 556 | 284 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 284 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 284 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 284 | &I::lenfunc, &I::conversionfunc, \ | 560 | 284 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 284 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 284 | c.fuzz(chardata); \ | 563 | 284 | } \ |
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 353 | +[](std::span<const char> chardata) { \ | 555 | 353 | const auto c = \ | 556 | 353 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 353 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 353 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 353 | &I::lenfunc, &I::conversionfunc, \ | 560 | 353 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 353 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 353 | c.fuzz(chardata); \ | 563 | 353 | } \ |
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 284 | +[](std::span<const char> chardata) { \ | 555 | 284 | const auto c = \ | 556 | 284 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 284 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 284 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 284 | &I::lenfunc, &I::conversionfunc, \ | 560 | 284 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 284 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 284 | c.fuzz(chardata); \ | 563 | 284 | } \ |
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 376 | +[](std::span<const char> chardata) { \ | 555 | 376 | const auto c = \ | 556 | 376 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 376 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 376 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 376 | &I::lenfunc, &I::conversionfunc, \ | 560 | 376 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 376 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 376 | c.fuzz(chardata); \ | 563 | 376 | } \ |
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 40 | +[](std::span<const char> chardata) { \ | 555 | 40 | const auto c = \ | 556 | 40 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 40 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 40 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 40 | &I::lenfunc, &I::conversionfunc, \ | 560 | 40 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 40 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 40 | c.fuzz(chardata); \ | 563 | 40 | } \ |
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 40 | +[](std::span<const char> chardata) { \ | 555 | 40 | const auto c = \ | 556 | 40 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 40 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 40 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 40 | &I::lenfunc, &I::conversionfunc, \ | 560 | 40 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 40 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 40 | c.fuzz(chardata); \ | 563 | 40 | } \ |
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 27 | +[](std::span<const char> chardata) { \ | 555 | 27 | const auto c = \ | 556 | 27 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 27 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 27 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 27 | &I::lenfunc, &I::conversionfunc, \ | 560 | 27 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 27 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 27 | c.fuzz(chardata); \ | 563 | 27 | } \ |
conversion.cpp:populate_functions()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 287 | +[](std::span<const char> chardata) { \ | 555 | 287 | const auto c = \ | 556 | 287 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 287 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 287 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 287 | &I::lenfunc, &I::conversionfunc, \ | 560 | 287 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 287 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 287 | c.fuzz(chardata); \ | 563 | 287 | } \ |
|
564 | 42 | } |
565 | | |
566 | 1 | return std::array{ |
567 | | // all these cases require valid input for invoking the convert function |
568 | | |
569 | | // see #493 |
570 | | // IGNORE(latin1_length_from_utf16, convert_valid_utf16be_to_latin1), |
571 | 1 | ADD(utf32_length_from_utf16be, convert_valid_utf16be_to_utf32), |
572 | 1 | ADD(utf8_length_from_utf16be, convert_valid_utf16be_to_utf8), |
573 | | |
574 | | // see #493 |
575 | | // IGNORE(latin1_length_from_utf16, convert_valid_utf16le_to_latin1), |
576 | 1 | ADD(utf32_length_from_utf16le, convert_valid_utf16le_to_utf32), |
577 | 1 | ADD(utf8_length_from_utf16le, convert_valid_utf16le_to_utf8), |
578 | | |
579 | | // see #493 |
580 | | // IGNORE(latin1_length_from_utf32, convert_valid_utf32_to_latin1), |
581 | 1 | ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16be), |
582 | 1 | ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16le), |
583 | 1 | ADD(utf8_length_from_utf32, convert_valid_utf32_to_utf8), |
584 | | |
585 | | // see #493 |
586 | | // IGNORE(latin1_length_from_utf8, convert_valid_utf8_to_latin1), |
587 | 1 | ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16be), |
588 | 1 | ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16le), |
589 | 1 | ADD(utf32_length_from_utf8, convert_valid_utf8_to_utf32), |
590 | | |
591 | | // all these cases operate on arbitrary data |
592 | 1 | ADD(latin1_length_from_utf16, convert_utf16be_to_latin1), |
593 | 1 | ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32), |
594 | 1 | ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8), |
595 | | |
596 | 1 | ADD(latin1_length_from_utf16, convert_utf16le_to_latin1), |
597 | 1 | ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32), |
598 | 1 | ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8), |
599 | | |
600 | 1 | ADD(latin1_length_from_utf32, convert_utf32_to_latin1), |
601 | 1 | ADD(utf16_length_from_utf32, convert_utf32_to_utf16be), |
602 | 1 | ADD(utf16_length_from_utf32, convert_utf32_to_utf16le), |
603 | 1 | ADD(utf8_length_from_utf32, convert_utf32_to_utf8), |
604 | | |
605 | 1 | ADD(latin1_length_from_utf8, convert_utf8_to_latin1), |
606 | 1 | ADD(utf16_length_from_utf8, convert_utf8_to_utf16be), |
607 | 1 | ADD(utf16_length_from_utf8, convert_utf8_to_utf16le), |
608 | 1 | ADD(utf32_length_from_utf8, convert_utf8_to_utf32), |
609 | | |
610 | | // all these cases operate on arbitrary data and use the _with_errors |
611 | | // variant |
612 | 1 | ADD(latin1_length_from_utf16, convert_utf16be_to_latin1_with_errors), |
613 | 1 | ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32_with_errors), |
614 | 1 | ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8_with_errors), |
615 | | |
616 | 1 | ADD(latin1_length_from_utf16, convert_utf16le_to_latin1_with_errors), |
617 | 1 | ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32_with_errors), |
618 | 1 | ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8_with_errors), |
619 | | |
620 | 1 | ADD(latin1_length_from_utf32, convert_utf32_to_latin1_with_errors), |
621 | 1 | ADD(utf16_length_from_utf32, convert_utf32_to_utf16be_with_errors), |
622 | 1 | ADD(utf16_length_from_utf32, convert_utf32_to_utf16le_with_errors), |
623 | 1 | ADD(utf8_length_from_utf32, convert_utf32_to_utf8_with_errors), |
624 | | |
625 | 1 | ADD(latin1_length_from_utf8, convert_utf8_to_latin1_with_errors), |
626 | 1 | ADD(utf16_length_from_utf8, convert_utf8_to_utf16be_with_errors), |
627 | 1 | ADD(utf16_length_from_utf8, convert_utf8_to_utf16le_with_errors), |
628 | 1 | ADD(utf32_length_from_utf8, convert_utf8_to_utf32_with_errors), |
629 | | |
630 | | // these are a bit special since all input is valid |
631 | 1 | ADD(utf32_length_from_latin1, convert_latin1_to_utf32), |
632 | 1 | ADD(utf16_length_from_latin1, convert_latin1_to_utf16be), |
633 | 1 | ADD(utf16_length_from_latin1, convert_latin1_to_utf16le), |
634 | 1 | ADD(utf8_length_from_latin1, convert_latin1_to_utf8)}; |
635 | | |
636 | 1 | #undef ADD |
637 | 1 | } |
638 | | |
639 | 8.66k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
640 | 8.66k | static const auto fptrs = populate_functions(); |
641 | 8.66k | constexpr std::size_t Ncases = fptrs.size(); |
642 | | |
643 | | // pick one of the function pointers, based on the fuzz data |
644 | | // the first byte is which action to take. step forward |
645 | | // several bytes so the input is aligned. |
646 | 8.66k | if (size < 4) { |
647 | 3 | return 0; |
648 | 3 | } |
649 | | |
650 | 8.66k | constexpr auto actionmask = std::bit_ceil(Ncases) - 1; |
651 | 8.66k | const auto action = data[0] & actionmask; |
652 | 8.66k | data += 4; |
653 | 8.66k | size -= 4; |
654 | | |
655 | 8.66k | if (action >= Ncases) { |
656 | 1 | return 0; |
657 | 1 | } |
658 | | |
659 | 8.65k | if constexpr (use_separate_allocation) { |
660 | | // this is better at excercising null input and catch buffer underflows |
661 | 8.65k | const std::vector<char> separate{data, data + size}; |
662 | 8.65k | fptrs[action](std::span(separate)); |
663 | | } else { |
664 | | std::span<const char> chardata{(const char*)data, size}; |
665 | | fptrs[action](chardata); |
666 | | } |
667 | | |
668 | 8.65k | return 0; |
669 | 8.66k | } |