/src/simdutf/fuzz/conversion.cpp
Line | Count | Source |
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 | 9.31k | void fuzz(std::span<const char> chardata) const { |
176 | | // assume the input is aligned to FromType |
177 | 9.31k | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), |
178 | 9.31k | chardata.size() / sizeof(FromType)}; |
179 | | |
180 | 9.31k | static const bool do_print_testcase = |
181 | 9.31k | std::getenv("PRINT_FUZZ_CASE") != nullptr; |
182 | | |
183 | 9.31k | if (do_print_testcase) { |
184 | 0 | dump_testcase(from, std::cerr); |
185 | 0 | std::exit(EXIT_SUCCESS); |
186 | 0 | } |
187 | | |
188 | 9.31k | do { |
189 | | // step 0 - is the input valid? |
190 | 9.31k | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); |
191 | 9.31k | 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 | 6.35k | From == UtfEncodings::UTF8) { |
198 | 6.35k | if (!count_the_input(from) && !allow_implementations_to_differ) |
199 | 0 | break; |
200 | 6.35k | } |
201 | | |
202 | | // step 2 - what is the required size of the output? |
203 | 6.35k | const auto [output_length, length_agree] = |
204 | 9.31k | calculate_length(from, inputisvalid); |
205 | 9.31k | if (!length_agree && !allow_implementations_to_differ) |
206 | 0 | break; |
207 | | |
208 | 9.31k | if (!inputisvalid && name.find("valid") != std::string::npos) { |
209 | | // don't run the conversion step, it requires valid input |
210 | 96 | return; |
211 | 96 | } |
212 | | |
213 | | // step 3 - run the conversion |
214 | 9.21k | const auto [written, outputs_agree] = |
215 | 9.21k | do_conversion(from, output_length, inputisvalid); |
216 | 9.21k | if (!outputs_agree && !allow_implementations_to_differ) |
217 | 0 | break; |
218 | | |
219 | | // coming this far means no problems were found |
220 | 9.21k | return; |
221 | 9.21k | } 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 | 9.31k | } 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 | 251 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 251 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 251 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 251 | static const bool do_print_testcase = | 181 | 251 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 251 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 251 | do { | 189 | | // step 0 - is the input valid? | 190 | 251 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 251 | 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 | 251 | From == UtfEncodings::UTF8) { | 198 | 251 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 251 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 251 | const auto [output_length, length_agree] = | 204 | 251 | calculate_length(from, inputisvalid); | 205 | 251 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 251 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 21 | return; | 211 | 21 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 230 | const auto [written, outputs_agree] = | 215 | 230 | do_conversion(from, output_length, inputisvalid); | 216 | 230 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 230 | return; | 221 | 230 | } 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 | 251 | } |
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 | 448 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 448 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 448 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 448 | static const bool do_print_testcase = | 181 | 448 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 448 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 448 | do { | 189 | | // step 0 - is the input valid? | 190 | 448 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 448 | 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 | 448 | From == UtfEncodings::UTF8) { | 198 | 448 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 448 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 448 | const auto [output_length, length_agree] = | 204 | 448 | calculate_length(from, inputisvalid); | 205 | 448 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 448 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 14 | return; | 211 | 14 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 434 | const auto [written, outputs_agree] = | 215 | 434 | do_conversion(from, output_length, inputisvalid); | 216 | 434 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 434 | return; | 221 | 434 | } 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 | 448 | } |
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 | 225 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 225 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 225 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 225 | static const bool do_print_testcase = | 181 | 225 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 225 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 225 | do { | 189 | | // step 0 - is the input valid? | 190 | 225 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 225 | 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 | 225 | From == UtfEncodings::UTF8) { | 198 | 225 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 225 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 225 | const auto [output_length, length_agree] = | 204 | 225 | calculate_length(from, inputisvalid); | 205 | 225 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 225 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 4 | return; | 211 | 4 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 221 | const auto [written, outputs_agree] = | 215 | 221 | do_conversion(from, output_length, inputisvalid); | 216 | 221 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 221 | return; | 221 | 221 | } 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 | 225 | } |
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 | 468 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 468 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 468 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 468 | static const bool do_print_testcase = | 181 | 468 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 468 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 468 | do { | 189 | | // step 0 - is the input valid? | 190 | 468 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 468 | 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 | 468 | From == UtfEncodings::UTF8) { | 198 | 468 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 468 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 468 | const auto [output_length, length_agree] = | 204 | 468 | calculate_length(from, inputisvalid); | 205 | 468 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 468 | 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 | 450 | const auto [written, outputs_agree] = | 215 | 450 | do_conversion(from, output_length, inputisvalid); | 216 | 450 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 450 | return; | 221 | 450 | } 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 | 468 | } |
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 | 311 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 311 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 311 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 311 | static const bool do_print_testcase = | 181 | 311 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 311 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 311 | do { | 189 | | // step 0 - is the input valid? | 190 | 311 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 311 | 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 | 311 | const auto [output_length, length_agree] = | 204 | 311 | calculate_length(from, inputisvalid); | 205 | 311 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 311 | 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 | 302 | const auto [written, outputs_agree] = | 215 | 302 | do_conversion(from, output_length, inputisvalid); | 216 | 302 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 302 | return; | 221 | 302 | } 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 | 311 | } |
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 | 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 | | 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 | 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 | 4 | return; | 211 | 4 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 372 | const auto [written, outputs_agree] = | 215 | 372 | do_conversion(from, output_length, inputisvalid); | 216 | 372 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 372 | return; | 221 | 372 | } 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)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 | 446 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 446 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 446 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 446 | static const bool do_print_testcase = | 181 | 446 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 446 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 446 | do { | 189 | | // step 0 - is the input valid? | 190 | 446 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 446 | 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 | 446 | const auto [output_length, length_agree] = | 204 | 446 | calculate_length(from, inputisvalid); | 205 | 446 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 446 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 6 | return; | 211 | 6 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 440 | const auto [written, outputs_agree] = | 215 | 440 | do_conversion(from, output_length, inputisvalid); | 216 | 440 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 440 | return; | 221 | 440 | } 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 | 446 | } |
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 | 612 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 612 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 612 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 612 | static const bool do_print_testcase = | 181 | 612 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 612 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 612 | do { | 189 | | // step 0 - is the input valid? | 190 | 612 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 612 | 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 | 612 | From == UtfEncodings::UTF8) { | 198 | 612 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 612 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 612 | const auto [output_length, length_agree] = | 204 | 612 | calculate_length(from, inputisvalid); | 205 | 612 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 612 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 4 | return; | 211 | 4 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 608 | const auto [written, outputs_agree] = | 215 | 608 | do_conversion(from, output_length, inputisvalid); | 216 | 608 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 608 | return; | 221 | 608 | } 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 | 612 | } |
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 | 610 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 610 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 610 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 610 | static const bool do_print_testcase = | 181 | 610 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 610 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 610 | do { | 189 | | // step 0 - is the input valid? | 190 | 610 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 610 | 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 | 610 | From == UtfEncodings::UTF8) { | 198 | 610 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 610 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 610 | const auto [output_length, length_agree] = | 204 | 610 | calculate_length(from, inputisvalid); | 205 | 610 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 610 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 6 | return; | 211 | 6 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 604 | const auto [written, outputs_agree] = | 215 | 604 | do_conversion(from, output_length, inputisvalid); | 216 | 604 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 604 | return; | 221 | 604 | } 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 | 610 | } |
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 | 626 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 626 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 626 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 626 | static const bool do_print_testcase = | 181 | 626 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 626 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 626 | do { | 189 | | // step 0 - is the input valid? | 190 | 626 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 626 | 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 | 626 | From == UtfEncodings::UTF8) { | 198 | 626 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 626 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 626 | const auto [output_length, length_agree] = | 204 | 626 | calculate_length(from, inputisvalid); | 205 | 626 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 626 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 10 | return; | 211 | 10 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 616 | const auto [written, outputs_agree] = | 215 | 616 | do_conversion(from, output_length, inputisvalid); | 216 | 616 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 616 | return; | 221 | 616 | } 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 | 626 | } |
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 | 46 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 46 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 46 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 46 | static const bool do_print_testcase = | 181 | 46 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 46 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 46 | do { | 189 | | // step 0 - is the input valid? | 190 | 46 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 46 | 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 | 46 | From == UtfEncodings::UTF8) { | 198 | 46 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 46 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 46 | const auto [output_length, length_agree] = | 204 | 46 | calculate_length(from, inputisvalid); | 205 | 46 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 46 | 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 | 46 | const auto [written, outputs_agree] = | 215 | 46 | do_conversion(from, output_length, inputisvalid); | 216 | 46 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 46 | return; | 221 | 46 | } 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 | 46 | } |
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 | 87 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 87 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 87 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 87 | static const bool do_print_testcase = | 181 | 87 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 87 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 87 | do { | 189 | | // step 0 - is the input valid? | 190 | 87 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 87 | 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 | 87 | From == UtfEncodings::UTF8) { | 198 | 87 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 87 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 87 | const auto [output_length, length_agree] = | 204 | 87 | calculate_length(from, inputisvalid); | 205 | 87 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 87 | 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 | 87 | const auto [written, outputs_agree] = | 215 | 87 | do_conversion(from, output_length, inputisvalid); | 216 | 87 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 87 | return; | 221 | 87 | } 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 | 87 | } |
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 | 88 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 88 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 88 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 88 | static const bool do_print_testcase = | 181 | 88 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 88 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 88 | do { | 189 | | // step 0 - is the input valid? | 190 | 88 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 88 | 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 | 88 | const auto [output_length, length_agree] = | 204 | 88 | calculate_length(from, inputisvalid); | 205 | 88 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 88 | 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 | 88 | const auto [written, outputs_agree] = | 215 | 88 | do_conversion(from, output_length, inputisvalid); | 216 | 88 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 88 | return; | 221 | 88 | } 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 | 88 | } |
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 | 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 | 285 | From == UtfEncodings::UTF8) { | 198 | 285 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 285 | } | 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)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 | 115 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 115 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 115 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 115 | static const bool do_print_testcase = | 181 | 115 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 115 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 115 | do { | 189 | | // step 0 - is the input valid? | 190 | 115 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 115 | 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 | 115 | From == UtfEncodings::UTF8) { | 198 | 115 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 115 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 115 | const auto [output_length, length_agree] = | 204 | 115 | calculate_length(from, inputisvalid); | 205 | 115 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 115 | 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 | 115 | const auto [written, outputs_agree] = | 215 | 115 | do_conversion(from, output_length, inputisvalid); | 216 | 115 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 115 | return; | 221 | 115 | } 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 | 115 | } |
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 | 341 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 341 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 341 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 341 | static const bool do_print_testcase = | 181 | 341 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 341 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 341 | do { | 189 | | // step 0 - is the input valid? | 190 | 341 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 341 | 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 | 341 | From == UtfEncodings::UTF8) { | 198 | 341 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 341 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 341 | const auto [output_length, length_agree] = | 204 | 341 | calculate_length(from, inputisvalid); | 205 | 341 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 341 | 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 | 341 | const auto [written, outputs_agree] = | 215 | 341 | do_conversion(from, output_length, inputisvalid); | 216 | 341 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 341 | return; | 221 | 341 | } 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 | 341 | } |
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 | 136 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 136 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 136 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 136 | static const bool do_print_testcase = | 181 | 136 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 136 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 136 | do { | 189 | | // step 0 - is the input valid? | 190 | 136 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 136 | 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 | 136 | From == UtfEncodings::UTF8) { | 198 | 136 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 136 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 136 | const auto [output_length, length_agree] = | 204 | 136 | calculate_length(from, inputisvalid); | 205 | 136 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 136 | 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 | 136 | const auto [written, outputs_agree] = | 215 | 136 | do_conversion(from, output_length, inputisvalid); | 216 | 136 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 136 | return; | 221 | 136 | } 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 | 136 | } |
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 | 188 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 188 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 188 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 188 | static const bool do_print_testcase = | 181 | 188 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 188 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 188 | do { | 189 | | // step 0 - is the input valid? | 190 | 188 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 188 | 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 | 188 | From == UtfEncodings::UTF8) { | 198 | 188 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 188 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 188 | const auto [output_length, length_agree] = | 204 | 188 | calculate_length(from, inputisvalid); | 205 | 188 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 188 | 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 | 188 | const auto [written, outputs_agree] = | 215 | 188 | do_conversion(from, output_length, inputisvalid); | 216 | 188 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 188 | return; | 221 | 188 | } 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 | 188 | } |
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 | 365 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 365 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 365 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 365 | static const bool do_print_testcase = | 181 | 365 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 365 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 365 | do { | 189 | | // step 0 - is the input valid? | 190 | 365 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 365 | 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 | 365 | From == UtfEncodings::UTF8) { | 198 | 365 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 365 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 365 | const auto [output_length, length_agree] = | 204 | 365 | calculate_length(from, inputisvalid); | 205 | 365 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 365 | 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 | 365 | const auto [written, outputs_agree] = | 215 | 365 | do_conversion(from, output_length, inputisvalid); | 216 | 365 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 365 | return; | 221 | 365 | } 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 | 365 | } |
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 | 238 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 238 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 238 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 238 | static const bool do_print_testcase = | 181 | 238 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 238 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 238 | do { | 189 | | // step 0 - is the input valid? | 190 | 238 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 238 | 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 | 238 | const auto [output_length, length_agree] = | 204 | 238 | calculate_length(from, inputisvalid); | 205 | 238 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 238 | 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 | 238 | const auto [written, outputs_agree] = | 215 | 238 | do_conversion(from, output_length, inputisvalid); | 216 | 238 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 238 | return; | 221 | 238 | } 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 | 238 | } |
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 | 286 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 286 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 286 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 286 | static const bool do_print_testcase = | 181 | 286 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 286 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 286 | do { | 189 | | // step 0 - is the input valid? | 190 | 286 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 286 | 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 | 286 | const auto [output_length, length_agree] = | 204 | 286 | calculate_length(from, inputisvalid); | 205 | 286 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 286 | 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 | 286 | const auto [written, outputs_agree] = | 215 | 286 | do_conversion(from, output_length, inputisvalid); | 216 | 286 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 286 | return; | 221 | 286 | } 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 | 286 | } |
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 | 336 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 336 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 336 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 336 | static const bool do_print_testcase = | 181 | 336 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 336 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 336 | do { | 189 | | // step 0 - is the input valid? | 190 | 336 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 336 | 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 | 336 | const auto [output_length, length_agree] = | 204 | 336 | calculate_length(from, inputisvalid); | 205 | 336 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 336 | 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 | 336 | const auto [written, outputs_agree] = | 215 | 336 | do_conversion(from, output_length, inputisvalid); | 216 | 336 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 336 | return; | 221 | 336 | } 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 | 336 | } |
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 | 416 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 416 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 416 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 416 | static const bool do_print_testcase = | 181 | 416 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 416 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 416 | do { | 189 | | // step 0 - is the input valid? | 190 | 416 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 416 | 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 | 416 | const auto [output_length, length_agree] = | 204 | 416 | calculate_length(from, inputisvalid); | 205 | 416 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 416 | 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 | 416 | const auto [written, outputs_agree] = | 215 | 416 | do_conversion(from, output_length, inputisvalid); | 216 | 416 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 416 | return; | 221 | 416 | } 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 | 416 | } |
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 | 266 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 266 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 266 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 266 | static const bool do_print_testcase = | 181 | 266 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 266 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 266 | do { | 189 | | // step 0 - is the input valid? | 190 | 266 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 266 | 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 | 266 | From == UtfEncodings::UTF8) { | 198 | 266 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 266 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 266 | const auto [output_length, length_agree] = | 204 | 266 | calculate_length(from, inputisvalid); | 205 | 266 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 266 | 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 | 266 | const auto [written, outputs_agree] = | 215 | 266 | do_conversion(from, output_length, inputisvalid); | 216 | 266 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 266 | return; | 221 | 266 | } 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 | 266 | } |
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 | 415 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 415 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 415 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 415 | static const bool do_print_testcase = | 181 | 415 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 415 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 415 | do { | 189 | | // step 0 - is the input valid? | 190 | 415 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 415 | 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 | 415 | From == UtfEncodings::UTF8) { | 198 | 415 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 415 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 415 | const auto [output_length, length_agree] = | 204 | 415 | calculate_length(from, inputisvalid); | 205 | 415 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 415 | 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 | 415 | const auto [written, outputs_agree] = | 215 | 415 | do_conversion(from, output_length, inputisvalid); | 216 | 415 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 415 | return; | 221 | 415 | } 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 | 415 | } |
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 | 327 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 327 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 327 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 327 | static const bool do_print_testcase = | 181 | 327 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 327 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 327 | do { | 189 | | // step 0 - is the input valid? | 190 | 327 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 327 | 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 | 327 | From == UtfEncodings::UTF8) { | 198 | 327 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 327 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 327 | const auto [output_length, length_agree] = | 204 | 327 | calculate_length(from, inputisvalid); | 205 | 327 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 327 | 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 | 327 | const auto [written, outputs_agree] = | 215 | 327 | do_conversion(from, output_length, inputisvalid); | 216 | 327 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 327 | return; | 221 | 327 | } 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 | 327 | } |
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 | 373 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 373 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 373 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 373 | static const bool do_print_testcase = | 181 | 373 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 373 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 373 | do { | 189 | | // step 0 - is the input valid? | 190 | 373 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 373 | 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 | 373 | From == UtfEncodings::UTF8) { | 198 | 373 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 373 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 373 | const auto [output_length, length_agree] = | 204 | 373 | calculate_length(from, inputisvalid); | 205 | 373 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 373 | 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 | 373 | const auto [written, outputs_agree] = | 215 | 373 | do_conversion(from, output_length, inputisvalid); | 216 | 373 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 373 | return; | 221 | 373 | } 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 | 373 | } |
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 | 55 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 55 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 55 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 55 | static const bool do_print_testcase = | 181 | 55 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 55 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 55 | do { | 189 | | // step 0 - is the input valid? | 190 | 55 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 55 | 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 | 55 | const auto [output_length, length_agree] = | 204 | 55 | calculate_length(from, inputisvalid); | 205 | 55 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 55 | 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 | 55 | const auto [written, outputs_agree] = | 215 | 55 | do_conversion(from, output_length, inputisvalid); | 216 | 55 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 55 | return; | 221 | 55 | } 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 | 55 | } |
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 | 51 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 51 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 51 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 51 | static const bool do_print_testcase = | 181 | 51 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 51 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 51 | do { | 189 | | // step 0 - is the input valid? | 190 | 51 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 51 | 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 | 51 | const auto [output_length, length_agree] = | 204 | 51 | calculate_length(from, inputisvalid); | 205 | 51 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 51 | 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 | 51 | const auto [written, outputs_agree] = | 215 | 51 | do_conversion(from, output_length, inputisvalid); | 216 | 51 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 51 | return; | 221 | 51 | } 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 | 51 | } |
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 | 41 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 41 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 41 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 41 | static const bool do_print_testcase = | 181 | 41 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 41 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 41 | do { | 189 | | // step 0 - is the input valid? | 190 | 41 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 41 | 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 | 41 | const auto [output_length, length_agree] = | 204 | 41 | calculate_length(from, inputisvalid); | 205 | 41 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 41 | 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 | 41 | const auto [written, outputs_agree] = | 215 | 41 | do_conversion(from, output_length, inputisvalid); | 216 | 41 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 41 | return; | 221 | 41 | } 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 | 41 | } |
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 | 318 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 318 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 318 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 318 | static const bool do_print_testcase = | 181 | 318 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 318 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 318 | do { | 189 | | // step 0 - is the input valid? | 190 | 318 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 318 | 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 | 318 | const auto [output_length, length_agree] = | 204 | 318 | calculate_length(from, inputisvalid); | 205 | 318 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 318 | 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 | 318 | const auto [written, outputs_agree] = | 215 | 318 | do_conversion(from, output_length, inputisvalid); | 216 | 318 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 318 | return; | 221 | 318 | } 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 | 318 | } |
|
227 | | |
228 | | template <typename Dummy = void> |
229 | | requires(From != UtfEncodings::LATIN1) |
230 | 8.84k | validation_result verify_valid_input(FromSpan src) const { |
231 | 8.84k | validation_result ret{}; |
232 | | |
233 | 8.84k | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; |
234 | 8.84k | const auto implementations = get_supported_implementations(); |
235 | 8.84k | std::vector<simdutf::result> results; |
236 | 8.84k | results.reserve(implementations.size()); |
237 | | |
238 | 26.5k | for (auto impl : implementations) { |
239 | 26.5k | results.push_back( |
240 | 26.5k | std::invoke(input_validation, impl, src.data(), src.size())); |
241 | | |
242 | | // make sure the validation variant that returns a bool agrees |
243 | 26.5k | const bool validation1 = results.back().error == simdutf::SUCCESS; |
244 | 26.5k | const bool validation2 = |
245 | 26.5k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, |
246 | 26.5k | src.data(), src.size()); |
247 | 26.5k | 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 | 26.5k | } |
258 | | |
259 | 17.6k | 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 | 502 | 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 | 896 | 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 | 450 | 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 | 936 | 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 | 622 | 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 | 752 | 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 | 892 | 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.22k | 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.22k | 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.25k | 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 | 92 | 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 | 174 | 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 | 176 | 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 | 570 | 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 | 230 | 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 | 682 | 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 | 272 | 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 | 376 | 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 | 730 | 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 | 476 | 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 | 572 | 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 | 672 | 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 | 832 | 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 | 532 | 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 | 830 | 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 | 654 | 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 | 746 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
260 | 8.84k | 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.84k | } else { |
273 | 8.84k | ret.implementations_agree = true; |
274 | 8.84k | } |
275 | 17.5k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { |
276 | 17.5k | return r.error == simdutf::SUCCESS; |
277 | 17.5k | }); _ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 565 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 565 | return r.error == simdutf::SUCCESS; | 277 | 565 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.10k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.10k | return r.error == simdutf::SUCCESS; | 277 | 1.10k | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 485 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 485 | return r.error == simdutf::SUCCESS; | 277 | 485 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.17k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.17k | return r.error == simdutf::SUCCESS; | 277 | 1.17k | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 555 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 555 | return r.error == simdutf::SUCCESS; | 277 | 555 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 736 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 736 | return r.error == simdutf::SUCCESS; | 277 | 736 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 740 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 740 | return r.error == simdutf::SUCCESS; | 277 | 740 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.30k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.30k | return r.error == simdutf::SUCCESS; | 277 | 1.30k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.28k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.28k | return r.error == simdutf::SUCCESS; | 277 | 1.28k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.35k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.35k | return r.error == simdutf::SUCCESS; | 277 | 1.35k | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 126 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 126 | return r.error == simdutf::SUCCESS; | 277 | 126 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 199 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 199 | return r.error == simdutf::SUCCESS; | 277 | 199 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 138 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 138 | return r.error == simdutf::SUCCESS; | 277 | 138 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 461 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 461 | return r.error == simdutf::SUCCESS; | 277 | 461 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 283 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 283 | return r.error == simdutf::SUCCESS; | 277 | 283 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 338 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 338 | return r.error == simdutf::SUCCESS; | 277 | 338 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 743 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 743 | return r.error == simdutf::SUCCESS; | 277 | 743 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 354 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 354 | return r.error == simdutf::SUCCESS; | 277 | 354 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 352 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 352 | return r.error == simdutf::SUCCESS; | 277 | 352 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 817 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 817 | return r.error == simdutf::SUCCESS; | 277 | 817 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 300 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 300 | return r.error == simdutf::SUCCESS; | 277 | 300 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 470 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 470 | return r.error == simdutf::SUCCESS; | 277 | 470 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 516 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 516 | return r.error == simdutf::SUCCESS; | 277 | 516 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 618 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 618 | return r.error == simdutf::SUCCESS; | 277 | 618 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 482 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 482 | return r.error == simdutf::SUCCESS; | 277 | 482 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 767 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 767 | return r.error == simdutf::SUCCESS; | 277 | 767 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 567 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 567 | return r.error == simdutf::SUCCESS; | 277 | 567 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 711 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 711 | return r.error == simdutf::SUCCESS; | 277 | 711 | }); |
|
278 | 8.84k | return ret; |
279 | 8.84k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 251 | validation_result verify_valid_input(FromSpan src) const { | 231 | 251 | validation_result ret{}; | 232 | | | 233 | 251 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 251 | const auto implementations = get_supported_implementations(); | 235 | 251 | std::vector<simdutf::result> results; | 236 | 251 | results.reserve(implementations.size()); | 237 | | | 238 | 753 | for (auto impl : implementations) { | 239 | 753 | results.push_back( | 240 | 753 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 753 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 753 | const bool validation2 = | 245 | 753 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 753 | src.data(), src.size()); | 247 | 753 | 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 | 753 | } | 258 | | | 259 | 251 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 251 | 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 | 251 | } else { | 273 | 251 | ret.implementations_agree = true; | 274 | 251 | } | 275 | 251 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 251 | return r.error == simdutf::SUCCESS; | 277 | 251 | }); | 278 | 251 | return ret; | 279 | 251 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 448 | validation_result verify_valid_input(FromSpan src) const { | 231 | 448 | validation_result ret{}; | 232 | | | 233 | 448 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 448 | const auto implementations = get_supported_implementations(); | 235 | 448 | std::vector<simdutf::result> results; | 236 | 448 | results.reserve(implementations.size()); | 237 | | | 238 | 1.34k | for (auto impl : implementations) { | 239 | 1.34k | results.push_back( | 240 | 1.34k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.34k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.34k | const bool validation2 = | 245 | 1.34k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.34k | src.data(), src.size()); | 247 | 1.34k | 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.34k | } | 258 | | | 259 | 448 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 448 | 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 | 448 | } else { | 273 | 448 | ret.implementations_agree = true; | 274 | 448 | } | 275 | 448 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 448 | return r.error == simdutf::SUCCESS; | 277 | 448 | }); | 278 | 448 | return ret; | 279 | 448 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 225 | validation_result verify_valid_input(FromSpan src) const { | 231 | 225 | validation_result ret{}; | 232 | | | 233 | 225 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 225 | const auto implementations = get_supported_implementations(); | 235 | 225 | std::vector<simdutf::result> results; | 236 | 225 | results.reserve(implementations.size()); | 237 | | | 238 | 675 | for (auto impl : implementations) { | 239 | 675 | results.push_back( | 240 | 675 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 675 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 675 | const bool validation2 = | 245 | 675 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 675 | src.data(), src.size()); | 247 | 675 | 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 | 675 | } | 258 | | | 259 | 225 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 225 | 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 | 225 | } else { | 273 | 225 | ret.implementations_agree = true; | 274 | 225 | } | 275 | 225 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 225 | return r.error == simdutf::SUCCESS; | 277 | 225 | }); | 278 | 225 | return ret; | 279 | 225 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 468 | validation_result verify_valid_input(FromSpan src) const { | 231 | 468 | validation_result ret{}; | 232 | | | 233 | 468 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 468 | const auto implementations = get_supported_implementations(); | 235 | 468 | std::vector<simdutf::result> results; | 236 | 468 | results.reserve(implementations.size()); | 237 | | | 238 | 1.40k | for (auto impl : implementations) { | 239 | 1.40k | results.push_back( | 240 | 1.40k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.40k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.40k | const bool validation2 = | 245 | 1.40k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.40k | src.data(), src.size()); | 247 | 1.40k | 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.40k | } | 258 | | | 259 | 468 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 468 | 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 | 468 | } else { | 273 | 468 | ret.implementations_agree = true; | 274 | 468 | } | 275 | 468 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 468 | return r.error == simdutf::SUCCESS; | 277 | 468 | }); | 278 | 468 | return ret; | 279 | 468 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 311 | validation_result verify_valid_input(FromSpan src) const { | 231 | 311 | validation_result ret{}; | 232 | | | 233 | 311 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 311 | const auto implementations = get_supported_implementations(); | 235 | 311 | std::vector<simdutf::result> results; | 236 | 311 | results.reserve(implementations.size()); | 237 | | | 238 | 933 | for (auto impl : implementations) { | 239 | 933 | results.push_back( | 240 | 933 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 933 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 933 | const bool validation2 = | 245 | 933 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 933 | src.data(), src.size()); | 247 | 933 | 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 | 933 | } | 258 | | | 259 | 311 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 311 | 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 | 311 | } else { | 273 | 311 | ret.implementations_agree = true; | 274 | 311 | } | 275 | 311 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 311 | return r.error == simdutf::SUCCESS; | 277 | 311 | }); | 278 | 311 | return ret; | 279 | 311 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_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 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 446 | validation_result verify_valid_input(FromSpan src) const { | 231 | 446 | validation_result ret{}; | 232 | | | 233 | 446 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 446 | const auto implementations = get_supported_implementations(); | 235 | 446 | std::vector<simdutf::result> results; | 236 | 446 | results.reserve(implementations.size()); | 237 | | | 238 | 1.33k | for (auto impl : implementations) { | 239 | 1.33k | results.push_back( | 240 | 1.33k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.33k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.33k | const bool validation2 = | 245 | 1.33k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.33k | src.data(), src.size()); | 247 | 1.33k | 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.33k | } | 258 | | | 259 | 446 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 446 | 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 | 446 | } else { | 273 | 446 | ret.implementations_agree = true; | 274 | 446 | } | 275 | 446 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 446 | return r.error == simdutf::SUCCESS; | 277 | 446 | }); | 278 | 446 | return ret; | 279 | 446 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 612 | validation_result verify_valid_input(FromSpan src) const { | 231 | 612 | validation_result ret{}; | 232 | | | 233 | 612 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 612 | const auto implementations = get_supported_implementations(); | 235 | 612 | std::vector<simdutf::result> results; | 236 | 612 | results.reserve(implementations.size()); | 237 | | | 238 | 1.83k | for (auto impl : implementations) { | 239 | 1.83k | results.push_back( | 240 | 1.83k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.83k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.83k | const bool validation2 = | 245 | 1.83k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.83k | src.data(), src.size()); | 247 | 1.83k | 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.83k | } | 258 | | | 259 | 612 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 612 | 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 | 612 | } else { | 273 | 612 | ret.implementations_agree = true; | 274 | 612 | } | 275 | 612 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 612 | return r.error == simdutf::SUCCESS; | 277 | 612 | }); | 278 | 612 | return ret; | 279 | 612 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 610 | validation_result verify_valid_input(FromSpan src) const { | 231 | 610 | validation_result ret{}; | 232 | | | 233 | 610 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 610 | const auto implementations = get_supported_implementations(); | 235 | 610 | std::vector<simdutf::result> results; | 236 | 610 | results.reserve(implementations.size()); | 237 | | | 238 | 1.83k | for (auto impl : implementations) { | 239 | 1.83k | results.push_back( | 240 | 1.83k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.83k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.83k | const bool validation2 = | 245 | 1.83k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.83k | src.data(), src.size()); | 247 | 1.83k | 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.83k | } | 258 | | | 259 | 610 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 610 | 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 | 610 | } else { | 273 | 610 | ret.implementations_agree = true; | 274 | 610 | } | 275 | 610 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 610 | return r.error == simdutf::SUCCESS; | 277 | 610 | }); | 278 | 610 | return ret; | 279 | 610 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 626 | validation_result verify_valid_input(FromSpan src) const { | 231 | 626 | validation_result ret{}; | 232 | | | 233 | 626 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 626 | const auto implementations = get_supported_implementations(); | 235 | 626 | std::vector<simdutf::result> results; | 236 | 626 | results.reserve(implementations.size()); | 237 | | | 238 | 1.87k | for (auto impl : implementations) { | 239 | 1.87k | results.push_back( | 240 | 1.87k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.87k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.87k | const bool validation2 = | 245 | 1.87k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.87k | src.data(), src.size()); | 247 | 1.87k | 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.87k | } | 258 | | | 259 | 626 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 626 | 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 | 626 | } else { | 273 | 626 | ret.implementations_agree = true; | 274 | 626 | } | 275 | 626 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 626 | return r.error == simdutf::SUCCESS; | 277 | 626 | }); | 278 | 626 | return ret; | 279 | 626 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 46 | validation_result verify_valid_input(FromSpan src) const { | 231 | 46 | validation_result ret{}; | 232 | | | 233 | 46 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 46 | const auto implementations = get_supported_implementations(); | 235 | 46 | std::vector<simdutf::result> results; | 236 | 46 | results.reserve(implementations.size()); | 237 | | | 238 | 138 | for (auto impl : implementations) { | 239 | 138 | results.push_back( | 240 | 138 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 138 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 138 | const bool validation2 = | 245 | 138 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 138 | src.data(), src.size()); | 247 | 138 | 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 | 138 | } | 258 | | | 259 | 46 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 46 | 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 | 46 | } else { | 273 | 46 | ret.implementations_agree = true; | 274 | 46 | } | 275 | 46 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 46 | return r.error == simdutf::SUCCESS; | 277 | 46 | }); | 278 | 46 | return ret; | 279 | 46 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 87 | validation_result verify_valid_input(FromSpan src) const { | 231 | 87 | validation_result ret{}; | 232 | | | 233 | 87 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 87 | const auto implementations = get_supported_implementations(); | 235 | 87 | std::vector<simdutf::result> results; | 236 | 87 | results.reserve(implementations.size()); | 237 | | | 238 | 261 | for (auto impl : implementations) { | 239 | 261 | results.push_back( | 240 | 261 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 261 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 261 | const bool validation2 = | 245 | 261 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 261 | src.data(), src.size()); | 247 | 261 | 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 | 261 | } | 258 | | | 259 | 87 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 87 | 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 | 87 | } else { | 273 | 87 | ret.implementations_agree = true; | 274 | 87 | } | 275 | 87 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 87 | return r.error == simdutf::SUCCESS; | 277 | 87 | }); | 278 | 87 | return ret; | 279 | 87 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 88 | validation_result verify_valid_input(FromSpan src) const { | 231 | 88 | validation_result ret{}; | 232 | | | 233 | 88 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 88 | const auto implementations = get_supported_implementations(); | 235 | 88 | std::vector<simdutf::result> results; | 236 | 88 | results.reserve(implementations.size()); | 237 | | | 238 | 264 | for (auto impl : implementations) { | 239 | 264 | results.push_back( | 240 | 264 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 264 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 264 | const bool validation2 = | 245 | 264 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 264 | src.data(), src.size()); | 247 | 264 | 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 | 264 | } | 258 | | | 259 | 88 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 88 | 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 | 88 | } else { | 273 | 88 | ret.implementations_agree = true; | 274 | 88 | } | 275 | 88 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 88 | return r.error == simdutf::SUCCESS; | 277 | 88 | }); | 278 | 88 | return ret; | 279 | 88 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_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 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 115 | validation_result verify_valid_input(FromSpan src) const { | 231 | 115 | validation_result ret{}; | 232 | | | 233 | 115 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 115 | const auto implementations = get_supported_implementations(); | 235 | 115 | std::vector<simdutf::result> results; | 236 | 115 | results.reserve(implementations.size()); | 237 | | | 238 | 345 | for (auto impl : implementations) { | 239 | 345 | results.push_back( | 240 | 345 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 345 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 345 | const bool validation2 = | 245 | 345 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 345 | src.data(), src.size()); | 247 | 345 | 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 | 345 | } | 258 | | | 259 | 115 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 115 | 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 | 115 | } else { | 273 | 115 | ret.implementations_agree = true; | 274 | 115 | } | 275 | 115 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 115 | return r.error == simdutf::SUCCESS; | 277 | 115 | }); | 278 | 115 | return ret; | 279 | 115 | } |
_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 | 341 | validation_result verify_valid_input(FromSpan src) const { | 231 | 341 | validation_result ret{}; | 232 | | | 233 | 341 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 341 | const auto implementations = get_supported_implementations(); | 235 | 341 | std::vector<simdutf::result> results; | 236 | 341 | results.reserve(implementations.size()); | 237 | | | 238 | 1.02k | for (auto impl : implementations) { | 239 | 1.02k | results.push_back( | 240 | 1.02k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.02k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.02k | const bool validation2 = | 245 | 1.02k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.02k | src.data(), src.size()); | 247 | 1.02k | 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.02k | } | 258 | | | 259 | 341 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 341 | 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 | 341 | } else { | 273 | 341 | ret.implementations_agree = true; | 274 | 341 | } | 275 | 341 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 341 | return r.error == simdutf::SUCCESS; | 277 | 341 | }); | 278 | 341 | return ret; | 279 | 341 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 136 | validation_result verify_valid_input(FromSpan src) const { | 231 | 136 | validation_result ret{}; | 232 | | | 233 | 136 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 136 | const auto implementations = get_supported_implementations(); | 235 | 136 | std::vector<simdutf::result> results; | 236 | 136 | results.reserve(implementations.size()); | 237 | | | 238 | 408 | for (auto impl : implementations) { | 239 | 408 | results.push_back( | 240 | 408 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 408 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 408 | const bool validation2 = | 245 | 408 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 408 | src.data(), src.size()); | 247 | 408 | 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 | 408 | } | 258 | | | 259 | 136 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 136 | 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 | 136 | } else { | 273 | 136 | ret.implementations_agree = true; | 274 | 136 | } | 275 | 136 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 136 | return r.error == simdutf::SUCCESS; | 277 | 136 | }); | 278 | 136 | return ret; | 279 | 136 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 188 | validation_result verify_valid_input(FromSpan src) const { | 231 | 188 | validation_result ret{}; | 232 | | | 233 | 188 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 188 | const auto implementations = get_supported_implementations(); | 235 | 188 | std::vector<simdutf::result> results; | 236 | 188 | results.reserve(implementations.size()); | 237 | | | 238 | 564 | for (auto impl : implementations) { | 239 | 564 | results.push_back( | 240 | 564 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 564 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 564 | const bool validation2 = | 245 | 564 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 564 | src.data(), src.size()); | 247 | 564 | 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 | 564 | } | 258 | | | 259 | 188 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 188 | 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 | 188 | } else { | 273 | 188 | ret.implementations_agree = true; | 274 | 188 | } | 275 | 188 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 188 | return r.error == simdutf::SUCCESS; | 277 | 188 | }); | 278 | 188 | return ret; | 279 | 188 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 365 | validation_result verify_valid_input(FromSpan src) const { | 231 | 365 | validation_result ret{}; | 232 | | | 233 | 365 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 365 | const auto implementations = get_supported_implementations(); | 235 | 365 | std::vector<simdutf::result> results; | 236 | 365 | results.reserve(implementations.size()); | 237 | | | 238 | 1.09k | for (auto impl : implementations) { | 239 | 1.09k | results.push_back( | 240 | 1.09k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.09k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.09k | const bool validation2 = | 245 | 1.09k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.09k | src.data(), src.size()); | 247 | 1.09k | 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.09k | } | 258 | | | 259 | 365 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 365 | 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 | 365 | } else { | 273 | 365 | ret.implementations_agree = true; | 274 | 365 | } | 275 | 365 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 365 | return r.error == simdutf::SUCCESS; | 277 | 365 | }); | 278 | 365 | return ret; | 279 | 365 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 238 | validation_result verify_valid_input(FromSpan src) const { | 231 | 238 | validation_result ret{}; | 232 | | | 233 | 238 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 238 | const auto implementations = get_supported_implementations(); | 235 | 238 | std::vector<simdutf::result> results; | 236 | 238 | results.reserve(implementations.size()); | 237 | | | 238 | 714 | for (auto impl : implementations) { | 239 | 714 | results.push_back( | 240 | 714 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 714 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 714 | const bool validation2 = | 245 | 714 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 714 | src.data(), src.size()); | 247 | 714 | 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 | 714 | } | 258 | | | 259 | 238 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 238 | 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 | 238 | } else { | 273 | 238 | ret.implementations_agree = true; | 274 | 238 | } | 275 | 238 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 238 | return r.error == simdutf::SUCCESS; | 277 | 238 | }); | 278 | 238 | return ret; | 279 | 238 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 286 | validation_result verify_valid_input(FromSpan src) const { | 231 | 286 | validation_result ret{}; | 232 | | | 233 | 286 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 286 | const auto implementations = get_supported_implementations(); | 235 | 286 | std::vector<simdutf::result> results; | 236 | 286 | results.reserve(implementations.size()); | 237 | | | 238 | 858 | for (auto impl : implementations) { | 239 | 858 | results.push_back( | 240 | 858 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 858 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 858 | const bool validation2 = | 245 | 858 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 858 | src.data(), src.size()); | 247 | 858 | 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 | 858 | } | 258 | | | 259 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 286 | 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 | 286 | } else { | 273 | 286 | ret.implementations_agree = true; | 274 | 286 | } | 275 | 286 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 286 | return r.error == simdutf::SUCCESS; | 277 | 286 | }); | 278 | 286 | return ret; | 279 | 286 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 336 | validation_result verify_valid_input(FromSpan src) const { | 231 | 336 | validation_result ret{}; | 232 | | | 233 | 336 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 336 | const auto implementations = get_supported_implementations(); | 235 | 336 | std::vector<simdutf::result> results; | 236 | 336 | results.reserve(implementations.size()); | 237 | | | 238 | 1.00k | for (auto impl : implementations) { | 239 | 1.00k | results.push_back( | 240 | 1.00k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.00k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.00k | const bool validation2 = | 245 | 1.00k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.00k | src.data(), src.size()); | 247 | 1.00k | 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.00k | } | 258 | | | 259 | 336 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 336 | 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 | 336 | } else { | 273 | 336 | ret.implementations_agree = true; | 274 | 336 | } | 275 | 336 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 336 | return r.error == simdutf::SUCCESS; | 277 | 336 | }); | 278 | 336 | return ret; | 279 | 336 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 416 | validation_result verify_valid_input(FromSpan src) const { | 231 | 416 | validation_result ret{}; | 232 | | | 233 | 416 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 416 | const auto implementations = get_supported_implementations(); | 235 | 416 | std::vector<simdutf::result> results; | 236 | 416 | results.reserve(implementations.size()); | 237 | | | 238 | 1.24k | for (auto impl : implementations) { | 239 | 1.24k | results.push_back( | 240 | 1.24k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.24k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.24k | const bool validation2 = | 245 | 1.24k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.24k | src.data(), src.size()); | 247 | 1.24k | 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.24k | } | 258 | | | 259 | 416 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 416 | 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 | 416 | } else { | 273 | 416 | ret.implementations_agree = true; | 274 | 416 | } | 275 | 416 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 416 | return r.error == simdutf::SUCCESS; | 277 | 416 | }); | 278 | 416 | return ret; | 279 | 416 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 266 | validation_result verify_valid_input(FromSpan src) const { | 231 | 266 | validation_result ret{}; | 232 | | | 233 | 266 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 266 | const auto implementations = get_supported_implementations(); | 235 | 266 | std::vector<simdutf::result> results; | 236 | 266 | results.reserve(implementations.size()); | 237 | | | 238 | 798 | for (auto impl : implementations) { | 239 | 798 | results.push_back( | 240 | 798 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 798 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 798 | const bool validation2 = | 245 | 798 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 798 | src.data(), src.size()); | 247 | 798 | 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 | 798 | } | 258 | | | 259 | 266 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 266 | 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 | 266 | } else { | 273 | 266 | ret.implementations_agree = true; | 274 | 266 | } | 275 | 266 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 266 | return r.error == simdutf::SUCCESS; | 277 | 266 | }); | 278 | 266 | return ret; | 279 | 266 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 415 | validation_result verify_valid_input(FromSpan src) const { | 231 | 415 | validation_result ret{}; | 232 | | | 233 | 415 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 415 | const auto implementations = get_supported_implementations(); | 235 | 415 | std::vector<simdutf::result> results; | 236 | 415 | results.reserve(implementations.size()); | 237 | | | 238 | 1.24k | for (auto impl : implementations) { | 239 | 1.24k | results.push_back( | 240 | 1.24k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.24k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.24k | const bool validation2 = | 245 | 1.24k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.24k | src.data(), src.size()); | 247 | 1.24k | 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.24k | } | 258 | | | 259 | 415 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 415 | 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 | 415 | } else { | 273 | 415 | ret.implementations_agree = true; | 274 | 415 | } | 275 | 415 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 415 | return r.error == simdutf::SUCCESS; | 277 | 415 | }); | 278 | 415 | return ret; | 279 | 415 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 327 | validation_result verify_valid_input(FromSpan src) const { | 231 | 327 | validation_result ret{}; | 232 | | | 233 | 327 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 327 | const auto implementations = get_supported_implementations(); | 235 | 327 | std::vector<simdutf::result> results; | 236 | 327 | results.reserve(implementations.size()); | 237 | | | 238 | 981 | for (auto impl : implementations) { | 239 | 981 | results.push_back( | 240 | 981 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 981 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 981 | const bool validation2 = | 245 | 981 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 981 | src.data(), src.size()); | 247 | 981 | 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 | 981 | } | 258 | | | 259 | 327 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 327 | 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 | 327 | } else { | 273 | 327 | ret.implementations_agree = true; | 274 | 327 | } | 275 | 327 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 327 | return r.error == simdutf::SUCCESS; | 277 | 327 | }); | 278 | 327 | return ret; | 279 | 327 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 373 | validation_result verify_valid_input(FromSpan src) const { | 231 | 373 | validation_result ret{}; | 232 | | | 233 | 373 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 373 | const auto implementations = get_supported_implementations(); | 235 | 373 | std::vector<simdutf::result> results; | 236 | 373 | results.reserve(implementations.size()); | 237 | | | 238 | 1.11k | for (auto impl : implementations) { | 239 | 1.11k | results.push_back( | 240 | 1.11k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.11k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.11k | const bool validation2 = | 245 | 1.11k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.11k | src.data(), src.size()); | 247 | 1.11k | 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.11k | } | 258 | | | 259 | 373 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 373 | 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 | 373 | } else { | 273 | 373 | ret.implementations_agree = true; | 274 | 373 | } | 275 | 373 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 373 | return r.error == simdutf::SUCCESS; | 277 | 373 | }); | 278 | 373 | return ret; | 279 | 373 | } |
|
280 | | |
281 | | template <typename Dummy = void> |
282 | | requires(From == UtfEncodings::LATIN1) |
283 | 465 | validation_result verify_valid_input(FromSpan) const { |
284 | | // all latin1 input is valid. there is no simdutf validation function for |
285 | | // it. |
286 | 465 | return validation_result{.valid = true, .implementations_agree = true}; |
287 | 465 | } _ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 55 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 55 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 55 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 51 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 51 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 51 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 41 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 41 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 41 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 283 | 318 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 318 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 318 | } |
|
288 | | |
289 | 6.35k | bool count_the_input(FromSpan src) const { |
290 | 6.35k | const auto implementations = get_supported_implementations(); |
291 | 6.35k | std::vector<std::size_t> results; |
292 | 6.35k | results.reserve(implementations.size()); |
293 | | |
294 | 19.0k | for (auto impl : implementations) { |
295 | 19.0k | std::size_t ret; |
296 | 19.0k | if constexpr (From == UtfEncodings::UTF16BE) { |
297 | 4.10k | ret = impl->count_utf16be(src.data(), src.size()); |
298 | 4.40k | } else if constexpr (From == UtfEncodings::UTF16LE) { |
299 | 4.40k | ret = impl->count_utf16le(src.data(), src.size()); |
300 | 10.5k | } else if constexpr (From == UtfEncodings::UTF8) { |
301 | 10.5k | ret = impl->count_utf8(src.data(), src.size()); |
302 | 10.5k | } |
303 | 19.0k | results.push_back(ret); |
304 | 19.0k | } |
305 | 12.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&) constLine | Count | Source | 305 | 502 | 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&) constLine | Count | Source | 305 | 896 | 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&) constLine | Count | Source | 305 | 450 | 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&) constLine | Count | Source | 305 | 936 | 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&) constLine | Count | Source | 305 | 1.22k | 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&) constLine | Count | Source | 305 | 1.22k | 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&) constLine | Count | Source | 305 | 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>::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&) constLine | Count | Source | 305 | 92 | 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&) constLine | Count | Source | 305 | 174 | 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&) constLine | Count | Source | 305 | 570 | 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&) constLine | Count | Source | 305 | 230 | 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&) constLine | 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&) constLine | Count | Source | 305 | 682 | 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&) constLine | Count | Source | 305 | 272 | 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&) constLine | Count | Source | 305 | 376 | 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&) constLine | Count | Source | 305 | 730 | 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&) constLine | Count | Source | 305 | 532 | 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&) constLine | Count | Source | 305 | 830 | 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&) constLine | Count | Source | 305 | 654 | 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&) constLine | Count | Source | 305 | 746 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
306 | 6.35k | 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 | 6.35k | return true; |
321 | 6.35k | } 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 | 251 | bool count_the_input(FromSpan src) const { | 290 | 251 | const auto implementations = get_supported_implementations(); | 291 | 251 | std::vector<std::size_t> results; | 292 | 251 | results.reserve(implementations.size()); | 293 | | | 294 | 753 | for (auto impl : implementations) { | 295 | 753 | std::size_t ret; | 296 | 753 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 753 | 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 | 753 | results.push_back(ret); | 304 | 753 | } | 305 | 251 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 251 | 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 | 251 | return true; | 321 | 251 | } |
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 | 448 | bool count_the_input(FromSpan src) const { | 290 | 448 | const auto implementations = get_supported_implementations(); | 291 | 448 | std::vector<std::size_t> results; | 292 | 448 | results.reserve(implementations.size()); | 293 | | | 294 | 1.34k | for (auto impl : implementations) { | 295 | 1.34k | std::size_t ret; | 296 | 1.34k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.34k | 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.34k | results.push_back(ret); | 304 | 1.34k | } | 305 | 448 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 448 | 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 | 448 | return true; | 321 | 448 | } |
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 | 225 | bool count_the_input(FromSpan src) const { | 290 | 225 | const auto implementations = get_supported_implementations(); | 291 | 225 | std::vector<std::size_t> results; | 292 | 225 | results.reserve(implementations.size()); | 293 | | | 294 | 675 | for (auto impl : implementations) { | 295 | 675 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 675 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 675 | 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 | 675 | results.push_back(ret); | 304 | 675 | } | 305 | 225 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 225 | 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 | 225 | return true; | 321 | 225 | } |
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 | 468 | bool count_the_input(FromSpan src) const { | 290 | 468 | const auto implementations = get_supported_implementations(); | 291 | 468 | std::vector<std::size_t> results; | 292 | 468 | results.reserve(implementations.size()); | 293 | | | 294 | 1.40k | for (auto impl : implementations) { | 295 | 1.40k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.40k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.40k | 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.40k | results.push_back(ret); | 304 | 1.40k | } | 305 | 468 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 468 | 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 | 468 | return true; | 321 | 468 | } |
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 | 612 | bool count_the_input(FromSpan src) const { | 290 | 612 | const auto implementations = get_supported_implementations(); | 291 | 612 | std::vector<std::size_t> results; | 292 | 612 | results.reserve(implementations.size()); | 293 | | | 294 | 1.83k | for (auto impl : implementations) { | 295 | 1.83k | 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.83k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.83k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.83k | } | 303 | 1.83k | results.push_back(ret); | 304 | 1.83k | } | 305 | 612 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 612 | 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 | 612 | return true; | 321 | 612 | } |
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 | 610 | bool count_the_input(FromSpan src) const { | 290 | 610 | const auto implementations = get_supported_implementations(); | 291 | 610 | std::vector<std::size_t> results; | 292 | 610 | results.reserve(implementations.size()); | 293 | | | 294 | 1.83k | for (auto impl : implementations) { | 295 | 1.83k | 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.83k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.83k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.83k | } | 303 | 1.83k | results.push_back(ret); | 304 | 1.83k | } | 305 | 610 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 610 | 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 | 610 | return true; | 321 | 610 | } |
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 | 626 | bool count_the_input(FromSpan src) const { | 290 | 626 | const auto implementations = get_supported_implementations(); | 291 | 626 | std::vector<std::size_t> results; | 292 | 626 | results.reserve(implementations.size()); | 293 | | | 294 | 1.87k | for (auto impl : implementations) { | 295 | 1.87k | 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.87k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.87k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.87k | } | 303 | 1.87k | results.push_back(ret); | 304 | 1.87k | } | 305 | 626 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 626 | 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 | 626 | return true; | 321 | 626 | } |
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 | 46 | bool count_the_input(FromSpan src) const { | 290 | 46 | const auto implementations = get_supported_implementations(); | 291 | 46 | std::vector<std::size_t> results; | 292 | 46 | results.reserve(implementations.size()); | 293 | | | 294 | 138 | for (auto impl : implementations) { | 295 | 138 | std::size_t ret; | 296 | 138 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 138 | 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 | 138 | results.push_back(ret); | 304 | 138 | } | 305 | 46 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 46 | 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 | 46 | return true; | 321 | 46 | } |
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 | 87 | bool count_the_input(FromSpan src) const { | 290 | 87 | const auto implementations = get_supported_implementations(); | 291 | 87 | std::vector<std::size_t> results; | 292 | 87 | results.reserve(implementations.size()); | 293 | | | 294 | 261 | for (auto impl : implementations) { | 295 | 261 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 261 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 261 | 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 | 261 | results.push_back(ret); | 304 | 261 | } | 305 | 87 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 87 | 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 | 87 | return true; | 321 | 87 | } |
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 | 285 | bool count_the_input(FromSpan src) const { | 290 | 285 | const auto implementations = get_supported_implementations(); | 291 | 285 | std::vector<std::size_t> results; | 292 | 285 | results.reserve(implementations.size()); | 293 | | | 294 | 855 | for (auto impl : implementations) { | 295 | 855 | 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 | 855 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 855 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 855 | } | 303 | 855 | results.push_back(ret); | 304 | 855 | } | 305 | 285 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 285 | 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 | 285 | return true; | 321 | 285 | } |
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 | 115 | bool count_the_input(FromSpan src) const { | 290 | 115 | const auto implementations = get_supported_implementations(); | 291 | 115 | std::vector<std::size_t> results; | 292 | 115 | results.reserve(implementations.size()); | 293 | | | 294 | 345 | for (auto impl : implementations) { | 295 | 345 | std::size_t ret; | 296 | 345 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 345 | 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 | 345 | results.push_back(ret); | 304 | 345 | } | 305 | 115 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 115 | 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 | 115 | return true; | 321 | 115 | } |
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 | 341 | bool count_the_input(FromSpan src) const { | 290 | 341 | const auto implementations = get_supported_implementations(); | 291 | 341 | std::vector<std::size_t> results; | 292 | 341 | results.reserve(implementations.size()); | 293 | | | 294 | 1.02k | for (auto impl : implementations) { | 295 | 1.02k | std::size_t ret; | 296 | 1.02k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.02k | 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.02k | results.push_back(ret); | 304 | 1.02k | } | 305 | 341 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 341 | 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 | 341 | return true; | 321 | 341 | } |
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 | 136 | bool count_the_input(FromSpan src) const { | 290 | 136 | const auto implementations = get_supported_implementations(); | 291 | 136 | std::vector<std::size_t> results; | 292 | 136 | results.reserve(implementations.size()); | 293 | | | 294 | 408 | for (auto impl : implementations) { | 295 | 408 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 408 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 408 | 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 | 408 | results.push_back(ret); | 304 | 408 | } | 305 | 136 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 136 | 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 | 136 | return true; | 321 | 136 | } |
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 | 188 | bool count_the_input(FromSpan src) const { | 290 | 188 | const auto implementations = get_supported_implementations(); | 291 | 188 | std::vector<std::size_t> results; | 292 | 188 | results.reserve(implementations.size()); | 293 | | | 294 | 564 | for (auto impl : implementations) { | 295 | 564 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 564 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 564 | 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 | 564 | results.push_back(ret); | 304 | 564 | } | 305 | 188 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 188 | 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 | 188 | return true; | 321 | 188 | } |
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 | 365 | bool count_the_input(FromSpan src) const { | 290 | 365 | const auto implementations = get_supported_implementations(); | 291 | 365 | std::vector<std::size_t> results; | 292 | 365 | results.reserve(implementations.size()); | 293 | | | 294 | 1.09k | for (auto impl : implementations) { | 295 | 1.09k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.09k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.09k | 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.09k | results.push_back(ret); | 304 | 1.09k | } | 305 | 365 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 365 | 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 | 365 | return true; | 321 | 365 | } |
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 | 266 | bool count_the_input(FromSpan src) const { | 290 | 266 | const auto implementations = get_supported_implementations(); | 291 | 266 | std::vector<std::size_t> results; | 292 | 266 | results.reserve(implementations.size()); | 293 | | | 294 | 798 | for (auto impl : implementations) { | 295 | 798 | 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 | 798 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 798 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 798 | } | 303 | 798 | results.push_back(ret); | 304 | 798 | } | 305 | 266 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 266 | 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 | 266 | return true; | 321 | 266 | } |
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 | 415 | bool count_the_input(FromSpan src) const { | 290 | 415 | const auto implementations = get_supported_implementations(); | 291 | 415 | std::vector<std::size_t> results; | 292 | 415 | results.reserve(implementations.size()); | 293 | | | 294 | 1.24k | for (auto impl : implementations) { | 295 | 1.24k | 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.24k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.24k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.24k | } | 303 | 1.24k | results.push_back(ret); | 304 | 1.24k | } | 305 | 415 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 415 | 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 | 415 | return true; | 321 | 415 | } |
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 | 327 | bool count_the_input(FromSpan src) const { | 290 | 327 | const auto implementations = get_supported_implementations(); | 291 | 327 | std::vector<std::size_t> results; | 292 | 327 | results.reserve(implementations.size()); | 293 | | | 294 | 981 | for (auto impl : implementations) { | 295 | 981 | 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 | 981 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 981 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 981 | } | 303 | 981 | results.push_back(ret); | 304 | 981 | } | 305 | 327 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 327 | 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 | 327 | return true; | 321 | 327 | } |
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 | 373 | bool count_the_input(FromSpan src) const { | 290 | 373 | const auto implementations = get_supported_implementations(); | 291 | 373 | std::vector<std::size_t> results; | 292 | 373 | results.reserve(implementations.size()); | 293 | | | 294 | 1.11k | for (auto impl : implementations) { | 295 | 1.11k | 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.11k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.11k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.11k | } | 303 | 1.11k | results.push_back(ret); | 304 | 1.11k | } | 305 | 373 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 373 | 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 | 373 | return true; | 321 | 373 | } |
|
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 | 25.3k | FromSpan src) const { |
331 | 25.3k | return std::invoke(lengthcalc, impl, src.data(), src.size()); |
332 | 25.3k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 753 | FromSpan src) const { | 331 | 753 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 753 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.34k | FromSpan src) const { | 331 | 1.34k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.34k | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 675 | FromSpan src) const { | 331 | 675 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 675 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.40k | FromSpan src) const { | 331 | 1.40k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.40k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 933 | FromSpan src) const { | 331 | 933 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 933 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_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 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.33k | FromSpan src) const { | 331 | 1.33k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.33k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.83k | FromSpan src) const { | 331 | 1.83k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.83k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.83k | FromSpan src) const { | 331 | 1.83k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.83k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.87k | FromSpan src) const { | 331 | 1.87k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.87k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 855 | FromSpan src) const { | 331 | 855 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 855 | } |
_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.02k | FromSpan src) const { | 331 | 1.02k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.02k | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 564 | FromSpan src) const { | 331 | 564 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 564 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.09k | FromSpan src) const { | 331 | 1.09k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.09k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 858 | FromSpan src) const { | 331 | 858 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 858 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.00k | FromSpan src) const { | 331 | 1.00k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.00k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.24k | FromSpan src) const { | 331 | 1.24k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.24k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 798 | FromSpan src) const { | 331 | 798 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 798 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.24k | FromSpan src) const { | 331 | 1.24k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.24k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 981 | FromSpan src) const { | 331 | 981 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 981 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.11k | FromSpan src) const { | 331 | 1.11k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.11k | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 954 | FromSpan src) const { | 331 | 954 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 954 | } |
|
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.57k | FromSpan src) const { |
339 | 2.57k | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); |
340 | 2.57k | } _ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 138 | FromSpan src) const { | 339 | 138 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 138 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 261 | FromSpan src) const { | 339 | 261 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 261 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 264 | FromSpan src) const { | 339 | 264 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 264 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 345 | FromSpan src) const { | 339 | 345 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 345 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 408 | FromSpan src) const { | 339 | 408 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 408 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 714 | FromSpan src) const { | 339 | 714 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 714 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 165 | FromSpan src) const { | 339 | 165 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 165 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 153 | FromSpan src) const { | 339 | 153 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 153 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 123 | FromSpan src) const { | 339 | 123 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 123 | } |
|
341 | | |
342 | 9.31k | length_result calculate_length(FromSpan src, const bool inputisvalid) const { |
343 | 9.31k | length_result ret{}; |
344 | | |
345 | 9.31k | const auto implementations = get_supported_implementations(); |
346 | 9.31k | std::vector<std::size_t> results; |
347 | 9.31k | results.reserve(implementations.size()); |
348 | | |
349 | 27.9k | for (auto impl : implementations) { |
350 | 27.9k | const auto len = invoke_lengthcalc(impl, src); |
351 | 27.9k | results.push_back(len); |
352 | 27.9k | ret.length.push_back(len); |
353 | 27.9k | } |
354 | | |
355 | 18.6k | 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&) constLine | Count | Source | 355 | 502 | 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&) constLine | Count | Source | 355 | 896 | 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&) constLine | Count | Source | 355 | 450 | 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&) constLine | Count | Source | 355 | 936 | 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&) constLine | Count | Source | 355 | 622 | 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&) constLine | Count | Source | 355 | 752 | 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&) constLine | Count | Source | 355 | 892 | 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&) constLine | Count | Source | 355 | 1.22k | 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&) constLine | Count | Source | 355 | 1.22k | 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&) constLine | Count | Source | 355 | 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>::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&) constLine | Count | Source | 355 | 92 | 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&) constLine | Count | Source | 355 | 174 | 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&) constLine | Count | Source | 355 | 176 | 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&) constLine | Count | Source | 355 | 570 | 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&) constLine | Count | Source | 355 | 230 | 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&) constLine | 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&) constLine | Count | Source | 355 | 682 | 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&) constLine | Count | Source | 355 | 272 | 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&) constLine | Count | Source | 355 | 376 | 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&) constLine | Count | Source | 355 | 730 | 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&) constLine | Count | Source | 355 | 476 | 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&) constLine | Count | Source | 355 | 572 | 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&) constLine | Count | Source | 355 | 672 | 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&) constLine | Count | Source | 355 | 832 | 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&) constLine | Count | Source | 355 | 532 | 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&) constLine | Count | Source | 355 | 830 | 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&) constLine | Count | Source | 355 | 654 | 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&) constLine | Count | Source | 355 | 746 | 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&) constLine | Count | Source | 355 | 110 | 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&) constLine | Count | Source | 355 | 102 | 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&) constLine | Count | Source | 355 | 82 | 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&) constLine | Count | Source | 355 | 636 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
356 | 9.31k | 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 | << "implementations are allowed to disagree on invalid input\n"; |
372 | 0 | ret.implementations_agree = true; |
373 | 0 | } |
374 | 9.31k | } else { |
375 | 9.31k | ret.implementations_agree = true; |
376 | 9.31k | } |
377 | 9.31k | return ret; |
378 | 9.31k | } 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 | 251 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 251 | length_result ret{}; | 344 | | | 345 | 251 | const auto implementations = get_supported_implementations(); | 346 | 251 | std::vector<std::size_t> results; | 347 | 251 | results.reserve(implementations.size()); | 348 | | | 349 | 753 | for (auto impl : implementations) { | 350 | 753 | const auto len = invoke_lengthcalc(impl, src); | 351 | 753 | results.push_back(len); | 352 | 753 | ret.length.push_back(len); | 353 | 753 | } | 354 | | | 355 | 251 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 251 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 251 | } else { | 375 | 251 | ret.implementations_agree = true; | 376 | 251 | } | 377 | 251 | return ret; | 378 | 251 | } |
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 | 448 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 448 | length_result ret{}; | 344 | | | 345 | 448 | const auto implementations = get_supported_implementations(); | 346 | 448 | std::vector<std::size_t> results; | 347 | 448 | results.reserve(implementations.size()); | 348 | | | 349 | 1.34k | for (auto impl : implementations) { | 350 | 1.34k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.34k | results.push_back(len); | 352 | 1.34k | ret.length.push_back(len); | 353 | 1.34k | } | 354 | | | 355 | 448 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 448 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 448 | } else { | 375 | 448 | ret.implementations_agree = true; | 376 | 448 | } | 377 | 448 | return ret; | 378 | 448 | } |
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 | 225 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 225 | length_result ret{}; | 344 | | | 345 | 225 | const auto implementations = get_supported_implementations(); | 346 | 225 | std::vector<std::size_t> results; | 347 | 225 | results.reserve(implementations.size()); | 348 | | | 349 | 675 | for (auto impl : implementations) { | 350 | 675 | const auto len = invoke_lengthcalc(impl, src); | 351 | 675 | results.push_back(len); | 352 | 675 | ret.length.push_back(len); | 353 | 675 | } | 354 | | | 355 | 225 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 225 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 225 | } else { | 375 | 225 | ret.implementations_agree = true; | 376 | 225 | } | 377 | 225 | return ret; | 378 | 225 | } |
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 | 468 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 468 | length_result ret{}; | 344 | | | 345 | 468 | const auto implementations = get_supported_implementations(); | 346 | 468 | std::vector<std::size_t> results; | 347 | 468 | results.reserve(implementations.size()); | 348 | | | 349 | 1.40k | for (auto impl : implementations) { | 350 | 1.40k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.40k | results.push_back(len); | 352 | 1.40k | ret.length.push_back(len); | 353 | 1.40k | } | 354 | | | 355 | 468 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 468 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 468 | } else { | 375 | 468 | ret.implementations_agree = true; | 376 | 468 | } | 377 | 468 | return ret; | 378 | 468 | } |
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 | 311 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 311 | length_result ret{}; | 344 | | | 345 | 311 | const auto implementations = get_supported_implementations(); | 346 | 311 | std::vector<std::size_t> results; | 347 | 311 | results.reserve(implementations.size()); | 348 | | | 349 | 933 | for (auto impl : implementations) { | 350 | 933 | const auto len = invoke_lengthcalc(impl, src); | 351 | 933 | results.push_back(len); | 352 | 933 | ret.length.push_back(len); | 353 | 933 | } | 354 | | | 355 | 311 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 311 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 311 | } else { | 375 | 311 | ret.implementations_agree = true; | 376 | 311 | } | 377 | 311 | return ret; | 378 | 311 | } |
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 | 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 | << "implementations 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)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 | 446 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 446 | length_result ret{}; | 344 | | | 345 | 446 | const auto implementations = get_supported_implementations(); | 346 | 446 | std::vector<std::size_t> results; | 347 | 446 | results.reserve(implementations.size()); | 348 | | | 349 | 1.33k | for (auto impl : implementations) { | 350 | 1.33k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.33k | results.push_back(len); | 352 | 1.33k | ret.length.push_back(len); | 353 | 1.33k | } | 354 | | | 355 | 446 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 446 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 446 | } else { | 375 | 446 | ret.implementations_agree = true; | 376 | 446 | } | 377 | 446 | return ret; | 378 | 446 | } |
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 | 612 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 612 | length_result ret{}; | 344 | | | 345 | 612 | const auto implementations = get_supported_implementations(); | 346 | 612 | std::vector<std::size_t> results; | 347 | 612 | results.reserve(implementations.size()); | 348 | | | 349 | 1.83k | for (auto impl : implementations) { | 350 | 1.83k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.83k | results.push_back(len); | 352 | 1.83k | ret.length.push_back(len); | 353 | 1.83k | } | 354 | | | 355 | 612 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 612 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 612 | } else { | 375 | 612 | ret.implementations_agree = true; | 376 | 612 | } | 377 | 612 | return ret; | 378 | 612 | } |
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 | 610 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 610 | length_result ret{}; | 344 | | | 345 | 610 | const auto implementations = get_supported_implementations(); | 346 | 610 | std::vector<std::size_t> results; | 347 | 610 | results.reserve(implementations.size()); | 348 | | | 349 | 1.83k | for (auto impl : implementations) { | 350 | 1.83k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.83k | results.push_back(len); | 352 | 1.83k | ret.length.push_back(len); | 353 | 1.83k | } | 354 | | | 355 | 610 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 610 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 610 | } else { | 375 | 610 | ret.implementations_agree = true; | 376 | 610 | } | 377 | 610 | return ret; | 378 | 610 | } |
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 | 626 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 626 | length_result ret{}; | 344 | | | 345 | 626 | const auto implementations = get_supported_implementations(); | 346 | 626 | std::vector<std::size_t> results; | 347 | 626 | results.reserve(implementations.size()); | 348 | | | 349 | 1.87k | for (auto impl : implementations) { | 350 | 1.87k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.87k | results.push_back(len); | 352 | 1.87k | ret.length.push_back(len); | 353 | 1.87k | } | 354 | | | 355 | 626 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 626 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 626 | } else { | 375 | 626 | ret.implementations_agree = true; | 376 | 626 | } | 377 | 626 | return ret; | 378 | 626 | } |
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 | 46 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 46 | length_result ret{}; | 344 | | | 345 | 46 | const auto implementations = get_supported_implementations(); | 346 | 46 | std::vector<std::size_t> results; | 347 | 46 | results.reserve(implementations.size()); | 348 | | | 349 | 138 | for (auto impl : implementations) { | 350 | 138 | const auto len = invoke_lengthcalc(impl, src); | 351 | 138 | results.push_back(len); | 352 | 138 | ret.length.push_back(len); | 353 | 138 | } | 354 | | | 355 | 46 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 46 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 46 | } else { | 375 | 46 | ret.implementations_agree = true; | 376 | 46 | } | 377 | 46 | return ret; | 378 | 46 | } |
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 | 87 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 87 | length_result ret{}; | 344 | | | 345 | 87 | const auto implementations = get_supported_implementations(); | 346 | 87 | std::vector<std::size_t> results; | 347 | 87 | results.reserve(implementations.size()); | 348 | | | 349 | 261 | for (auto impl : implementations) { | 350 | 261 | const auto len = invoke_lengthcalc(impl, src); | 351 | 261 | results.push_back(len); | 352 | 261 | ret.length.push_back(len); | 353 | 261 | } | 354 | | | 355 | 87 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 87 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 87 | } else { | 375 | 87 | ret.implementations_agree = true; | 376 | 87 | } | 377 | 87 | return ret; | 378 | 87 | } |
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 | 88 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 88 | length_result ret{}; | 344 | | | 345 | 88 | const auto implementations = get_supported_implementations(); | 346 | 88 | std::vector<std::size_t> results; | 347 | 88 | results.reserve(implementations.size()); | 348 | | | 349 | 264 | for (auto impl : implementations) { | 350 | 264 | const auto len = invoke_lengthcalc(impl, src); | 351 | 264 | results.push_back(len); | 352 | 264 | ret.length.push_back(len); | 353 | 264 | } | 354 | | | 355 | 88 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 88 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 88 | } else { | 375 | 88 | ret.implementations_agree = true; | 376 | 88 | } | 377 | 88 | return ret; | 378 | 88 | } |
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 | 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 | << "implementations 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)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 | 115 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 115 | length_result ret{}; | 344 | | | 345 | 115 | const auto implementations = get_supported_implementations(); | 346 | 115 | std::vector<std::size_t> results; | 347 | 115 | results.reserve(implementations.size()); | 348 | | | 349 | 345 | for (auto impl : implementations) { | 350 | 345 | const auto len = invoke_lengthcalc(impl, src); | 351 | 345 | results.push_back(len); | 352 | 345 | ret.length.push_back(len); | 353 | 345 | } | 354 | | | 355 | 115 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 115 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 115 | } else { | 375 | 115 | ret.implementations_agree = true; | 376 | 115 | } | 377 | 115 | return ret; | 378 | 115 | } |
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 | << "implementations 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 | 341 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 341 | length_result ret{}; | 344 | | | 345 | 341 | const auto implementations = get_supported_implementations(); | 346 | 341 | std::vector<std::size_t> results; | 347 | 341 | results.reserve(implementations.size()); | 348 | | | 349 | 1.02k | for (auto impl : implementations) { | 350 | 1.02k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.02k | results.push_back(len); | 352 | 1.02k | ret.length.push_back(len); | 353 | 1.02k | } | 354 | | | 355 | 341 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 341 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 341 | } else { | 375 | 341 | ret.implementations_agree = true; | 376 | 341 | } | 377 | 341 | return ret; | 378 | 341 | } |
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 | 136 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 136 | length_result ret{}; | 344 | | | 345 | 136 | const auto implementations = get_supported_implementations(); | 346 | 136 | std::vector<std::size_t> results; | 347 | 136 | results.reserve(implementations.size()); | 348 | | | 349 | 408 | for (auto impl : implementations) { | 350 | 408 | const auto len = invoke_lengthcalc(impl, src); | 351 | 408 | results.push_back(len); | 352 | 408 | ret.length.push_back(len); | 353 | 408 | } | 354 | | | 355 | 136 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 136 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 136 | } else { | 375 | 136 | ret.implementations_agree = true; | 376 | 136 | } | 377 | 136 | return ret; | 378 | 136 | } |
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 | 188 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 188 | length_result ret{}; | 344 | | | 345 | 188 | const auto implementations = get_supported_implementations(); | 346 | 188 | std::vector<std::size_t> results; | 347 | 188 | results.reserve(implementations.size()); | 348 | | | 349 | 564 | for (auto impl : implementations) { | 350 | 564 | const auto len = invoke_lengthcalc(impl, src); | 351 | 564 | results.push_back(len); | 352 | 564 | ret.length.push_back(len); | 353 | 564 | } | 354 | | | 355 | 188 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 188 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 188 | } else { | 375 | 188 | ret.implementations_agree = true; | 376 | 188 | } | 377 | 188 | return ret; | 378 | 188 | } |
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 | 365 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 365 | length_result ret{}; | 344 | | | 345 | 365 | const auto implementations = get_supported_implementations(); | 346 | 365 | std::vector<std::size_t> results; | 347 | 365 | results.reserve(implementations.size()); | 348 | | | 349 | 1.09k | for (auto impl : implementations) { | 350 | 1.09k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.09k | results.push_back(len); | 352 | 1.09k | ret.length.push_back(len); | 353 | 1.09k | } | 354 | | | 355 | 365 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 365 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 365 | } else { | 375 | 365 | ret.implementations_agree = true; | 376 | 365 | } | 377 | 365 | return ret; | 378 | 365 | } |
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 | 238 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 238 | length_result ret{}; | 344 | | | 345 | 238 | const auto implementations = get_supported_implementations(); | 346 | 238 | std::vector<std::size_t> results; | 347 | 238 | results.reserve(implementations.size()); | 348 | | | 349 | 714 | for (auto impl : implementations) { | 350 | 714 | const auto len = invoke_lengthcalc(impl, src); | 351 | 714 | results.push_back(len); | 352 | 714 | ret.length.push_back(len); | 353 | 714 | } | 354 | | | 355 | 238 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 238 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 238 | } else { | 375 | 238 | ret.implementations_agree = true; | 376 | 238 | } | 377 | 238 | return ret; | 378 | 238 | } |
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 | 286 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 286 | length_result ret{}; | 344 | | | 345 | 286 | const auto implementations = get_supported_implementations(); | 346 | 286 | std::vector<std::size_t> results; | 347 | 286 | results.reserve(implementations.size()); | 348 | | | 349 | 858 | for (auto impl : implementations) { | 350 | 858 | const auto len = invoke_lengthcalc(impl, src); | 351 | 858 | results.push_back(len); | 352 | 858 | ret.length.push_back(len); | 353 | 858 | } | 354 | | | 355 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 286 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 286 | } else { | 375 | 286 | ret.implementations_agree = true; | 376 | 286 | } | 377 | 286 | return ret; | 378 | 286 | } |
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 | 336 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 336 | length_result ret{}; | 344 | | | 345 | 336 | const auto implementations = get_supported_implementations(); | 346 | 336 | std::vector<std::size_t> results; | 347 | 336 | results.reserve(implementations.size()); | 348 | | | 349 | 1.00k | for (auto impl : implementations) { | 350 | 1.00k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.00k | results.push_back(len); | 352 | 1.00k | ret.length.push_back(len); | 353 | 1.00k | } | 354 | | | 355 | 336 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 336 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 336 | } else { | 375 | 336 | ret.implementations_agree = true; | 376 | 336 | } | 377 | 336 | return ret; | 378 | 336 | } |
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 | 416 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 416 | length_result ret{}; | 344 | | | 345 | 416 | const auto implementations = get_supported_implementations(); | 346 | 416 | std::vector<std::size_t> results; | 347 | 416 | results.reserve(implementations.size()); | 348 | | | 349 | 1.24k | for (auto impl : implementations) { | 350 | 1.24k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.24k | results.push_back(len); | 352 | 1.24k | ret.length.push_back(len); | 353 | 1.24k | } | 354 | | | 355 | 416 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 416 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 416 | } else { | 375 | 416 | ret.implementations_agree = true; | 376 | 416 | } | 377 | 416 | return ret; | 378 | 416 | } |
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 | 266 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 266 | length_result ret{}; | 344 | | | 345 | 266 | const auto implementations = get_supported_implementations(); | 346 | 266 | std::vector<std::size_t> results; | 347 | 266 | results.reserve(implementations.size()); | 348 | | | 349 | 798 | for (auto impl : implementations) { | 350 | 798 | const auto len = invoke_lengthcalc(impl, src); | 351 | 798 | results.push_back(len); | 352 | 798 | ret.length.push_back(len); | 353 | 798 | } | 354 | | | 355 | 266 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 266 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 266 | } else { | 375 | 266 | ret.implementations_agree = true; | 376 | 266 | } | 377 | 266 | return ret; | 378 | 266 | } |
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 | 415 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 415 | length_result ret{}; | 344 | | | 345 | 415 | const auto implementations = get_supported_implementations(); | 346 | 415 | std::vector<std::size_t> results; | 347 | 415 | results.reserve(implementations.size()); | 348 | | | 349 | 1.24k | for (auto impl : implementations) { | 350 | 1.24k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.24k | results.push_back(len); | 352 | 1.24k | ret.length.push_back(len); | 353 | 1.24k | } | 354 | | | 355 | 415 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 415 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 415 | } else { | 375 | 415 | ret.implementations_agree = true; | 376 | 415 | } | 377 | 415 | return ret; | 378 | 415 | } |
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 | 327 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 327 | length_result ret{}; | 344 | | | 345 | 327 | const auto implementations = get_supported_implementations(); | 346 | 327 | std::vector<std::size_t> results; | 347 | 327 | results.reserve(implementations.size()); | 348 | | | 349 | 981 | for (auto impl : implementations) { | 350 | 981 | const auto len = invoke_lengthcalc(impl, src); | 351 | 981 | results.push_back(len); | 352 | 981 | ret.length.push_back(len); | 353 | 981 | } | 354 | | | 355 | 327 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 327 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 327 | } else { | 375 | 327 | ret.implementations_agree = true; | 376 | 327 | } | 377 | 327 | return ret; | 378 | 327 | } |
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 | 373 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 373 | length_result ret{}; | 344 | | | 345 | 373 | const auto implementations = get_supported_implementations(); | 346 | 373 | std::vector<std::size_t> results; | 347 | 373 | results.reserve(implementations.size()); | 348 | | | 349 | 1.11k | for (auto impl : implementations) { | 350 | 1.11k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.11k | results.push_back(len); | 352 | 1.11k | ret.length.push_back(len); | 353 | 1.11k | } | 354 | | | 355 | 373 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 373 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 373 | } else { | 375 | 373 | ret.implementations_agree = true; | 376 | 373 | } | 377 | 373 | return ret; | 378 | 373 | } |
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 | 55 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 55 | length_result ret{}; | 344 | | | 345 | 55 | const auto implementations = get_supported_implementations(); | 346 | 55 | std::vector<std::size_t> results; | 347 | 55 | results.reserve(implementations.size()); | 348 | | | 349 | 165 | for (auto impl : implementations) { | 350 | 165 | const auto len = invoke_lengthcalc(impl, src); | 351 | 165 | results.push_back(len); | 352 | 165 | ret.length.push_back(len); | 353 | 165 | } | 354 | | | 355 | 55 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 55 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 55 | } else { | 375 | 55 | ret.implementations_agree = true; | 376 | 55 | } | 377 | 55 | return ret; | 378 | 55 | } |
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 | 51 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 51 | length_result ret{}; | 344 | | | 345 | 51 | const auto implementations = get_supported_implementations(); | 346 | 51 | std::vector<std::size_t> results; | 347 | 51 | results.reserve(implementations.size()); | 348 | | | 349 | 153 | for (auto impl : implementations) { | 350 | 153 | const auto len = invoke_lengthcalc(impl, src); | 351 | 153 | results.push_back(len); | 352 | 153 | ret.length.push_back(len); | 353 | 153 | } | 354 | | | 355 | 51 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 51 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 51 | } else { | 375 | 51 | ret.implementations_agree = true; | 376 | 51 | } | 377 | 51 | return ret; | 378 | 51 | } |
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 | 41 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 41 | length_result ret{}; | 344 | | | 345 | 41 | const auto implementations = get_supported_implementations(); | 346 | 41 | std::vector<std::size_t> results; | 347 | 41 | results.reserve(implementations.size()); | 348 | | | 349 | 123 | for (auto impl : implementations) { | 350 | 123 | const auto len = invoke_lengthcalc(impl, src); | 351 | 123 | results.push_back(len); | 352 | 123 | ret.length.push_back(len); | 353 | 123 | } | 354 | | | 355 | 41 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 41 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 41 | } else { | 375 | 41 | ret.implementations_agree = true; | 376 | 41 | } | 377 | 41 | return ret; | 378 | 41 | } |
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 | 318 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 318 | length_result ret{}; | 344 | | | 345 | 318 | const auto implementations = get_supported_implementations(); | 346 | 318 | std::vector<std::size_t> results; | 347 | 318 | results.reserve(implementations.size()); | 348 | | | 349 | 954 | for (auto impl : implementations) { | 350 | 954 | const auto len = invoke_lengthcalc(impl, src); | 351 | 954 | results.push_back(len); | 352 | 954 | ret.length.push_back(len); | 353 | 954 | } | 354 | | | 355 | 318 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 318 | 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 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 318 | } else { | 375 | 318 | ret.implementations_agree = true; | 376 | 318 | } | 377 | 318 | return ret; | 378 | 318 | } |
|
379 | | |
380 | | conversion_result do_conversion(FromSpan src, |
381 | | const std::vector<std::size_t>& outlength, |
382 | 9.21k | const bool inputisvalid) const { |
383 | 9.21k | conversion_result ret{}; |
384 | | |
385 | 9.21k | const auto implementations = get_supported_implementations(); |
386 | | |
387 | 9.21k | std::vector<result<ConversionResult>> results; |
388 | 9.21k | results.reserve(implementations.size()); |
389 | | |
390 | | // put the output in a separate allocation to make access violations easier |
391 | | // to catch |
392 | 9.21k | std::vector<std::vector<ToType>> outputbuffers; |
393 | 9.21k | outputbuffers.reserve(implementations.size()); |
394 | 36.8k | for (std::size_t i = 0; i < implementations.size(); ++i) { |
395 | 27.6k | auto impl = implementations[i]; |
396 | 27.6k | const ToType canary1{42}; |
397 | 27.6k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); |
398 | 27.6k | const auto implret1 = std::invoke(conversion, impl, src.data(), |
399 | 27.6k | src.size(), outputbuffer.data()); |
400 | | // was the conversion successful? |
401 | 27.6k | const auto success = [](const ConversionResult& r) -> bool { |
402 | 27.6k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { |
403 | 15.7k | return r != 0; |
404 | 15.7k | } else { |
405 | 11.9k | return r.error == simdutf::error_code::SUCCESS; |
406 | 11.9k | } |
407 | 27.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&) constLine | Count | Source | 401 | 690 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 690 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 690 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 690 | }(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&) constLine | Count | Source | 401 | 1.30k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.30k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.30k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.30k | }(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&) constLine | Count | Source | 401 | 663 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 663 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 663 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 663 | }(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&) constLine | Count | Source | 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 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.35k | }(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&) constLine | Count | Source | 401 | 906 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 906 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 906 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 906 | }(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&) constLine | Count | Source | 401 | 1.11k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.11k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.11k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.11k | }(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&) constLine | Count | Source | 401 | 1.32k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.32k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.32k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.32k | }(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&) constLine | Count | Source | 401 | 1.82k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.82k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.82k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.82k | }(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&) constLine | Count | Source | 401 | 1.81k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.81k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.81k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.81k | }(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&) constLine | Count | Source | 401 | 1.84k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.84k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.84k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.84k | }(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&) constLine | Count | Source | 401 | 138 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 138 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 138 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 138 | }(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&) constLine | Count | Source | 401 | 261 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 261 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 261 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 261 | }(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&) constLine | Count | Source | 401 | 264 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 264 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 264 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 264 | }(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&) constLine | Count | Source | 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 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 855 | }(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&) constLine | Count | Source | 401 | 345 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 345 | } else { | 405 | 345 | return r.error == simdutf::error_code::SUCCESS; | 406 | 345 | } | 407 | 345 | }(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&) constLine | 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&) constLine | Count | Source | 401 | 1.02k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.02k | } else { | 405 | 1.02k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.02k | } | 407 | 1.02k | }(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&) constLine | Count | Source | 401 | 408 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 408 | } else { | 405 | 408 | return r.error == simdutf::error_code::SUCCESS; | 406 | 408 | } | 407 | 408 | }(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&) constLine | Count | Source | 401 | 564 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 564 | } else { | 405 | 564 | return r.error == simdutf::error_code::SUCCESS; | 406 | 564 | } | 407 | 564 | }(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&) constLine | Count | Source | 401 | 1.09k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.09k | } else { | 405 | 1.09k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.09k | } | 407 | 1.09k | }(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&) constLine | Count | Source | 401 | 714 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 714 | } else { | 405 | 714 | return r.error == simdutf::error_code::SUCCESS; | 406 | 714 | } | 407 | 714 | }(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&) constLine | Count | Source | 401 | 858 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 858 | } else { | 405 | 858 | return r.error == simdutf::error_code::SUCCESS; | 406 | 858 | } | 407 | 858 | }(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&) constLine | Count | Source | 401 | 1.00k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.00k | } else { | 405 | 1.00k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.00k | } | 407 | 1.00k | }(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&) constLine | Count | Source | 401 | 1.24k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.24k | } else { | 405 | 1.24k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.24k | } | 407 | 1.24k | }(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&) constLine | Count | Source | 401 | 798 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 798 | } else { | 405 | 798 | return r.error == simdutf::error_code::SUCCESS; | 406 | 798 | } | 407 | 798 | }(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&) constLine | Count | Source | 401 | 1.24k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.24k | } else { | 405 | 1.24k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.24k | } | 407 | 1.24k | }(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&) constLine | Count | Source | 401 | 981 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 981 | } else { | 405 | 981 | return r.error == simdutf::error_code::SUCCESS; | 406 | 981 | } | 407 | 981 | }(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&) constLine | Count | Source | 401 | 1.11k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.11k | } else { | 405 | 1.11k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.11k | } | 407 | 1.11k | }(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&) constLine | Count | Source | 401 | 165 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 165 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 165 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 165 | }(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&) constLine | Count | Source | 401 | 153 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 153 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 153 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 153 | }(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&) constLine | Count | Source | 401 | 123 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 123 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 123 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 123 | }(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&) constLine | Count | Source | 401 | 954 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 954 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 954 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 954 | }(implret1); |
|
408 | 27.6k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); |
409 | 27.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 | 27.6k | const ToType canary2{25}; |
414 | 27.6k | const auto outputbuffer_first_run = outputbuffer; |
415 | 27.6k | std::ranges::fill(outputbuffer, canary2); |
416 | 27.6k | const auto implret2 = std::invoke(conversion, impl, src.data(), |
417 | 27.6k | src.size(), outputbuffer.data()); |
418 | | |
419 | 27.6k | if (implret1 != implret2) { |
420 | 0 | std::cerr << "different return value the second time!\n"; |
421 | 0 | std::abort(); |
422 | 0 | } |
423 | 27.6k | if (inputisvalid && success) { |
424 | | // only care about the output if the input is valid |
425 | 13.6k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); |
426 | 13.6k | 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 | 13.6k | } |
440 | 27.6k | } |
441 | 27.6k | results.emplace_back(implret1, success ? hash1 : ""); |
442 | 27.6k | } |
443 | | |
444 | | // do not require implementations to give the same output if |
445 | | // the input is not valid. |
446 | 9.21k | if (!inputisvalid) { |
447 | 13.2k | for (auto& e : results) { |
448 | 13.2k | e.outputhash.clear(); |
449 | 13.2k | } |
450 | 4.40k | } |
451 | | |
452 | 18.4k | 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&) constLine | Count | Source | 452 | 460 | 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&) constLine | Count | Source | 452 | 868 | 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&) constLine | Count | Source | 452 | 442 | 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&) constLine | Count | Source | 452 | 900 | 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&) constLine | Count | Source | 452 | 604 | 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&) constLine | Count | Source | 452 | 744 | 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&) constLine | Count | Source | 452 | 880 | 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&) constLine | Count | Source | 452 | 1.21k | 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&) constLine | Count | Source | 452 | 1.20k | 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&) constLine | Count | Source | 452 | 1.23k | 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&) constLine | Count | Source | 452 | 92 | 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&) constLine | Count | Source | 452 | 174 | 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&) constLine | Count | Source | 452 | 176 | 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&) constLine | Count | Source | 452 | 570 | 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&) constLine | Count | Source | 452 | 230 | 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&) constLine | 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&) constLine | Count | Source | 452 | 682 | 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&) constLine | Count | Source | 452 | 272 | 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&) constLine | Count | Source | 452 | 376 | 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&) constLine | Count | Source | 452 | 730 | 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&) constLine | Count | Source | 452 | 476 | 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&) constLine | Count | Source | 452 | 572 | 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&) constLine | Count | Source | 452 | 672 | 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&) constLine | Count | Source | 452 | 832 | 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&) constLine | Count | Source | 452 | 532 | 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&) constLine | Count | Source | 452 | 830 | 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&) constLine | Count | Source | 452 | 654 | 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&) constLine | Count | Source | 452 | 746 | 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&) constLine | Count | Source | 452 | 110 | 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&) constLine | Count | Source | 452 | 102 | 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&) constLine | Count | Source | 452 | 82 | 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&) constLine | Count | Source | 452 | 636 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
453 | 9.21k | 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 | 9.21k | } else { |
474 | 9.21k | ret.implementations_agree = true; |
475 | 9.21k | } |
476 | 9.21k | return ret; |
477 | 9.21k | } 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 | 230 | const bool inputisvalid) const { | 383 | 230 | conversion_result ret{}; | 384 | | | 385 | 230 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 230 | std::vector<result<ConversionResult>> results; | 388 | 230 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 230 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 230 | outputbuffers.reserve(implementations.size()); | 394 | 920 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 690 | auto impl = implementations[i]; | 396 | 690 | const ToType canary1{42}; | 397 | 690 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 690 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 690 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 690 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 690 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 690 | return r != 0; | 404 | 690 | } else { | 405 | 690 | return r.error == simdutf::error_code::SUCCESS; | 406 | 690 | } | 407 | 690 | }(implret1); | 408 | 690 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 690 | 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 | 690 | const ToType canary2{25}; | 414 | 690 | const auto outputbuffer_first_run = outputbuffer; | 415 | 690 | std::ranges::fill(outputbuffer, canary2); | 416 | 690 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 690 | src.size(), outputbuffer.data()); | 418 | | | 419 | 690 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 690 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 462 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 462 | 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 | 462 | } | 440 | 690 | } | 441 | 690 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 690 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 230 | if (!inputisvalid) { | 447 | 219 | for (auto& e : results) { | 448 | 219 | e.outputhash.clear(); | 449 | 219 | } | 450 | 73 | } | 451 | | | 452 | 230 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 230 | 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 | 230 | } else { | 474 | 230 | ret.implementations_agree = true; | 475 | 230 | } | 476 | 230 | return ret; | 477 | 230 | } |
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 | 434 | const bool inputisvalid) const { | 383 | 434 | conversion_result ret{}; | 384 | | | 385 | 434 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 434 | std::vector<result<ConversionResult>> results; | 388 | 434 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 434 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 434 | outputbuffers.reserve(implementations.size()); | 394 | 1.73k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.30k | auto impl = implementations[i]; | 396 | 1.30k | const ToType canary1{42}; | 397 | 1.30k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.30k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.30k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.30k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.30k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.30k | return r != 0; | 404 | 1.30k | } else { | 405 | 1.30k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.30k | } | 407 | 1.30k | }(implret1); | 408 | 1.30k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.30k | 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.30k | const ToType canary2{25}; | 414 | 1.30k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.30k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.30k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.30k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.30k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.30k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 969 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 969 | 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 | 969 | } | 440 | 1.30k | } | 441 | 1.30k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.30k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 434 | if (!inputisvalid) { | 447 | 321 | for (auto& e : results) { | 448 | 321 | e.outputhash.clear(); | 449 | 321 | } | 450 | 107 | } | 451 | | | 452 | 434 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 434 | 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 | 434 | } else { | 474 | 434 | ret.implementations_agree = true; | 475 | 434 | } | 476 | 434 | return ret; | 477 | 434 | } |
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 | 221 | const bool inputisvalid) const { | 383 | 221 | conversion_result ret{}; | 384 | | | 385 | 221 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 221 | std::vector<result<ConversionResult>> results; | 388 | 221 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 221 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 221 | outputbuffers.reserve(implementations.size()); | 394 | 884 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 663 | auto impl = implementations[i]; | 396 | 663 | const ToType canary1{42}; | 397 | 663 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 663 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 663 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 663 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 663 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 663 | return r != 0; | 404 | 663 | } else { | 405 | 663 | return r.error == simdutf::error_code::SUCCESS; | 406 | 663 | } | 407 | 663 | }(implret1); | 408 | 663 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 663 | 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 | 663 | const ToType canary2{25}; | 414 | 663 | const auto outputbuffer_first_run = outputbuffer; | 415 | 663 | std::ranges::fill(outputbuffer, canary2); | 416 | 663 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 663 | src.size(), outputbuffer.data()); | 418 | | | 419 | 663 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 663 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 381 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 381 | 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 | 381 | } | 440 | 663 | } | 441 | 663 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 663 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 221 | if (!inputisvalid) { | 447 | 273 | for (auto& e : results) { | 448 | 273 | e.outputhash.clear(); | 449 | 273 | } | 450 | 91 | } | 451 | | | 452 | 221 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 221 | 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 | 221 | } else { | 474 | 221 | ret.implementations_agree = true; | 475 | 221 | } | 476 | 221 | return ret; | 477 | 221 | } |
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 | 450 | const bool inputisvalid) const { | 383 | 450 | conversion_result ret{}; | 384 | | | 385 | 450 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 450 | std::vector<result<ConversionResult>> results; | 388 | 450 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 450 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 450 | 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 | 1.05k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.05k | 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 | 1.05k | } | 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 | 450 | if (!inputisvalid) { | 447 | 288 | for (auto& e : results) { | 448 | 288 | e.outputhash.clear(); | 449 | 288 | } | 450 | 96 | } | 451 | | | 452 | 450 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 450 | 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 | 450 | } else { | 474 | 450 | ret.implementations_agree = true; | 475 | 450 | } | 476 | 450 | return ret; | 477 | 450 | } |
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 | 302 | const bool inputisvalid) const { | 383 | 302 | conversion_result ret{}; | 384 | | | 385 | 302 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 302 | std::vector<result<ConversionResult>> results; | 388 | 302 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 302 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 302 | outputbuffers.reserve(implementations.size()); | 394 | 1.20k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 906 | auto impl = implementations[i]; | 396 | 906 | const ToType canary1{42}; | 397 | 906 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 906 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 906 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 906 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 906 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 906 | return r != 0; | 404 | 906 | } else { | 405 | 906 | return r.error == simdutf::error_code::SUCCESS; | 406 | 906 | } | 407 | 906 | }(implret1); | 408 | 906 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 906 | 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 | 906 | const ToType canary2{25}; | 414 | 906 | const auto outputbuffer_first_run = outputbuffer; | 415 | 906 | std::ranges::fill(outputbuffer, canary2); | 416 | 906 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 906 | src.size(), outputbuffer.data()); | 418 | | | 419 | 906 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 906 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 357 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 357 | 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 | 357 | } | 440 | 906 | } | 441 | 906 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 906 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 302 | if (!inputisvalid) { | 447 | 540 | for (auto& e : results) { | 448 | 540 | e.outputhash.clear(); | 449 | 540 | } | 450 | 180 | } | 451 | | | 452 | 302 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 302 | 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 | 302 | } else { | 474 | 302 | ret.implementations_agree = true; | 475 | 302 | } | 476 | 302 | return ret; | 477 | 302 | } |
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 | 372 | const bool inputisvalid) const { | 383 | 372 | conversion_result ret{}; | 384 | | | 385 | 372 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 372 | std::vector<result<ConversionResult>> results; | 388 | 372 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 372 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 372 | outputbuffers.reserve(implementations.size()); | 394 | 1.48k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.11k | auto impl = implementations[i]; | 396 | 1.11k | const ToType canary1{42}; | 397 | 1.11k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.11k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.11k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.11k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.11k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.11k | return r != 0; | 404 | 1.11k | } else { | 405 | 1.11k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.11k | } | 407 | 1.11k | }(implret1); | 408 | 1.11k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.11k | 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.11k | const ToType canary2{25}; | 414 | 1.11k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.11k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.11k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.11k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.11k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.11k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 525 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 525 | 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 | 525 | } | 440 | 1.11k | } | 441 | 1.11k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.11k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 372 | if (!inputisvalid) { | 447 | 576 | for (auto& e : results) { | 448 | 576 | e.outputhash.clear(); | 449 | 576 | } | 450 | 192 | } | 451 | | | 452 | 372 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 372 | 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 | 372 | } else { | 474 | 372 | ret.implementations_agree = true; | 475 | 372 | } | 476 | 372 | return ret; | 477 | 372 | } |
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 | 440 | const bool inputisvalid) const { | 383 | 440 | conversion_result ret{}; | 384 | | | 385 | 440 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 440 | std::vector<result<ConversionResult>> results; | 388 | 440 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 440 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 440 | outputbuffers.reserve(implementations.size()); | 394 | 1.76k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.32k | auto impl = implementations[i]; | 396 | 1.32k | const ToType canary1{42}; | 397 | 1.32k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.32k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.32k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.32k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.32k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.32k | return r != 0; | 404 | 1.32k | } else { | 405 | 1.32k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.32k | } | 407 | 1.32k | }(implret1); | 408 | 1.32k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.32k | 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.32k | const ToType canary2{25}; | 414 | 1.32k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.32k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.32k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.32k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.32k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.32k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 432 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 432 | 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 | 432 | } | 440 | 1.32k | } | 441 | 1.32k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.32k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 440 | if (!inputisvalid) { | 447 | 879 | for (auto& e : results) { | 448 | 879 | e.outputhash.clear(); | 449 | 879 | } | 450 | 293 | } | 451 | | | 452 | 440 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 440 | 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 | 440 | } else { | 474 | 440 | ret.implementations_agree = true; | 475 | 440 | } | 476 | 440 | return ret; | 477 | 440 | } |
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 | 608 | const bool inputisvalid) const { | 383 | 608 | conversion_result ret{}; | 384 | | | 385 | 608 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 608 | std::vector<result<ConversionResult>> results; | 388 | 608 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 608 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 608 | outputbuffers.reserve(implementations.size()); | 394 | 2.43k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.82k | auto impl = implementations[i]; | 396 | 1.82k | const ToType canary1{42}; | 397 | 1.82k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.82k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.82k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.82k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.82k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.82k | return r != 0; | 404 | 1.82k | } else { | 405 | 1.82k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.82k | } | 407 | 1.82k | }(implret1); | 408 | 1.82k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.82k | 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.82k | const ToType canary2{25}; | 414 | 1.82k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.82k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.82k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.82k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.82k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.82k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.03k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.03k | 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 | 1.03k | } | 440 | 1.82k | } | 441 | 1.82k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.82k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 608 | if (!inputisvalid) { | 447 | 783 | for (auto& e : results) { | 448 | 783 | e.outputhash.clear(); | 449 | 783 | } | 450 | 261 | } | 451 | | | 452 | 608 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 608 | 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 | 608 | } else { | 474 | 608 | ret.implementations_agree = true; | 475 | 608 | } | 476 | 608 | return ret; | 477 | 608 | } |
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 | 604 | const bool inputisvalid) const { | 383 | 604 | conversion_result ret{}; | 384 | | | 385 | 604 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 604 | std::vector<result<ConversionResult>> results; | 388 | 604 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 604 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 604 | outputbuffers.reserve(implementations.size()); | 394 | 2.41k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.81k | auto impl = implementations[i]; | 396 | 1.81k | const ToType canary1{42}; | 397 | 1.81k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.81k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.81k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.81k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.81k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.81k | return r != 0; | 404 | 1.81k | } else { | 405 | 1.81k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.81k | } | 407 | 1.81k | }(implret1); | 408 | 1.81k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.81k | 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.81k | const ToType canary2{25}; | 414 | 1.81k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.81k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.81k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.81k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.81k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.81k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 999 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 999 | 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 | 999 | } | 440 | 1.81k | } | 441 | 1.81k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.81k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 604 | if (!inputisvalid) { | 447 | 804 | for (auto& e : results) { | 448 | 804 | e.outputhash.clear(); | 449 | 804 | } | 450 | 268 | } | 451 | | | 452 | 604 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 604 | 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 | 604 | } else { | 474 | 604 | ret.implementations_agree = true; | 475 | 604 | } | 476 | 604 | return ret; | 477 | 604 | } |
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 | 616 | const bool inputisvalid) const { | 383 | 616 | conversion_result ret{}; | 384 | | | 385 | 616 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 616 | std::vector<result<ConversionResult>> results; | 388 | 616 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 616 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 616 | outputbuffers.reserve(implementations.size()); | 394 | 2.46k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.84k | auto impl = implementations[i]; | 396 | 1.84k | const ToType canary1{42}; | 397 | 1.84k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.84k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.84k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.84k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.84k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.84k | return r != 0; | 404 | 1.84k | } else { | 405 | 1.84k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.84k | } | 407 | 1.84k | }(implret1); | 408 | 1.84k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.84k | 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.84k | const ToType canary2{25}; | 414 | 1.84k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.84k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.84k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.84k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.84k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.84k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.08k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.08k | 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 | 1.08k | } | 440 | 1.84k | } | 441 | 1.84k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.84k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 616 | if (!inputisvalid) { | 447 | 759 | for (auto& e : results) { | 448 | 759 | e.outputhash.clear(); | 449 | 759 | } | 450 | 253 | } | 451 | | | 452 | 616 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 616 | 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 | 616 | } else { | 474 | 616 | ret.implementations_agree = true; | 475 | 616 | } | 476 | 616 | return ret; | 477 | 616 | } |
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 | 46 | const bool inputisvalid) const { | 383 | 46 | conversion_result ret{}; | 384 | | | 385 | 46 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 46 | std::vector<result<ConversionResult>> results; | 388 | 46 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 46 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 46 | outputbuffers.reserve(implementations.size()); | 394 | 184 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 138 | auto impl = implementations[i]; | 396 | 138 | const ToType canary1{42}; | 397 | 138 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 138 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 138 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 138 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 138 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 138 | return r != 0; | 404 | 138 | } else { | 405 | 138 | return r.error == simdutf::error_code::SUCCESS; | 406 | 138 | } | 407 | 138 | }(implret1); | 408 | 138 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 138 | 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 | 138 | const ToType canary2{25}; | 414 | 138 | const auto outputbuffer_first_run = outputbuffer; | 415 | 138 | std::ranges::fill(outputbuffer, canary2); | 416 | 138 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 138 | src.size(), outputbuffer.data()); | 418 | | | 419 | 138 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 138 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 57 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 57 | 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 | 57 | } | 440 | 138 | } | 441 | 138 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 138 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 46 | if (!inputisvalid) { | 447 | 18 | for (auto& e : results) { | 448 | 18 | e.outputhash.clear(); | 449 | 18 | } | 450 | 6 | } | 451 | | | 452 | 46 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 46 | 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 | 46 | } else { | 474 | 46 | ret.implementations_agree = true; | 475 | 46 | } | 476 | 46 | return ret; | 477 | 46 | } |
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 | 87 | const bool inputisvalid) const { | 383 | 87 | conversion_result ret{}; | 384 | | | 385 | 87 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 87 | std::vector<result<ConversionResult>> results; | 388 | 87 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 87 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 87 | outputbuffers.reserve(implementations.size()); | 394 | 348 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 261 | auto impl = implementations[i]; | 396 | 261 | const ToType canary1{42}; | 397 | 261 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 261 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 261 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 261 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 261 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 261 | return r != 0; | 404 | 261 | } else { | 405 | 261 | return r.error == simdutf::error_code::SUCCESS; | 406 | 261 | } | 407 | 261 | }(implret1); | 408 | 261 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 261 | 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 | 261 | const ToType canary2{25}; | 414 | 261 | const auto outputbuffer_first_run = outputbuffer; | 415 | 261 | std::ranges::fill(outputbuffer, canary2); | 416 | 261 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 261 | src.size(), outputbuffer.data()); | 418 | | | 419 | 261 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 261 | 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 | 261 | } | 441 | 261 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 261 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 87 | if (!inputisvalid) { | 447 | 93 | for (auto& e : results) { | 448 | 93 | e.outputhash.clear(); | 449 | 93 | } | 450 | 31 | } | 451 | | | 452 | 87 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 87 | 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 | 87 | } else { | 474 | 87 | ret.implementations_agree = true; | 475 | 87 | } | 476 | 87 | return ret; | 477 | 87 | } |
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 | 88 | const bool inputisvalid) const { | 383 | 88 | conversion_result ret{}; | 384 | | | 385 | 88 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 88 | std::vector<result<ConversionResult>> results; | 388 | 88 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 88 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 88 | outputbuffers.reserve(implementations.size()); | 394 | 352 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 264 | auto impl = implementations[i]; | 396 | 264 | const ToType canary1{42}; | 397 | 264 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 264 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 264 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 264 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 264 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 264 | return r != 0; | 404 | 264 | } else { | 405 | 264 | return r.error == simdutf::error_code::SUCCESS; | 406 | 264 | } | 407 | 264 | }(implret1); | 408 | 264 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 264 | 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 | 264 | const ToType canary2{25}; | 414 | 264 | const auto outputbuffer_first_run = outputbuffer; | 415 | 264 | std::ranges::fill(outputbuffer, canary2); | 416 | 264 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 264 | src.size(), outputbuffer.data()); | 418 | | | 419 | 264 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 264 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 57 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 57 | 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 | 57 | } | 440 | 264 | } | 441 | 264 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 264 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 88 | if (!inputisvalid) { | 447 | 189 | for (auto& e : results) { | 448 | 189 | e.outputhash.clear(); | 449 | 189 | } | 450 | 63 | } | 451 | | | 452 | 88 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 88 | 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 | 88 | } else { | 474 | 88 | ret.implementations_agree = true; | 475 | 88 | } | 476 | 88 | return ret; | 477 | 88 | } |
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 | 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 | 234 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 234 | 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 | 234 | } | 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 | 591 | for (auto& e : results) { | 448 | 591 | e.outputhash.clear(); | 449 | 591 | } | 450 | 197 | } | 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)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 | 115 | const bool inputisvalid) const { | 383 | 115 | conversion_result ret{}; | 384 | | | 385 | 115 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 115 | std::vector<result<ConversionResult>> results; | 388 | 115 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 115 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 115 | outputbuffers.reserve(implementations.size()); | 394 | 460 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 345 | auto impl = implementations[i]; | 396 | 345 | const ToType canary1{42}; | 397 | 345 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 345 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 345 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 345 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 345 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 345 | return r != 0; | 404 | 345 | } else { | 405 | 345 | return r.error == simdutf::error_code::SUCCESS; | 406 | 345 | } | 407 | 345 | }(implret1); | 408 | 345 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 345 | 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 | 345 | const ToType canary2{25}; | 414 | 345 | const auto outputbuffer_first_run = outputbuffer; | 415 | 345 | std::ranges::fill(outputbuffer, canary2); | 416 | 345 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 345 | src.size(), outputbuffer.data()); | 418 | | | 419 | 345 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 345 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 102 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 102 | 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 | 102 | } | 440 | 345 | } | 441 | 345 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 345 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 115 | if (!inputisvalid) { | 447 | 93 | for (auto& e : results) { | 448 | 93 | e.outputhash.clear(); | 449 | 93 | } | 450 | 31 | } | 451 | | | 452 | 115 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 115 | 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 | 115 | } else { | 474 | 115 | ret.implementations_agree = true; | 475 | 115 | } | 476 | 115 | return ret; | 477 | 115 | } |
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 | 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 | 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 | 240 | for (auto& e : results) { | 448 | 240 | e.outputhash.clear(); | 449 | 240 | } | 450 | 80 | } | 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 | 341 | const bool inputisvalid) const { | 383 | 341 | conversion_result ret{}; | 384 | | | 385 | 341 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 341 | std::vector<result<ConversionResult>> results; | 388 | 341 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 341 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 341 | outputbuffers.reserve(implementations.size()); | 394 | 1.36k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.02k | auto impl = implementations[i]; | 396 | 1.02k | const ToType canary1{42}; | 397 | 1.02k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.02k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.02k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.02k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.02k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.02k | return r != 0; | 404 | 1.02k | } else { | 405 | 1.02k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.02k | } | 407 | 1.02k | }(implret1); | 408 | 1.02k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.02k | 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.02k | const ToType canary2{25}; | 414 | 1.02k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.02k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.02k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.02k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.02k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.02k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 603 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 603 | 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 | 603 | } | 440 | 1.02k | } | 441 | 1.02k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.02k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 341 | if (!inputisvalid) { | 447 | 420 | for (auto& e : results) { | 448 | 420 | e.outputhash.clear(); | 449 | 420 | } | 450 | 140 | } | 451 | | | 452 | 341 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 341 | 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 | 341 | } else { | 474 | 341 | ret.implementations_agree = true; | 475 | 341 | } | 476 | 341 | return ret; | 477 | 341 | } |
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 | 136 | const bool inputisvalid) const { | 383 | 136 | conversion_result ret{}; | 384 | | | 385 | 136 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 136 | std::vector<result<ConversionResult>> results; | 388 | 136 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 136 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 136 | outputbuffers.reserve(implementations.size()); | 394 | 544 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 408 | auto impl = implementations[i]; | 396 | 408 | const ToType canary1{42}; | 397 | 408 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 408 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 408 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 408 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 408 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 408 | return r != 0; | 404 | 408 | } else { | 405 | 408 | return r.error == simdutf::error_code::SUCCESS; | 406 | 408 | } | 407 | 408 | }(implret1); | 408 | 408 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 408 | 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 | 408 | const ToType canary2{25}; | 414 | 408 | const auto outputbuffer_first_run = outputbuffer; | 415 | 408 | std::ranges::fill(outputbuffer, canary2); | 416 | 408 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 408 | src.size(), outputbuffer.data()); | 418 | | | 419 | 408 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 408 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 111 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 111 | 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 | 111 | } | 440 | 408 | } | 441 | 408 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 408 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 136 | if (!inputisvalid) { | 447 | 81 | for (auto& e : results) { | 448 | 81 | e.outputhash.clear(); | 449 | 81 | } | 450 | 27 | } | 451 | | | 452 | 136 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 136 | 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 | 136 | } else { | 474 | 136 | ret.implementations_agree = true; | 475 | 136 | } | 476 | 136 | return ret; | 477 | 136 | } |
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 | 188 | const bool inputisvalid) const { | 383 | 188 | conversion_result ret{}; | 384 | | | 385 | 188 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 188 | std::vector<result<ConversionResult>> results; | 388 | 188 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 188 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 188 | outputbuffers.reserve(implementations.size()); | 394 | 752 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 564 | auto impl = implementations[i]; | 396 | 564 | const ToType canary1{42}; | 397 | 564 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 564 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 564 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 564 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 564 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 564 | return r != 0; | 404 | 564 | } else { | 405 | 564 | return r.error == simdutf::error_code::SUCCESS; | 406 | 564 | } | 407 | 564 | }(implret1); | 408 | 564 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 564 | 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 | 564 | const ToType canary2{25}; | 414 | 564 | const auto outputbuffer_first_run = outputbuffer; | 415 | 564 | std::ranges::fill(outputbuffer, canary2); | 416 | 564 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 564 | src.size(), outputbuffer.data()); | 418 | | | 419 | 564 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 564 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 246 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 246 | 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 | 246 | } | 440 | 564 | } | 441 | 564 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 564 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 188 | if (!inputisvalid) { | 447 | 318 | for (auto& e : results) { | 448 | 318 | e.outputhash.clear(); | 449 | 318 | } | 450 | 106 | } | 451 | | | 452 | 188 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 188 | 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 | 188 | } else { | 474 | 188 | ret.implementations_agree = true; | 475 | 188 | } | 476 | 188 | return ret; | 477 | 188 | } |
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 | 365 | const bool inputisvalid) const { | 383 | 365 | conversion_result ret{}; | 384 | | | 385 | 365 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 365 | std::vector<result<ConversionResult>> results; | 388 | 365 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 365 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 365 | outputbuffers.reserve(implementations.size()); | 394 | 1.46k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.09k | auto impl = implementations[i]; | 396 | 1.09k | const ToType canary1{42}; | 397 | 1.09k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.09k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.09k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.09k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.09k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.09k | return r != 0; | 404 | 1.09k | } else { | 405 | 1.09k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.09k | } | 407 | 1.09k | }(implret1); | 408 | 1.09k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.09k | 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.09k | const ToType canary2{25}; | 414 | 1.09k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.09k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.09k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.09k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.09k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.09k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 678 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 678 | 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 | 678 | } | 440 | 1.09k | } | 441 | 1.09k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.09k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 365 | if (!inputisvalid) { | 447 | 417 | for (auto& e : results) { | 448 | 417 | e.outputhash.clear(); | 449 | 417 | } | 450 | 139 | } | 451 | | | 452 | 365 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 365 | 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 | 365 | } else { | 474 | 365 | ret.implementations_agree = true; | 475 | 365 | } | 476 | 365 | return ret; | 477 | 365 | } |
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 | 238 | const bool inputisvalid) const { | 383 | 238 | conversion_result ret{}; | 384 | | | 385 | 238 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 238 | std::vector<result<ConversionResult>> results; | 388 | 238 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 238 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 238 | outputbuffers.reserve(implementations.size()); | 394 | 952 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 714 | auto impl = implementations[i]; | 396 | 714 | const ToType canary1{42}; | 397 | 714 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 714 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 714 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 714 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 714 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 714 | return r != 0; | 404 | 714 | } else { | 405 | 714 | return r.error == simdutf::error_code::SUCCESS; | 406 | 714 | } | 407 | 714 | }(implret1); | 408 | 714 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 714 | 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 | 714 | const ToType canary2{25}; | 414 | 714 | const auto outputbuffer_first_run = outputbuffer; | 415 | 714 | std::ranges::fill(outputbuffer, canary2); | 416 | 714 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 714 | src.size(), outputbuffer.data()); | 418 | | | 419 | 714 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 714 | 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 | 714 | } | 441 | 714 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 714 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 238 | if (!inputisvalid) { | 447 | 621 | for (auto& e : results) { | 448 | 621 | e.outputhash.clear(); | 449 | 621 | } | 450 | 207 | } | 451 | | | 452 | 238 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 238 | 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 | 238 | } else { | 474 | 238 | ret.implementations_agree = true; | 475 | 238 | } | 476 | 238 | return ret; | 477 | 238 | } |
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 | 286 | const bool inputisvalid) const { | 383 | 286 | conversion_result ret{}; | 384 | | | 385 | 286 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 286 | std::vector<result<ConversionResult>> results; | 388 | 286 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 286 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 286 | outputbuffers.reserve(implementations.size()); | 394 | 1.14k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 858 | auto impl = implementations[i]; | 396 | 858 | const ToType canary1{42}; | 397 | 858 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 858 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 858 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 858 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 858 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 858 | return r != 0; | 404 | 858 | } else { | 405 | 858 | return r.error == simdutf::error_code::SUCCESS; | 406 | 858 | } | 407 | 858 | }(implret1); | 408 | 858 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 858 | 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 | 858 | const ToType canary2{25}; | 414 | 858 | const auto outputbuffer_first_run = outputbuffer; | 415 | 858 | std::ranges::fill(outputbuffer, canary2); | 416 | 858 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 858 | src.size(), outputbuffer.data()); | 418 | | | 419 | 858 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 858 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 276 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 276 | 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 | 276 | } | 440 | 858 | } | 441 | 858 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 858 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 286 | if (!inputisvalid) { | 447 | 582 | for (auto& e : results) { | 448 | 582 | e.outputhash.clear(); | 449 | 582 | } | 450 | 194 | } | 451 | | | 452 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 286 | 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 | 286 | } else { | 474 | 286 | ret.implementations_agree = true; | 475 | 286 | } | 476 | 286 | return ret; | 477 | 286 | } |
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 | 336 | const bool inputisvalid) const { | 383 | 336 | conversion_result ret{}; | 384 | | | 385 | 336 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 336 | std::vector<result<ConversionResult>> results; | 388 | 336 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 336 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 336 | outputbuffers.reserve(implementations.size()); | 394 | 1.34k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.00k | auto impl = implementations[i]; | 396 | 1.00k | const ToType canary1{42}; | 397 | 1.00k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.00k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.00k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.00k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.00k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.00k | return r != 0; | 404 | 1.00k | } else { | 405 | 1.00k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.00k | } | 407 | 1.00k | }(implret1); | 408 | 1.00k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.00k | 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.00k | const ToType canary2{25}; | 414 | 1.00k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.00k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.00k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.00k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.00k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.00k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 270 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 270 | 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 | 270 | } | 440 | 1.00k | } | 441 | 1.00k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.00k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 336 | if (!inputisvalid) { | 447 | 738 | for (auto& e : results) { | 448 | 738 | e.outputhash.clear(); | 449 | 738 | } | 450 | 246 | } | 451 | | | 452 | 336 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 336 | 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 | 336 | } else { | 474 | 336 | ret.implementations_agree = true; | 475 | 336 | } | 476 | 336 | return ret; | 477 | 336 | } |
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 | 416 | const bool inputisvalid) const { | 383 | 416 | conversion_result ret{}; | 384 | | | 385 | 416 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 416 | std::vector<result<ConversionResult>> results; | 388 | 416 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 416 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 416 | outputbuffers.reserve(implementations.size()); | 394 | 1.66k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.24k | auto impl = implementations[i]; | 396 | 1.24k | const ToType canary1{42}; | 397 | 1.24k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.24k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.24k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.24k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.24k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.24k | return r != 0; | 404 | 1.24k | } else { | 405 | 1.24k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.24k | } | 407 | 1.24k | }(implret1); | 408 | 1.24k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.24k | 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.24k | const ToType canary2{25}; | 414 | 1.24k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.24k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.24k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.24k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.24k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.24k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 303 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 303 | 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 | 303 | } | 440 | 1.24k | } | 441 | 1.24k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.24k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 416 | if (!inputisvalid) { | 447 | 945 | for (auto& e : results) { | 448 | 945 | e.outputhash.clear(); | 449 | 945 | } | 450 | 315 | } | 451 | | | 452 | 416 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 416 | 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 | 416 | } else { | 474 | 416 | ret.implementations_agree = true; | 475 | 416 | } | 476 | 416 | return ret; | 477 | 416 | } |
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 | 266 | const bool inputisvalid) const { | 383 | 266 | conversion_result ret{}; | 384 | | | 385 | 266 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 266 | std::vector<result<ConversionResult>> results; | 388 | 266 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 266 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 266 | outputbuffers.reserve(implementations.size()); | 394 | 1.06k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 798 | auto impl = implementations[i]; | 396 | 798 | const ToType canary1{42}; | 397 | 798 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 798 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 798 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 798 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 798 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 798 | return r != 0; | 404 | 798 | } else { | 405 | 798 | return r.error == simdutf::error_code::SUCCESS; | 406 | 798 | } | 407 | 798 | }(implret1); | 408 | 798 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 798 | 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 | 798 | const ToType canary2{25}; | 414 | 798 | const auto outputbuffer_first_run = outputbuffer; | 415 | 798 | std::ranges::fill(outputbuffer, canary2); | 416 | 798 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 798 | src.size(), outputbuffer.data()); | 418 | | | 419 | 798 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 798 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 300 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 300 | 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 | 300 | } | 440 | 798 | } | 441 | 798 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 798 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 266 | if (!inputisvalid) { | 447 | 474 | for (auto& e : results) { | 448 | 474 | e.outputhash.clear(); | 449 | 474 | } | 450 | 158 | } | 451 | | | 452 | 266 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 266 | 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 | 266 | } else { | 474 | 266 | ret.implementations_agree = true; | 475 | 266 | } | 476 | 266 | return ret; | 477 | 266 | } |
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 | 415 | const bool inputisvalid) const { | 383 | 415 | conversion_result ret{}; | 384 | | | 385 | 415 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 415 | std::vector<result<ConversionResult>> results; | 388 | 415 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 415 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 415 | outputbuffers.reserve(implementations.size()); | 394 | 1.66k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.24k | auto impl = implementations[i]; | 396 | 1.24k | const ToType canary1{42}; | 397 | 1.24k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.24k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.24k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.24k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.24k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.24k | return r != 0; | 404 | 1.24k | } else { | 405 | 1.24k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.24k | } | 407 | 1.24k | }(implret1); | 408 | 1.24k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.24k | 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.24k | const ToType canary2{25}; | 414 | 1.24k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.24k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.24k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.24k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.24k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.24k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 528 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 528 | 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 | 528 | } | 440 | 1.24k | } | 441 | 1.24k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.24k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 415 | if (!inputisvalid) { | 447 | 717 | for (auto& e : results) { | 448 | 717 | e.outputhash.clear(); | 449 | 717 | } | 450 | 239 | } | 451 | | | 452 | 415 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 415 | 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 | 415 | } else { | 474 | 415 | ret.implementations_agree = true; | 475 | 415 | } | 476 | 415 | return ret; | 477 | 415 | } |
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 | 327 | const bool inputisvalid) const { | 383 | 327 | conversion_result ret{}; | 384 | | | 385 | 327 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 327 | std::vector<result<ConversionResult>> results; | 388 | 327 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 327 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 327 | outputbuffers.reserve(implementations.size()); | 394 | 1.30k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 981 | auto impl = implementations[i]; | 396 | 981 | const ToType canary1{42}; | 397 | 981 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 981 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 981 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 981 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 981 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 981 | return r != 0; | 404 | 981 | } else { | 405 | 981 | return r.error == simdutf::error_code::SUCCESS; | 406 | 981 | } | 407 | 981 | }(implret1); | 408 | 981 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 981 | 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 | 981 | const ToType canary2{25}; | 414 | 981 | const auto outputbuffer_first_run = outputbuffer; | 415 | 981 | std::ranges::fill(outputbuffer, canary2); | 416 | 981 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 981 | src.size(), outputbuffer.data()); | 418 | | | 419 | 981 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 981 | 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 | 981 | } | 441 | 981 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 981 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 327 | if (!inputisvalid) { | 447 | 621 | for (auto& e : results) { | 448 | 621 | e.outputhash.clear(); | 449 | 621 | } | 450 | 207 | } | 451 | | | 452 | 327 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 327 | 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 | 327 | } else { | 474 | 327 | ret.implementations_agree = true; | 475 | 327 | } | 476 | 327 | return ret; | 477 | 327 | } |
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 | 373 | const bool inputisvalid) const { | 383 | 373 | conversion_result ret{}; | 384 | | | 385 | 373 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 373 | std::vector<result<ConversionResult>> results; | 388 | 373 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 373 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 373 | outputbuffers.reserve(implementations.size()); | 394 | 1.49k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.11k | auto impl = implementations[i]; | 396 | 1.11k | const ToType canary1{42}; | 397 | 1.11k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.11k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.11k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.11k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.11k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.11k | return r != 0; | 404 | 1.11k | } else { | 405 | 1.11k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.11k | } | 407 | 1.11k | }(implret1); | 408 | 1.11k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.11k | 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.11k | const ToType canary2{25}; | 414 | 1.11k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.11k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.11k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.11k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.11k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.11k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 507 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 507 | 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 | 507 | } | 440 | 1.11k | } | 441 | 1.11k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.11k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 373 | if (!inputisvalid) { | 447 | 612 | for (auto& e : results) { | 448 | 612 | e.outputhash.clear(); | 449 | 612 | } | 450 | 204 | } | 451 | | | 452 | 373 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 373 | 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 | 373 | } else { | 474 | 373 | ret.implementations_agree = true; | 475 | 373 | } | 476 | 373 | return ret; | 477 | 373 | } |
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 | 55 | const bool inputisvalid) const { | 383 | 55 | conversion_result ret{}; | 384 | | | 385 | 55 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 55 | std::vector<result<ConversionResult>> results; | 388 | 55 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 55 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 55 | outputbuffers.reserve(implementations.size()); | 394 | 220 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 165 | auto impl = implementations[i]; | 396 | 165 | const ToType canary1{42}; | 397 | 165 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 165 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 165 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 165 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 165 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 165 | return r != 0; | 404 | 165 | } else { | 405 | 165 | return r.error == simdutf::error_code::SUCCESS; | 406 | 165 | } | 407 | 165 | }(implret1); | 408 | 165 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 165 | 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 | 165 | const ToType canary2{25}; | 414 | 165 | const auto outputbuffer_first_run = outputbuffer; | 415 | 165 | std::ranges::fill(outputbuffer, canary2); | 416 | 165 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 165 | src.size(), outputbuffer.data()); | 418 | | | 419 | 165 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 165 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 159 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 159 | 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 | 159 | } | 440 | 165 | } | 441 | 165 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 165 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 55 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 55 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 55 | 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 | 55 | } else { | 474 | 55 | ret.implementations_agree = true; | 475 | 55 | } | 476 | 55 | return ret; | 477 | 55 | } |
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 | 51 | const bool inputisvalid) const { | 383 | 51 | conversion_result ret{}; | 384 | | | 385 | 51 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 51 | std::vector<result<ConversionResult>> results; | 388 | 51 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 51 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 51 | outputbuffers.reserve(implementations.size()); | 394 | 204 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 153 | auto impl = implementations[i]; | 396 | 153 | const ToType canary1{42}; | 397 | 153 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 153 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 153 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 153 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 153 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 153 | return r != 0; | 404 | 153 | } else { | 405 | 153 | return r.error == simdutf::error_code::SUCCESS; | 406 | 153 | } | 407 | 153 | }(implret1); | 408 | 153 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 153 | 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 | 153 | const ToType canary2{25}; | 414 | 153 | const auto outputbuffer_first_run = outputbuffer; | 415 | 153 | std::ranges::fill(outputbuffer, canary2); | 416 | 153 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 153 | src.size(), outputbuffer.data()); | 418 | | | 419 | 153 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 153 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 147 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 147 | 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 | 147 | } | 440 | 153 | } | 441 | 153 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 153 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 51 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 51 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 51 | 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 | 51 | } else { | 474 | 51 | ret.implementations_agree = true; | 475 | 51 | } | 476 | 51 | return ret; | 477 | 51 | } |
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 | 41 | const bool inputisvalid) const { | 383 | 41 | conversion_result ret{}; | 384 | | | 385 | 41 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 41 | std::vector<result<ConversionResult>> results; | 388 | 41 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 41 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 41 | outputbuffers.reserve(implementations.size()); | 394 | 164 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 123 | auto impl = implementations[i]; | 396 | 123 | const ToType canary1{42}; | 397 | 123 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 123 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 123 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 123 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 123 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 123 | return r != 0; | 404 | 123 | } else { | 405 | 123 | return r.error == simdutf::error_code::SUCCESS; | 406 | 123 | } | 407 | 123 | }(implret1); | 408 | 123 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 123 | 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 | 123 | const ToType canary2{25}; | 414 | 123 | const auto outputbuffer_first_run = outputbuffer; | 415 | 123 | std::ranges::fill(outputbuffer, canary2); | 416 | 123 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 123 | src.size(), outputbuffer.data()); | 418 | | | 419 | 123 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 123 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 117 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 117 | 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 | 117 | } | 440 | 123 | } | 441 | 123 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 123 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 41 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 41 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 41 | 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 | 41 | } else { | 474 | 41 | ret.implementations_agree = true; | 475 | 41 | } | 476 | 41 | return ret; | 477 | 41 | } |
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 | 318 | const bool inputisvalid) const { | 383 | 318 | conversion_result ret{}; | 384 | | | 385 | 318 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 318 | std::vector<result<ConversionResult>> results; | 388 | 318 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 318 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 318 | outputbuffers.reserve(implementations.size()); | 394 | 1.27k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 954 | auto impl = implementations[i]; | 396 | 954 | const ToType canary1{42}; | 397 | 954 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 954 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 954 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 954 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 954 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 954 | return r != 0; | 404 | 954 | } else { | 405 | 954 | return r.error == simdutf::error_code::SUCCESS; | 406 | 954 | } | 407 | 954 | }(implret1); | 408 | 954 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 954 | 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 | 954 | const ToType canary2{25}; | 414 | 954 | const auto outputbuffer_first_run = outputbuffer; | 415 | 954 | std::ranges::fill(outputbuffer, canary2); | 416 | 954 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 954 | src.size(), outputbuffer.data()); | 418 | | | 419 | 954 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 954 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 948 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 948 | 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 | 948 | } | 440 | 954 | } | 441 | 954 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 954 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 318 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 318 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 318 | 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 | 318 | } else { | 474 | 318 | ret.implementations_agree = true; | 475 | 318 | } | 476 | 318 | return ret; | 477 | 318 | } |
|
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 | 9.31k | +[](std::span<const char> chardata) { \ |
555 | 9.31k | const auto c = \ |
556 | 9.31k | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ |
557 | 9.31k | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ |
558 | 9.31k | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ |
559 | 9.31k | &I::lenfunc, &I::conversionfunc, \ |
560 | 9.31k | std::string{NAMEOF(&I::lenfunc)}, \ |
561 | 9.31k | std::string{NAMEOF(&I::conversionfunc)}}; \ |
562 | 9.31k | c.fuzz(chardata); \ |
563 | 9.31k | } \ conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 116 | +[](std::span<const char> chardata) { \ | 555 | 116 | const auto c = \ | 556 | 116 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 116 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 116 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 116 | &I::lenfunc, &I::conversionfunc, \ | 560 | 116 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 116 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 116 | c.fuzz(chardata); \ | 563 | 116 | } \ |
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 235 | +[](std::span<const char> chardata) { \ | 555 | 235 | const auto c = \ | 556 | 235 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 235 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 235 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 235 | &I::lenfunc, &I::conversionfunc, \ | 560 | 235 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 235 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 235 | c.fuzz(chardata); \ | 563 | 235 | } \ |
conversion.cpp:populate_functions()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 77 | +[](std::span<const char> chardata) { \ | 555 | 77 | const auto c = \ | 556 | 77 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 77 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 77 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 77 | &I::lenfunc, &I::conversionfunc, \ | 560 | 77 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 77 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 77 | c.fuzz(chardata); \ | 563 | 77 | } \ |
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 235 | +[](std::span<const char> chardata) { \ | 555 | 235 | const auto c = \ | 556 | 235 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 235 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 235 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 235 | &I::lenfunc, &I::conversionfunc, \ | 560 | 235 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 235 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 235 | c.fuzz(chardata); \ | 563 | 235 | } \ |
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 75 | +[](std::span<const char> chardata) { \ | 555 | 75 | const auto c = \ | 556 | 75 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 75 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 75 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 75 | &I::lenfunc, &I::conversionfunc, \ | 560 | 75 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 75 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 75 | c.fuzz(chardata); \ | 563 | 75 | } \ |
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 110 | +[](std::span<const char> chardata) { \ | 555 | 110 | const auto c = \ | 556 | 110 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 110 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 110 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 110 | &I::lenfunc, &I::conversionfunc, \ | 560 | 110 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 110 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 110 | c.fuzz(chardata); \ | 563 | 110 | } \ |
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 106 | +[](std::span<const char> chardata) { \ | 555 | 106 | const auto c = \ | 556 | 106 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 106 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 106 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 106 | &I::lenfunc, &I::conversionfunc, \ | 560 | 106 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 106 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 106 | c.fuzz(chardata); \ | 563 | 106 | } \ |
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 227 | +[](std::span<const char> chardata) { \ | 555 | 227 | const auto c = \ | 556 | 227 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 227 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 227 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 227 | &I::lenfunc, &I::conversionfunc, \ | 560 | 227 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 227 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 227 | c.fuzz(chardata); \ | 563 | 227 | } \ |
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 224 | +[](std::span<const char> chardata) { \ | 555 | 224 | const auto c = \ | 556 | 224 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 224 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 224 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 224 | &I::lenfunc, &I::conversionfunc, \ | 560 | 224 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 224 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 224 | c.fuzz(chardata); \ | 563 | 224 | } \ |
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 245 | +[](std::span<const char> chardata) { \ | 555 | 245 | const auto c = \ | 556 | 245 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 245 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 245 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 245 | &I::lenfunc, &I::conversionfunc, \ | 560 | 245 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 245 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 245 | c.fuzz(chardata); \ | 563 | 245 | } \ |
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 46 | +[](std::span<const char> chardata) { \ | 555 | 46 | const auto c = \ | 556 | 46 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 46 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 46 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 46 | &I::lenfunc, &I::conversionfunc, \ | 560 | 46 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 46 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 46 | c.fuzz(chardata); \ | 563 | 46 | } \ |
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 135 | +[](std::span<const char> chardata) { \ | 555 | 135 | const auto c = \ | 556 | 135 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 135 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 135 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 135 | &I::lenfunc, &I::conversionfunc, \ | 560 | 135 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 135 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 135 | c.fuzz(chardata); \ | 563 | 135 | } \ |
conversion.cpp:populate_functions()::$_12::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()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 87 | +[](std::span<const char> chardata) { \ | 555 | 87 | const auto c = \ | 556 | 87 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 87 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 87 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 87 | &I::lenfunc, &I::conversionfunc, \ | 560 | 87 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 87 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 87 | c.fuzz(chardata); \ | 563 | 87 | } \ |
conversion.cpp:populate_functions()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 148 | +[](std::span<const char> chardata) { \ | 555 | 148 | const auto c = \ | 556 | 148 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 148 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 148 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 148 | &I::lenfunc, &I::conversionfunc, \ | 560 | 148 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 148 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 148 | c.fuzz(chardata); \ | 563 | 148 | } \ |
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 233 | +[](std::span<const char> chardata) { \ | 555 | 233 | const auto c = \ | 556 | 233 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 233 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 233 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 233 | &I::lenfunc, &I::conversionfunc, \ | 560 | 233 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 233 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 233 | c.fuzz(chardata); \ | 563 | 233 | } \ |
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 88 | +[](std::span<const char> chardata) { \ | 555 | 88 | const auto c = \ | 556 | 88 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 88 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 88 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 88 | &I::lenfunc, &I::conversionfunc, \ | 560 | 88 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 88 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 88 | c.fuzz(chardata); \ | 563 | 88 | } \ |
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 236 | +[](std::span<const char> chardata) { \ | 555 | 236 | const auto c = \ | 556 | 236 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 236 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 236 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 236 | &I::lenfunc, &I::conversionfunc, \ | 560 | 236 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 236 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 236 | c.fuzz(chardata); \ | 563 | 236 | } \ |
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 266 | +[](std::span<const char> chardata) { \ | 555 | 266 | const auto c = \ | 556 | 266 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 266 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 266 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 266 | &I::lenfunc, &I::conversionfunc, \ | 560 | 266 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 266 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 266 | c.fuzz(chardata); \ | 563 | 266 | } \ |
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 340 | +[](std::span<const char> chardata) { \ | 555 | 340 | const auto c = \ | 556 | 340 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 340 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 340 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 340 | &I::lenfunc, &I::conversionfunc, \ | 560 | 340 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 340 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 340 | c.fuzz(chardata); \ | 563 | 340 | } \ |
conversion.cpp:populate_functions()::$_20::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()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 385 | +[](std::span<const char> chardata) { \ | 555 | 385 | const auto c = \ | 556 | 385 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 385 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 385 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 385 | &I::lenfunc, &I::conversionfunc, \ | 560 | 385 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 385 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 385 | c.fuzz(chardata); \ | 563 | 385 | } \ |
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 386 | +[](std::span<const char> chardata) { \ | 555 | 386 | const auto c = \ | 556 | 386 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 386 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 386 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 386 | &I::lenfunc, &I::conversionfunc, \ | 560 | 386 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 386 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 386 | c.fuzz(chardata); \ | 563 | 386 | } \ |
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 381 | +[](std::span<const char> chardata) { \ | 555 | 381 | const auto c = \ | 556 | 381 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 381 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 381 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 381 | &I::lenfunc, &I::conversionfunc, \ | 560 | 381 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 381 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 381 | c.fuzz(chardata); \ | 563 | 381 | } \ |
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 115 | +[](std::span<const char> chardata) { \ | 555 | 115 | const auto c = \ | 556 | 115 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 115 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 115 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 115 | &I::lenfunc, &I::conversionfunc, \ | 560 | 115 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 115 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 115 | c.fuzz(chardata); \ | 563 | 115 | } \ |
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 | 341 | +[](std::span<const char> chardata) { \ | 555 | 341 | const auto c = \ | 556 | 341 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 341 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 341 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 341 | &I::lenfunc, &I::conversionfunc, \ | 560 | 341 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 341 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 341 | c.fuzz(chardata); \ | 563 | 341 | } \ |
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 136 | +[](std::span<const char> chardata) { \ | 555 | 136 | const auto c = \ | 556 | 136 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 136 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 136 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 136 | &I::lenfunc, &I::conversionfunc, \ | 560 | 136 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 136 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 136 | c.fuzz(chardata); \ | 563 | 136 | } \ |
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 188 | +[](std::span<const char> chardata) { \ | 555 | 188 | const auto c = \ | 556 | 188 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 188 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 188 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 188 | &I::lenfunc, &I::conversionfunc, \ | 560 | 188 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 188 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 188 | c.fuzz(chardata); \ | 563 | 188 | } \ |
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 365 | +[](std::span<const char> chardata) { \ | 555 | 365 | const auto c = \ | 556 | 365 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 365 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 365 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 365 | &I::lenfunc, &I::conversionfunc, \ | 560 | 365 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 365 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 365 | c.fuzz(chardata); \ | 563 | 365 | } \ |
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 238 | +[](std::span<const char> chardata) { \ | 555 | 238 | const auto c = \ | 556 | 238 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 238 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 238 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 238 | &I::lenfunc, &I::conversionfunc, \ | 560 | 238 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 238 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 238 | c.fuzz(chardata); \ | 563 | 238 | } \ |
conversion.cpp:populate_functions()::$_31::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 286 | +[](std::span<const char> chardata) { \ | 555 | 286 | const auto c = \ | 556 | 286 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 286 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 286 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 286 | &I::lenfunc, &I::conversionfunc, \ | 560 | 286 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 286 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 286 | c.fuzz(chardata); \ | 563 | 286 | } \ |
conversion.cpp:populate_functions()::$_32::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 336 | +[](std::span<const char> chardata) { \ | 555 | 336 | const auto c = \ | 556 | 336 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 336 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 336 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 336 | &I::lenfunc, &I::conversionfunc, \ | 560 | 336 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 336 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 336 | c.fuzz(chardata); \ | 563 | 336 | } \ |
conversion.cpp:populate_functions()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 416 | +[](std::span<const char> chardata) { \ | 555 | 416 | const auto c = \ | 556 | 416 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 416 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 416 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 416 | &I::lenfunc, &I::conversionfunc, \ | 560 | 416 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 416 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 416 | c.fuzz(chardata); \ | 563 | 416 | } \ |
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 266 | +[](std::span<const char> chardata) { \ | 555 | 266 | const auto c = \ | 556 | 266 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 266 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 266 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 266 | &I::lenfunc, &I::conversionfunc, \ | 560 | 266 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 266 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 266 | c.fuzz(chardata); \ | 563 | 266 | } \ |
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 415 | +[](std::span<const char> chardata) { \ | 555 | 415 | const auto c = \ | 556 | 415 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 415 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 415 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 415 | &I::lenfunc, &I::conversionfunc, \ | 560 | 415 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 415 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 415 | c.fuzz(chardata); \ | 563 | 415 | } \ |
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 327 | +[](std::span<const char> chardata) { \ | 555 | 327 | const auto c = \ | 556 | 327 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 327 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 327 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 327 | &I::lenfunc, &I::conversionfunc, \ | 560 | 327 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 327 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 327 | c.fuzz(chardata); \ | 563 | 327 | } \ |
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 373 | +[](std::span<const char> chardata) { \ | 555 | 373 | const auto c = \ | 556 | 373 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 373 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 373 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 373 | &I::lenfunc, &I::conversionfunc, \ | 560 | 373 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 373 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 373 | c.fuzz(chardata); \ | 563 | 373 | } \ |
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 55 | +[](std::span<const char> chardata) { \ | 555 | 55 | const auto c = \ | 556 | 55 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 55 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 55 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 55 | &I::lenfunc, &I::conversionfunc, \ | 560 | 55 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 55 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 55 | c.fuzz(chardata); \ | 563 | 55 | } \ |
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 51 | +[](std::span<const char> chardata) { \ | 555 | 51 | const auto c = \ | 556 | 51 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 51 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 51 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 51 | &I::lenfunc, &I::conversionfunc, \ | 560 | 51 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 51 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 51 | c.fuzz(chardata); \ | 563 | 51 | } \ |
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 41 | +[](std::span<const char> chardata) { \ | 555 | 41 | const auto c = \ | 556 | 41 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 41 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 41 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 41 | &I::lenfunc, &I::conversionfunc, \ | 560 | 41 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 41 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 41 | c.fuzz(chardata); \ | 563 | 41 | } \ |
conversion.cpp:populate_functions()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 318 | +[](std::span<const char> chardata) { \ | 555 | 318 | const auto c = \ | 556 | 318 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 318 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 318 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 318 | &I::lenfunc, &I::conversionfunc, \ | 560 | 318 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 318 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 318 | c.fuzz(chardata); \ | 563 | 318 | } \ |
|
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 | 9.31k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
640 | 9.31k | static const auto fptrs = populate_functions(); |
641 | 9.31k | 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 | 9.31k | if (size < 4) { |
647 | 3 | return 0; |
648 | 3 | } |
649 | | |
650 | 9.31k | constexpr auto actionmask = std::bit_ceil(Ncases) - 1; |
651 | 9.31k | const auto action = data[0] & actionmask; |
652 | 9.31k | data += 4; |
653 | 9.31k | size -= 4; |
654 | | |
655 | 9.31k | if (action >= Ncases) { |
656 | 1 | return 0; |
657 | 1 | } |
658 | | |
659 | 9.31k | if constexpr (use_separate_allocation) { |
660 | | // this is better at exercising null input and catch buffer underflows |
661 | 9.31k | const std::vector<char> separate{data, data + size}; |
662 | 9.31k | fptrs[action](std::span(separate)); |
663 | | } else { |
664 | | std::span<const char> chardata{(const char*)data, size}; |
665 | | fptrs[action](chardata); |
666 | | } |
667 | | |
668 | 9.31k | return 0; |
669 | 9.31k | } |