/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.94k | void fuzz(std::span<const char> chardata) const { |
176 | | // assume the input is aligned to FromType |
177 | 9.94k | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), |
178 | 9.94k | chardata.size() / sizeof(FromType)}; |
179 | | |
180 | 9.94k | static const bool do_print_testcase = |
181 | 9.94k | std::getenv("PRINT_FUZZ_CASE") != nullptr; |
182 | | |
183 | 9.94k | if (do_print_testcase) { |
184 | 0 | dump_testcase(from, std::cerr); |
185 | 0 | std::exit(EXIT_SUCCESS); |
186 | 0 | } |
187 | | |
188 | 9.94k | do { |
189 | | // step 0 - is the input valid? |
190 | 9.94k | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); |
191 | 9.94k | 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.87k | From == UtfEncodings::UTF8) { |
198 | 6.87k | if (!count_the_input(from) && !allow_implementations_to_differ) |
199 | 0 | break; |
200 | 6.87k | } |
201 | | |
202 | | // step 2 - what is the required size of the output? |
203 | 6.87k | const auto [output_length, length_agree] = |
204 | 9.94k | calculate_length(from, inputisvalid); |
205 | 9.94k | if (!length_agree && !allow_implementations_to_differ) |
206 | 0 | break; |
207 | | |
208 | 9.94k | if (!inputisvalid && name.find("valid") != std::string::npos) { |
209 | | // don't run the conversion step, it requires valid input |
210 | 106 | return; |
211 | 106 | } |
212 | | |
213 | | // step 3 - run the conversion |
214 | 9.84k | const auto [written, outputs_agree] = |
215 | 9.84k | do_conversion(from, output_length, inputisvalid); |
216 | 9.84k | if (!outputs_agree && !allow_implementations_to_differ) |
217 | 0 | break; |
218 | | |
219 | | // coming this far means no problems were found |
220 | 9.84k | return; |
221 | 9.84k | } 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.94k | } 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 | 237 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 237 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 237 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 237 | static const bool do_print_testcase = | 181 | 237 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 237 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 237 | do { | 189 | | // step 0 - is the input valid? | 190 | 237 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 237 | 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 | 237 | From == UtfEncodings::UTF8) { | 198 | 237 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 237 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 237 | const auto [output_length, length_agree] = | 204 | 237 | calculate_length(from, inputisvalid); | 205 | 237 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 237 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 19 | return; | 211 | 19 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 218 | const auto [written, outputs_agree] = | 215 | 218 | do_conversion(from, output_length, inputisvalid); | 216 | 218 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 218 | return; | 221 | 218 | } 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 | 237 | } |
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 | 424 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 424 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 424 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 424 | static const bool do_print_testcase = | 181 | 424 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 424 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 424 | do { | 189 | | // step 0 - is the input valid? | 190 | 424 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 424 | 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 | 424 | From == UtfEncodings::UTF8) { | 198 | 424 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 424 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 424 | const auto [output_length, length_agree] = | 204 | 424 | calculate_length(from, inputisvalid); | 205 | 424 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 424 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 19 | return; | 211 | 19 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 405 | const auto [written, outputs_agree] = | 215 | 405 | do_conversion(from, output_length, inputisvalid); | 216 | 405 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 405 | return; | 221 | 405 | } 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 | 424 | } |
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 | 220 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 220 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 220 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 220 | static const bool do_print_testcase = | 181 | 220 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 220 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 220 | do { | 189 | | // step 0 - is the input valid? | 190 | 220 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 220 | 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 | 220 | From == UtfEncodings::UTF8) { | 198 | 220 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 220 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 220 | const auto [output_length, length_agree] = | 204 | 220 | calculate_length(from, inputisvalid); | 205 | 220 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 220 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 7 | return; | 211 | 7 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 213 | const auto [written, outputs_agree] = | 215 | 213 | do_conversion(from, output_length, inputisvalid); | 216 | 213 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 213 | return; | 221 | 213 | } 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 | 220 | } |
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 | 452 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 452 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 452 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 452 | static const bool do_print_testcase = | 181 | 452 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 452 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 452 | do { | 189 | | // step 0 - is the input valid? | 190 | 452 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 452 | 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 | 452 | From == UtfEncodings::UTF8) { | 198 | 452 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 452 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 452 | const auto [output_length, length_agree] = | 204 | 452 | calculate_length(from, inputisvalid); | 205 | 452 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 452 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 13 | return; | 211 | 13 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 439 | const auto [written, outputs_agree] = | 215 | 439 | do_conversion(from, output_length, inputisvalid); | 216 | 439 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 439 | return; | 221 | 439 | } 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 | 452 | } |
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 | 331 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 331 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 331 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 331 | static const bool do_print_testcase = | 181 | 331 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 331 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 331 | do { | 189 | | // step 0 - is the input valid? | 190 | 331 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 331 | 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 | 331 | const auto [output_length, length_agree] = | 204 | 331 | calculate_length(from, inputisvalid); | 205 | 331 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 331 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 5 | return; | 211 | 5 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 326 | const auto [written, outputs_agree] = | 215 | 326 | do_conversion(from, output_length, inputisvalid); | 216 | 326 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 326 | return; | 221 | 326 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 331 | } |
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 | 401 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 401 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 401 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 401 | static const bool do_print_testcase = | 181 | 401 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 401 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 401 | do { | 189 | | // step 0 - is the input valid? | 190 | 401 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 401 | 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 | 401 | const auto [output_length, length_agree] = | 204 | 401 | calculate_length(from, inputisvalid); | 205 | 401 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 401 | 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 | 397 | const auto [written, outputs_agree] = | 215 | 397 | do_conversion(from, output_length, inputisvalid); | 216 | 397 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 397 | return; | 221 | 397 | } 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 | 401 | } |
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 | 462 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 462 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 462 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 462 | static const bool do_print_testcase = | 181 | 462 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 462 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 462 | do { | 189 | | // step 0 - is the input valid? | 190 | 462 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 462 | 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 | 462 | const auto [output_length, length_agree] = | 204 | 462 | calculate_length(from, inputisvalid); | 205 | 462 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 462 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 8 | return; | 211 | 8 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 454 | const auto [written, outputs_agree] = | 215 | 454 | do_conversion(from, output_length, inputisvalid); | 216 | 454 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 454 | return; | 221 | 454 | } 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 | 462 | } |
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 | 726 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 726 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 726 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 726 | static const bool do_print_testcase = | 181 | 726 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 726 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 726 | do { | 189 | | // step 0 - is the input valid? | 190 | 726 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 726 | 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 | 726 | From == UtfEncodings::UTF8) { | 198 | 726 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 726 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 726 | const auto [output_length, length_agree] = | 204 | 726 | calculate_length(from, inputisvalid); | 205 | 726 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 726 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 11 | return; | 211 | 11 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 715 | const auto [written, outputs_agree] = | 215 | 715 | do_conversion(from, output_length, inputisvalid); | 216 | 715 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 715 | return; | 221 | 715 | } 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 | 726 | } |
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 | 656 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 656 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 656 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 656 | static const bool do_print_testcase = | 181 | 656 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 656 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 656 | do { | 189 | | // step 0 - is the input valid? | 190 | 656 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 656 | 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 | 656 | From == UtfEncodings::UTF8) { | 198 | 656 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 656 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 656 | const auto [output_length, length_agree] = | 204 | 656 | calculate_length(from, inputisvalid); | 205 | 656 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 656 | 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 | 647 | const auto [written, outputs_agree] = | 215 | 647 | do_conversion(from, output_length, inputisvalid); | 216 | 647 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 647 | return; | 221 | 647 | } 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 | 656 | } |
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 | 742 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 742 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 742 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 742 | static const bool do_print_testcase = | 181 | 742 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 742 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 742 | do { | 189 | | // step 0 - is the input valid? | 190 | 742 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 742 | 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 | 742 | From == UtfEncodings::UTF8) { | 198 | 742 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 742 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 742 | const auto [output_length, length_agree] = | 204 | 742 | calculate_length(from, inputisvalid); | 205 | 742 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 742 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 11 | return; | 211 | 11 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 731 | const auto [written, outputs_agree] = | 215 | 731 | do_conversion(from, output_length, inputisvalid); | 216 | 731 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 731 | return; | 221 | 731 | } 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 | 742 | } |
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 | 58 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 58 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 58 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 58 | static const bool do_print_testcase = | 181 | 58 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 58 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 58 | do { | 189 | | // step 0 - is the input valid? | 190 | 58 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 58 | 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 | 58 | From == UtfEncodings::UTF8) { | 198 | 58 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 58 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 58 | const auto [output_length, length_agree] = | 204 | 58 | calculate_length(from, inputisvalid); | 205 | 58 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 58 | 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 | 58 | const auto [written, outputs_agree] = | 215 | 58 | do_conversion(from, output_length, inputisvalid); | 216 | 58 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 58 | return; | 221 | 58 | } 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 | 58 | } |
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 | 67 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 67 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 67 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 67 | static const bool do_print_testcase = | 181 | 67 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 67 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 67 | do { | 189 | | // step 0 - is the input valid? | 190 | 67 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 67 | 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 | 67 | From == UtfEncodings::UTF8) { | 198 | 67 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 67 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 67 | const auto [output_length, length_agree] = | 204 | 67 | calculate_length(from, inputisvalid); | 205 | 67 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 67 | 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 | 67 | const auto [written, outputs_agree] = | 215 | 67 | do_conversion(from, output_length, inputisvalid); | 216 | 67 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 67 | return; | 221 | 67 | } 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 | 67 | } |
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 | 93 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 93 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 93 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 93 | static const bool do_print_testcase = | 181 | 93 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 93 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 93 | do { | 189 | | // step 0 - is the input valid? | 190 | 93 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 93 | 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 | 93 | const auto [output_length, length_agree] = | 204 | 93 | calculate_length(from, inputisvalid); | 205 | 93 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 93 | 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 | 93 | const auto [written, outputs_agree] = | 215 | 93 | do_conversion(from, output_length, inputisvalid); | 216 | 93 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 93 | return; | 221 | 93 | } 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 | 93 | } |
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 | 358 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 358 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 358 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 358 | static const bool do_print_testcase = | 181 | 358 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 358 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 358 | do { | 189 | | // step 0 - is the input valid? | 190 | 358 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 358 | 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 | 358 | From == UtfEncodings::UTF8) { | 198 | 358 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 358 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 358 | const auto [output_length, length_agree] = | 204 | 358 | calculate_length(from, inputisvalid); | 205 | 358 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 358 | 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 | 358 | const auto [written, outputs_agree] = | 215 | 358 | do_conversion(from, output_length, inputisvalid); | 216 | 358 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 358 | return; | 221 | 358 | } 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 | 358 | } |
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 | 124 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 124 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 124 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 124 | static const bool do_print_testcase = | 181 | 124 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 124 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 124 | do { | 189 | | // step 0 - is the input valid? | 190 | 124 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 124 | 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 | 124 | From == UtfEncodings::UTF8) { | 198 | 124 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 124 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 124 | const auto [output_length, length_agree] = | 204 | 124 | calculate_length(from, inputisvalid); | 205 | 124 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 124 | 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 | 124 | const auto [written, outputs_agree] = | 215 | 124 | do_conversion(from, output_length, inputisvalid); | 216 | 124 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 124 | return; | 221 | 124 | } 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 | 124 | } |
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 | 183 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 183 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 183 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 183 | static const bool do_print_testcase = | 181 | 183 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 183 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 183 | do { | 189 | | // step 0 - is the input valid? | 190 | 183 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 183 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 183 | From == UtfEncodings::UTF8) { | 198 | 183 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 183 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 183 | const auto [output_length, length_agree] = | 204 | 183 | calculate_length(from, inputisvalid); | 205 | 183 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 183 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 183 | const auto [written, outputs_agree] = | 215 | 183 | do_conversion(from, output_length, inputisvalid); | 216 | 183 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 183 | return; | 221 | 183 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 183 | } |
Conversion<(UtfEncodings)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 | 308 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 308 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 308 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 308 | static const bool do_print_testcase = | 181 | 308 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 308 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 308 | do { | 189 | | // step 0 - is the input valid? | 190 | 308 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 308 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 308 | From == UtfEncodings::UTF8) { | 198 | 308 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 308 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 308 | const auto [output_length, length_agree] = | 204 | 308 | calculate_length(from, inputisvalid); | 205 | 308 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 308 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 308 | const auto [written, outputs_agree] = | 215 | 308 | do_conversion(from, output_length, inputisvalid); | 216 | 308 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 308 | return; | 221 | 308 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 308 | } |
Conversion<(UtfEncodings)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 | 132 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 132 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 132 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 132 | static const bool do_print_testcase = | 181 | 132 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 132 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 132 | do { | 189 | | // step 0 - is the input valid? | 190 | 132 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 132 | 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 | 132 | From == UtfEncodings::UTF8) { | 198 | 132 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 132 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 132 | const auto [output_length, length_agree] = | 204 | 132 | calculate_length(from, inputisvalid); | 205 | 132 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 132 | 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 | 132 | const auto [written, outputs_agree] = | 215 | 132 | do_conversion(from, output_length, inputisvalid); | 216 | 132 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 132 | return; | 221 | 132 | } 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 | 132 | } |
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 | 193 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 193 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 193 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 193 | static const bool do_print_testcase = | 181 | 193 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 193 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 193 | do { | 189 | | // step 0 - is the input valid? | 190 | 193 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 193 | 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 | 193 | From == UtfEncodings::UTF8) { | 198 | 193 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 193 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 193 | const auto [output_length, length_agree] = | 204 | 193 | calculate_length(from, inputisvalid); | 205 | 193 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 193 | 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 | 193 | const auto [written, outputs_agree] = | 215 | 193 | do_conversion(from, output_length, inputisvalid); | 216 | 193 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 193 | return; | 221 | 193 | } 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 | 193 | } |
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 | 356 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 356 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 356 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 356 | static const bool do_print_testcase = | 181 | 356 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 356 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 356 | do { | 189 | | // step 0 - is the input valid? | 190 | 356 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 356 | 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 | 356 | From == UtfEncodings::UTF8) { | 198 | 356 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 356 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 356 | const auto [output_length, length_agree] = | 204 | 356 | calculate_length(from, inputisvalid); | 205 | 356 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 356 | 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 | 356 | const auto [written, outputs_agree] = | 215 | 356 | do_conversion(from, output_length, inputisvalid); | 216 | 356 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 356 | return; | 221 | 356 | } 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 | 356 | } |
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 | 244 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 244 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 244 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 244 | static const bool do_print_testcase = | 181 | 244 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 244 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 244 | do { | 189 | | // step 0 - is the input valid? | 190 | 244 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 244 | 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 | 244 | const auto [output_length, length_agree] = | 204 | 244 | calculate_length(from, inputisvalid); | 205 | 244 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 244 | 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 | 244 | const auto [written, outputs_agree] = | 215 | 244 | do_conversion(from, output_length, inputisvalid); | 216 | 244 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 244 | return; | 221 | 244 | } 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 | 244 | } |
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 | 339 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 339 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 339 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 339 | static const bool do_print_testcase = | 181 | 339 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 339 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 339 | do { | 189 | | // step 0 - is the input valid? | 190 | 339 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 339 | 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 | 339 | const auto [output_length, length_agree] = | 204 | 339 | calculate_length(from, inputisvalid); | 205 | 339 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 339 | 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 | 339 | const auto [written, outputs_agree] = | 215 | 339 | do_conversion(from, output_length, inputisvalid); | 216 | 339 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 339 | return; | 221 | 339 | } 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 | 339 | } |
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 | 386 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 386 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 386 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 386 | static const bool do_print_testcase = | 181 | 386 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 386 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 386 | do { | 189 | | // step 0 - is the input valid? | 190 | 386 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 386 | 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 | 386 | const auto [output_length, length_agree] = | 204 | 386 | calculate_length(from, inputisvalid); | 205 | 386 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 386 | 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 | 386 | const auto [written, outputs_agree] = | 215 | 386 | do_conversion(from, output_length, inputisvalid); | 216 | 386 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 386 | return; | 221 | 386 | } 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 | 386 | } |
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 | 430 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 430 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 430 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 430 | static const bool do_print_testcase = | 181 | 430 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 430 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 430 | do { | 189 | | // step 0 - is the input valid? | 190 | 430 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 430 | 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 | 430 | const auto [output_length, length_agree] = | 204 | 430 | calculate_length(from, inputisvalid); | 205 | 430 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 430 | 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 | 430 | const auto [written, outputs_agree] = | 215 | 430 | do_conversion(from, output_length, inputisvalid); | 216 | 430 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 430 | return; | 221 | 430 | } 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 | 430 | } |
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 | 335 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 335 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 335 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 335 | static const bool do_print_testcase = | 181 | 335 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 335 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 335 | do { | 189 | | // step 0 - is the input valid? | 190 | 335 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 335 | 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 | 335 | From == UtfEncodings::UTF8) { | 198 | 335 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 335 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 335 | const auto [output_length, length_agree] = | 204 | 335 | calculate_length(from, inputisvalid); | 205 | 335 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 335 | 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 | 335 | const auto [written, outputs_agree] = | 215 | 335 | do_conversion(from, output_length, inputisvalid); | 216 | 335 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 335 | return; | 221 | 335 | } 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 | 335 | } |
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 | 451 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 451 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 451 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 451 | static const bool do_print_testcase = | 181 | 451 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 451 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 451 | do { | 189 | | // step 0 - is the input valid? | 190 | 451 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 451 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 451 | From == UtfEncodings::UTF8) { | 198 | 451 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 451 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 451 | const auto [output_length, length_agree] = | 204 | 451 | calculate_length(from, inputisvalid); | 205 | 451 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 451 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 451 | const auto [written, outputs_agree] = | 215 | 451 | do_conversion(from, output_length, inputisvalid); | 216 | 451 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 451 | return; | 221 | 451 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)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 | 391 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 391 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 391 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 391 | static const bool do_print_testcase = | 181 | 391 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 391 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 391 | do { | 189 | | // step 0 - is the input valid? | 190 | 391 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 391 | 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 | 391 | From == UtfEncodings::UTF8) { | 198 | 391 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 391 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 391 | const auto [output_length, length_agree] = | 204 | 391 | calculate_length(from, inputisvalid); | 205 | 391 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 391 | 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 | 391 | const auto [written, outputs_agree] = | 215 | 391 | do_conversion(from, output_length, inputisvalid); | 216 | 391 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 391 | return; | 221 | 391 | } 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 | 391 | } |
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 | 459 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 459 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 459 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 459 | static const bool do_print_testcase = | 181 | 459 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 459 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 459 | do { | 189 | | // step 0 - is the input valid? | 190 | 459 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 459 | 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 | 459 | From == UtfEncodings::UTF8) { | 198 | 459 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 459 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 459 | const auto [output_length, length_agree] = | 204 | 459 | calculate_length(from, inputisvalid); | 205 | 459 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 459 | 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 | 459 | const auto [written, outputs_agree] = | 215 | 459 | do_conversion(from, output_length, inputisvalid); | 216 | 459 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 459 | return; | 221 | 459 | } 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 | 459 | } |
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 | 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)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 | 54 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 54 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 54 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 54 | static const bool do_print_testcase = | 181 | 54 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 54 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 54 | do { | 189 | | // step 0 - is the input valid? | 190 | 54 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 54 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | 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 | 54 | const auto [output_length, length_agree] = | 204 | 54 | calculate_length(from, inputisvalid); | 205 | 54 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 54 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 54 | const auto [written, outputs_agree] = | 215 | 54 | do_conversion(from, output_length, inputisvalid); | 216 | 54 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 54 | return; | 221 | 54 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 54 | } |
Conversion<(UtfEncodings)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 | 243 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 243 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 243 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 243 | static const bool do_print_testcase = | 181 | 243 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 243 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 243 | do { | 189 | | // step 0 - is the input valid? | 190 | 243 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 243 | 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 | 243 | const auto [output_length, length_agree] = | 204 | 243 | calculate_length(from, inputisvalid); | 205 | 243 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 243 | 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 | 243 | const auto [written, outputs_agree] = | 215 | 243 | do_conversion(from, output_length, inputisvalid); | 216 | 243 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 243 | return; | 221 | 243 | } 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 | 243 | } |
|
227 | | |
228 | | template <typename Dummy = void> |
229 | | requires(From != UtfEncodings::LATIN1) |
230 | 9.55k | validation_result verify_valid_input(FromSpan src) const { |
231 | 9.55k | validation_result ret{}; |
232 | | |
233 | 9.55k | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; |
234 | 9.55k | const auto implementations = get_supported_implementations(); |
235 | 9.55k | std::vector<simdutf::result> results; |
236 | 9.55k | results.reserve(implementations.size()); |
237 | | |
238 | 28.6k | for (auto impl : implementations) { |
239 | 28.6k | results.push_back( |
240 | 28.6k | std::invoke(input_validation, impl, src.data(), src.size())); |
241 | | |
242 | | // make sure the validation variant that returns a bool agrees |
243 | 28.6k | const bool validation1 = results.back().error == simdutf::SUCCESS; |
244 | 28.6k | const bool validation2 = |
245 | 28.6k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, |
246 | 28.6k | src.data(), src.size()); |
247 | 28.6k | 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 | 28.6k | } |
258 | | |
259 | 19.1k | 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 | 474 | 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 | 848 | 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 | 440 | 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 | 904 | 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 | 662 | 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 | 802 | 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 | 924 | 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.45k | 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.31k | 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.48k | 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 | 116 | 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 | 134 | 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 | 186 | 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 | 716 | 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 | 248 | 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 | 366 | 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 | 616 | 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 | 264 | 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 | 386 | 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 | 712 | 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 | 488 | 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 | 678 | 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 | 772 | 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 | 860 | 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 | 670 | 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 | 902 | 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 | 782 | 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 | 918 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
260 | 9.55k | 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 | 9.55k | } else { |
273 | 9.55k | ret.implementations_agree = true; |
274 | 9.55k | } |
275 | 18.2k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { |
276 | 18.2k | return r.error == simdutf::SUCCESS; |
277 | 18.2k | }); _ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 475 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 475 | return r.error == simdutf::SUCCESS; | 277 | 475 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.04k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.04k | return r.error == simdutf::SUCCESS; | 277 | 1.04k | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 464 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 464 | return r.error == simdutf::SUCCESS; | 277 | 464 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_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 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 613 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 613 | return r.error == simdutf::SUCCESS; | 277 | 613 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 829 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 829 | return r.error == simdutf::SUCCESS; | 277 | 829 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 794 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 794 | return r.error == simdutf::SUCCESS; | 277 | 794 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.41k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.41k | return r.error == simdutf::SUCCESS; | 277 | 1.41k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.25k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.25k | return r.error == simdutf::SUCCESS; | 277 | 1.25k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.49k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.49k | return r.error == simdutf::SUCCESS; | 277 | 1.49k | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 150 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 150 | return r.error == simdutf::SUCCESS; | 277 | 150 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 165 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 165 | return r.error == simdutf::SUCCESS; | 277 | 165 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 131 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 131 | return r.error == simdutf::SUCCESS; | 277 | 131 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 574 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 574 | return r.error == simdutf::SUCCESS; | 277 | 574 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 336 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 336 | return r.error == simdutf::SUCCESS; | 277 | 336 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 353 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 353 | return r.error == simdutf::SUCCESS; | 277 | 353 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 680 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 680 | return r.error == simdutf::SUCCESS; | 277 | 680 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 360 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 360 | return r.error == simdutf::SUCCESS; | 277 | 360 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 381 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 381 | return r.error == simdutf::SUCCESS; | 277 | 381 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 796 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 796 | return r.error == simdutf::SUCCESS; | 277 | 796 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 314 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 314 | return r.error == simdutf::SUCCESS; | 277 | 314 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 519 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 519 | return r.error == simdutf::SUCCESS; | 277 | 519 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 562 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 562 | return r.error == simdutf::SUCCESS; | 277 | 562 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 636 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 636 | return r.error == simdutf::SUCCESS; | 277 | 636 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 589 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 589 | return r.error == simdutf::SUCCESS; | 277 | 589 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 811 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 811 | return r.error == simdutf::SUCCESS; | 277 | 811 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 627 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 627 | return r.error == simdutf::SUCCESS; | 277 | 627 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 783 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 783 | return r.error == simdutf::SUCCESS; | 277 | 783 | }); |
|
278 | 9.55k | return ret; |
279 | 9.55k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 237 | validation_result verify_valid_input(FromSpan src) const { | 231 | 237 | validation_result ret{}; | 232 | | | 233 | 237 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 237 | const auto implementations = get_supported_implementations(); | 235 | 237 | std::vector<simdutf::result> results; | 236 | 237 | results.reserve(implementations.size()); | 237 | | | 238 | 711 | for (auto impl : implementations) { | 239 | 711 | results.push_back( | 240 | 711 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 711 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 711 | const bool validation2 = | 245 | 711 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 711 | src.data(), src.size()); | 247 | 711 | 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 | 711 | } | 258 | | | 259 | 237 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 237 | 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 | 237 | } else { | 273 | 237 | ret.implementations_agree = true; | 274 | 237 | } | 275 | 237 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 237 | return r.error == simdutf::SUCCESS; | 277 | 237 | }); | 278 | 237 | return ret; | 279 | 237 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 424 | validation_result verify_valid_input(FromSpan src) const { | 231 | 424 | validation_result ret{}; | 232 | | | 233 | 424 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 424 | const auto implementations = get_supported_implementations(); | 235 | 424 | std::vector<simdutf::result> results; | 236 | 424 | results.reserve(implementations.size()); | 237 | | | 238 | 1.27k | for (auto impl : implementations) { | 239 | 1.27k | results.push_back( | 240 | 1.27k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.27k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.27k | const bool validation2 = | 245 | 1.27k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.27k | src.data(), src.size()); | 247 | 1.27k | 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.27k | } | 258 | | | 259 | 424 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 424 | 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 | 424 | } else { | 273 | 424 | ret.implementations_agree = true; | 274 | 424 | } | 275 | 424 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 424 | return r.error == simdutf::SUCCESS; | 277 | 424 | }); | 278 | 424 | return ret; | 279 | 424 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 220 | validation_result verify_valid_input(FromSpan src) const { | 231 | 220 | validation_result ret{}; | 232 | | | 233 | 220 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 220 | const auto implementations = get_supported_implementations(); | 235 | 220 | std::vector<simdutf::result> results; | 236 | 220 | results.reserve(implementations.size()); | 237 | | | 238 | 660 | for (auto impl : implementations) { | 239 | 660 | results.push_back( | 240 | 660 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 660 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 660 | const bool validation2 = | 245 | 660 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 660 | src.data(), src.size()); | 247 | 660 | 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 | 660 | } | 258 | | | 259 | 220 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 220 | 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 | 220 | } else { | 273 | 220 | ret.implementations_agree = true; | 274 | 220 | } | 275 | 220 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 220 | return r.error == simdutf::SUCCESS; | 277 | 220 | }); | 278 | 220 | return ret; | 279 | 220 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 452 | validation_result verify_valid_input(FromSpan src) const { | 231 | 452 | validation_result ret{}; | 232 | | | 233 | 452 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 452 | const auto implementations = get_supported_implementations(); | 235 | 452 | std::vector<simdutf::result> results; | 236 | 452 | results.reserve(implementations.size()); | 237 | | | 238 | 1.35k | for (auto impl : implementations) { | 239 | 1.35k | results.push_back( | 240 | 1.35k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.35k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.35k | const bool validation2 = | 245 | 1.35k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.35k | src.data(), src.size()); | 247 | 1.35k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.35k | } | 258 | | | 259 | 452 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 452 | 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 | 452 | } else { | 273 | 452 | ret.implementations_agree = true; | 274 | 452 | } | 275 | 452 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 452 | return r.error == simdutf::SUCCESS; | 277 | 452 | }); | 278 | 452 | return ret; | 279 | 452 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 331 | validation_result verify_valid_input(FromSpan src) const { | 231 | 331 | validation_result ret{}; | 232 | | | 233 | 331 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 331 | const auto implementations = get_supported_implementations(); | 235 | 331 | std::vector<simdutf::result> results; | 236 | 331 | results.reserve(implementations.size()); | 237 | | | 238 | 993 | for (auto impl : implementations) { | 239 | 993 | results.push_back( | 240 | 993 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 993 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 993 | const bool validation2 = | 245 | 993 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 993 | src.data(), src.size()); | 247 | 993 | 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 | 993 | } | 258 | | | 259 | 331 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 331 | 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 | 331 | } else { | 273 | 331 | ret.implementations_agree = true; | 274 | 331 | } | 275 | 331 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 331 | return r.error == simdutf::SUCCESS; | 277 | 331 | }); | 278 | 331 | return ret; | 279 | 331 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 401 | validation_result verify_valid_input(FromSpan src) const { | 231 | 401 | validation_result ret{}; | 232 | | | 233 | 401 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 401 | const auto implementations = get_supported_implementations(); | 235 | 401 | std::vector<simdutf::result> results; | 236 | 401 | results.reserve(implementations.size()); | 237 | | | 238 | 1.20k | for (auto impl : implementations) { | 239 | 1.20k | results.push_back( | 240 | 1.20k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.20k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.20k | const bool validation2 = | 245 | 1.20k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.20k | src.data(), src.size()); | 247 | 1.20k | 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.20k | } | 258 | | | 259 | 401 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 401 | 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 | 401 | } else { | 273 | 401 | ret.implementations_agree = true; | 274 | 401 | } | 275 | 401 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 401 | return r.error == simdutf::SUCCESS; | 277 | 401 | }); | 278 | 401 | return ret; | 279 | 401 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 462 | validation_result verify_valid_input(FromSpan src) const { | 231 | 462 | validation_result ret{}; | 232 | | | 233 | 462 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 462 | const auto implementations = get_supported_implementations(); | 235 | 462 | std::vector<simdutf::result> results; | 236 | 462 | results.reserve(implementations.size()); | 237 | | | 238 | 1.38k | for (auto impl : implementations) { | 239 | 1.38k | results.push_back( | 240 | 1.38k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.38k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.38k | const bool validation2 = | 245 | 1.38k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.38k | src.data(), src.size()); | 247 | 1.38k | 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.38k | } | 258 | | | 259 | 462 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 462 | 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 | 462 | } else { | 273 | 462 | ret.implementations_agree = true; | 274 | 462 | } | 275 | 462 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 462 | return r.error == simdutf::SUCCESS; | 277 | 462 | }); | 278 | 462 | return ret; | 279 | 462 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 726 | validation_result verify_valid_input(FromSpan src) const { | 231 | 726 | validation_result ret{}; | 232 | | | 233 | 726 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 726 | const auto implementations = get_supported_implementations(); | 235 | 726 | std::vector<simdutf::result> results; | 236 | 726 | results.reserve(implementations.size()); | 237 | | | 238 | 2.17k | for (auto impl : implementations) { | 239 | 2.17k | results.push_back( | 240 | 2.17k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 2.17k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 2.17k | const bool validation2 = | 245 | 2.17k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 2.17k | src.data(), src.size()); | 247 | 2.17k | 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 | 2.17k | } | 258 | | | 259 | 726 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 726 | 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 | 726 | } else { | 273 | 726 | ret.implementations_agree = true; | 274 | 726 | } | 275 | 726 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 726 | return r.error == simdutf::SUCCESS; | 277 | 726 | }); | 278 | 726 | return ret; | 279 | 726 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 656 | validation_result verify_valid_input(FromSpan src) const { | 231 | 656 | validation_result ret{}; | 232 | | | 233 | 656 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 656 | const auto implementations = get_supported_implementations(); | 235 | 656 | std::vector<simdutf::result> results; | 236 | 656 | results.reserve(implementations.size()); | 237 | | | 238 | 1.96k | for (auto impl : implementations) { | 239 | 1.96k | results.push_back( | 240 | 1.96k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.96k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.96k | const bool validation2 = | 245 | 1.96k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.96k | src.data(), src.size()); | 247 | 1.96k | 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.96k | } | 258 | | | 259 | 656 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 656 | 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 | 656 | } else { | 273 | 656 | ret.implementations_agree = true; | 274 | 656 | } | 275 | 656 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 656 | return r.error == simdutf::SUCCESS; | 277 | 656 | }); | 278 | 656 | return ret; | 279 | 656 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 742 | validation_result verify_valid_input(FromSpan src) const { | 231 | 742 | validation_result ret{}; | 232 | | | 233 | 742 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 742 | const auto implementations = get_supported_implementations(); | 235 | 742 | std::vector<simdutf::result> results; | 236 | 742 | results.reserve(implementations.size()); | 237 | | | 238 | 2.22k | for (auto impl : implementations) { | 239 | 2.22k | results.push_back( | 240 | 2.22k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 2.22k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 2.22k | const bool validation2 = | 245 | 2.22k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 2.22k | src.data(), src.size()); | 247 | 2.22k | 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 | 2.22k | } | 258 | | | 259 | 742 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 742 | 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 | 742 | } else { | 273 | 742 | ret.implementations_agree = true; | 274 | 742 | } | 275 | 742 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 742 | return r.error == simdutf::SUCCESS; | 277 | 742 | }); | 278 | 742 | return ret; | 279 | 742 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 58 | validation_result verify_valid_input(FromSpan src) const { | 231 | 58 | validation_result ret{}; | 232 | | | 233 | 58 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 58 | const auto implementations = get_supported_implementations(); | 235 | 58 | std::vector<simdutf::result> results; | 236 | 58 | results.reserve(implementations.size()); | 237 | | | 238 | 174 | for (auto impl : implementations) { | 239 | 174 | results.push_back( | 240 | 174 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 174 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 174 | const bool validation2 = | 245 | 174 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 174 | src.data(), src.size()); | 247 | 174 | 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 | 174 | } | 258 | | | 259 | 58 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 58 | 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 | 58 | } else { | 273 | 58 | ret.implementations_agree = true; | 274 | 58 | } | 275 | 58 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 58 | return r.error == simdutf::SUCCESS; | 277 | 58 | }); | 278 | 58 | return ret; | 279 | 58 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 67 | validation_result verify_valid_input(FromSpan src) const { | 231 | 67 | validation_result ret{}; | 232 | | | 233 | 67 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 67 | const auto implementations = get_supported_implementations(); | 235 | 67 | std::vector<simdutf::result> results; | 236 | 67 | results.reserve(implementations.size()); | 237 | | | 238 | 201 | for (auto impl : implementations) { | 239 | 201 | results.push_back( | 240 | 201 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 201 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 201 | const bool validation2 = | 245 | 201 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 201 | src.data(), src.size()); | 247 | 201 | 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 | 201 | } | 258 | | | 259 | 67 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 67 | 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 | 67 | } else { | 273 | 67 | ret.implementations_agree = true; | 274 | 67 | } | 275 | 67 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 67 | return r.error == simdutf::SUCCESS; | 277 | 67 | }); | 278 | 67 | return ret; | 279 | 67 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 93 | validation_result verify_valid_input(FromSpan src) const { | 231 | 93 | validation_result ret{}; | 232 | | | 233 | 93 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 93 | const auto implementations = get_supported_implementations(); | 235 | 93 | std::vector<simdutf::result> results; | 236 | 93 | results.reserve(implementations.size()); | 237 | | | 238 | 279 | for (auto impl : implementations) { | 239 | 279 | results.push_back( | 240 | 279 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 279 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 279 | const bool validation2 = | 245 | 279 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 279 | src.data(), src.size()); | 247 | 279 | 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 | 279 | } | 258 | | | 259 | 93 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 93 | 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 | 93 | } else { | 273 | 93 | ret.implementations_agree = true; | 274 | 93 | } | 275 | 93 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 93 | return r.error == simdutf::SUCCESS; | 277 | 93 | }); | 278 | 93 | return ret; | 279 | 93 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 358 | validation_result verify_valid_input(FromSpan src) const { | 231 | 358 | validation_result ret{}; | 232 | | | 233 | 358 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 358 | const auto implementations = get_supported_implementations(); | 235 | 358 | std::vector<simdutf::result> results; | 236 | 358 | results.reserve(implementations.size()); | 237 | | | 238 | 1.07k | for (auto impl : implementations) { | 239 | 1.07k | results.push_back( | 240 | 1.07k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.07k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.07k | const bool validation2 = | 245 | 1.07k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.07k | src.data(), src.size()); | 247 | 1.07k | 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.07k | } | 258 | | | 259 | 358 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 358 | 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 | 358 | } else { | 273 | 358 | ret.implementations_agree = true; | 274 | 358 | } | 275 | 358 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 358 | return r.error == simdutf::SUCCESS; | 277 | 358 | }); | 278 | 358 | return ret; | 279 | 358 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 124 | validation_result verify_valid_input(FromSpan src) const { | 231 | 124 | validation_result ret{}; | 232 | | | 233 | 124 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 124 | const auto implementations = get_supported_implementations(); | 235 | 124 | std::vector<simdutf::result> results; | 236 | 124 | results.reserve(implementations.size()); | 237 | | | 238 | 372 | for (auto impl : implementations) { | 239 | 372 | results.push_back( | 240 | 372 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 372 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 372 | const bool validation2 = | 245 | 372 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 372 | src.data(), src.size()); | 247 | 372 | 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 | 372 | } | 258 | | | 259 | 124 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 124 | 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 | 124 | } else { | 273 | 124 | ret.implementations_agree = true; | 274 | 124 | } | 275 | 124 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 124 | return r.error == simdutf::SUCCESS; | 277 | 124 | }); | 278 | 124 | return ret; | 279 | 124 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 183 | validation_result verify_valid_input(FromSpan src) const { | 231 | 183 | validation_result ret{}; | 232 | | | 233 | 183 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 183 | const auto implementations = get_supported_implementations(); | 235 | 183 | std::vector<simdutf::result> results; | 236 | 183 | results.reserve(implementations.size()); | 237 | | | 238 | 549 | for (auto impl : implementations) { | 239 | 549 | results.push_back( | 240 | 549 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 549 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 549 | const bool validation2 = | 245 | 549 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 549 | src.data(), src.size()); | 247 | 549 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 549 | } | 258 | | | 259 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 183 | } else { | 273 | 183 | ret.implementations_agree = true; | 274 | 183 | } | 275 | 183 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 183 | return r.error == simdutf::SUCCESS; | 277 | 183 | }); | 278 | 183 | return ret; | 279 | 183 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 308 | validation_result verify_valid_input(FromSpan src) const { | 231 | 308 | validation_result ret{}; | 232 | | | 233 | 308 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 308 | const auto implementations = get_supported_implementations(); | 235 | 308 | std::vector<simdutf::result> results; | 236 | 308 | results.reserve(implementations.size()); | 237 | | | 238 | 924 | for (auto impl : implementations) { | 239 | 924 | results.push_back( | 240 | 924 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 924 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 924 | const bool validation2 = | 245 | 924 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 924 | src.data(), src.size()); | 247 | 924 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 924 | } | 258 | | | 259 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 308 | } else { | 273 | 308 | ret.implementations_agree = true; | 274 | 308 | } | 275 | 308 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 308 | return r.error == simdutf::SUCCESS; | 277 | 308 | }); | 278 | 308 | return ret; | 279 | 308 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 132 | validation_result verify_valid_input(FromSpan src) const { | 231 | 132 | validation_result ret{}; | 232 | | | 233 | 132 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 132 | const auto implementations = get_supported_implementations(); | 235 | 132 | std::vector<simdutf::result> results; | 236 | 132 | results.reserve(implementations.size()); | 237 | | | 238 | 396 | for (auto impl : implementations) { | 239 | 396 | results.push_back( | 240 | 396 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 396 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 396 | const bool validation2 = | 245 | 396 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 396 | src.data(), src.size()); | 247 | 396 | 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 | 396 | } | 258 | | | 259 | 132 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 132 | 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 | 132 | } else { | 273 | 132 | ret.implementations_agree = true; | 274 | 132 | } | 275 | 132 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 132 | return r.error == simdutf::SUCCESS; | 277 | 132 | }); | 278 | 132 | return ret; | 279 | 132 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 193 | validation_result verify_valid_input(FromSpan src) const { | 231 | 193 | validation_result ret{}; | 232 | | | 233 | 193 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 193 | const auto implementations = get_supported_implementations(); | 235 | 193 | std::vector<simdutf::result> results; | 236 | 193 | results.reserve(implementations.size()); | 237 | | | 238 | 579 | for (auto impl : implementations) { | 239 | 579 | results.push_back( | 240 | 579 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 579 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 579 | const bool validation2 = | 245 | 579 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 579 | src.data(), src.size()); | 247 | 579 | 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 | 579 | } | 258 | | | 259 | 193 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 193 | 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 | 193 | } else { | 273 | 193 | ret.implementations_agree = true; | 274 | 193 | } | 275 | 193 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 193 | return r.error == simdutf::SUCCESS; | 277 | 193 | }); | 278 | 193 | return ret; | 279 | 193 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 356 | validation_result verify_valid_input(FromSpan src) const { | 231 | 356 | validation_result ret{}; | 232 | | | 233 | 356 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 356 | const auto implementations = get_supported_implementations(); | 235 | 356 | std::vector<simdutf::result> results; | 236 | 356 | results.reserve(implementations.size()); | 237 | | | 238 | 1.06k | for (auto impl : implementations) { | 239 | 1.06k | results.push_back( | 240 | 1.06k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.06k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.06k | const bool validation2 = | 245 | 1.06k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.06k | src.data(), src.size()); | 247 | 1.06k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.06k | } | 258 | | | 259 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 356 | 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 | 356 | } else { | 273 | 356 | ret.implementations_agree = true; | 274 | 356 | } | 275 | 356 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 356 | return r.error == simdutf::SUCCESS; | 277 | 356 | }); | 278 | 356 | return ret; | 279 | 356 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 244 | validation_result verify_valid_input(FromSpan src) const { | 231 | 244 | validation_result ret{}; | 232 | | | 233 | 244 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 244 | const auto implementations = get_supported_implementations(); | 235 | 244 | std::vector<simdutf::result> results; | 236 | 244 | results.reserve(implementations.size()); | 237 | | | 238 | 732 | for (auto impl : implementations) { | 239 | 732 | results.push_back( | 240 | 732 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 732 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 732 | const bool validation2 = | 245 | 732 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 732 | src.data(), src.size()); | 247 | 732 | 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 | 732 | } | 258 | | | 259 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 244 | 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 | 244 | } else { | 273 | 244 | ret.implementations_agree = true; | 274 | 244 | } | 275 | 244 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 244 | return r.error == simdutf::SUCCESS; | 277 | 244 | }); | 278 | 244 | return ret; | 279 | 244 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 339 | validation_result verify_valid_input(FromSpan src) const { | 231 | 339 | validation_result ret{}; | 232 | | | 233 | 339 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 339 | const auto implementations = get_supported_implementations(); | 235 | 339 | std::vector<simdutf::result> results; | 236 | 339 | results.reserve(implementations.size()); | 237 | | | 238 | 1.01k | for (auto impl : implementations) { | 239 | 1.01k | results.push_back( | 240 | 1.01k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.01k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.01k | const bool validation2 = | 245 | 1.01k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.01k | src.data(), src.size()); | 247 | 1.01k | 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.01k | } | 258 | | | 259 | 339 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 339 | 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 | 339 | } else { | 273 | 339 | ret.implementations_agree = true; | 274 | 339 | } | 275 | 339 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 339 | return r.error == simdutf::SUCCESS; | 277 | 339 | }); | 278 | 339 | return ret; | 279 | 339 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 386 | validation_result verify_valid_input(FromSpan src) const { | 231 | 386 | validation_result ret{}; | 232 | | | 233 | 386 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 386 | const auto implementations = get_supported_implementations(); | 235 | 386 | std::vector<simdutf::result> results; | 236 | 386 | results.reserve(implementations.size()); | 237 | | | 238 | 1.15k | for (auto impl : implementations) { | 239 | 1.15k | results.push_back( | 240 | 1.15k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.15k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.15k | const bool validation2 = | 245 | 1.15k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.15k | src.data(), src.size()); | 247 | 1.15k | 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.15k | } | 258 | | | 259 | 386 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 386 | 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 | 386 | } else { | 273 | 386 | ret.implementations_agree = true; | 274 | 386 | } | 275 | 386 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 386 | return r.error == simdutf::SUCCESS; | 277 | 386 | }); | 278 | 386 | return ret; | 279 | 386 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 430 | validation_result verify_valid_input(FromSpan src) const { | 231 | 430 | validation_result ret{}; | 232 | | | 233 | 430 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 430 | const auto implementations = get_supported_implementations(); | 235 | 430 | std::vector<simdutf::result> results; | 236 | 430 | results.reserve(implementations.size()); | 237 | | | 238 | 1.29k | for (auto impl : implementations) { | 239 | 1.29k | results.push_back( | 240 | 1.29k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.29k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.29k | const bool validation2 = | 245 | 1.29k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.29k | src.data(), src.size()); | 247 | 1.29k | 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.29k | } | 258 | | | 259 | 430 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 430 | 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 | 430 | } else { | 273 | 430 | ret.implementations_agree = true; | 274 | 430 | } | 275 | 430 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 430 | return r.error == simdutf::SUCCESS; | 277 | 430 | }); | 278 | 430 | return ret; | 279 | 430 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 335 | validation_result verify_valid_input(FromSpan src) const { | 231 | 335 | validation_result ret{}; | 232 | | | 233 | 335 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 335 | const auto implementations = get_supported_implementations(); | 235 | 335 | std::vector<simdutf::result> results; | 236 | 335 | 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 | 335 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 335 | 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 | 335 | } else { | 273 | 335 | ret.implementations_agree = true; | 274 | 335 | } | 275 | 335 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 335 | return r.error == simdutf::SUCCESS; | 277 | 335 | }); | 278 | 335 | return ret; | 279 | 335 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 451 | validation_result verify_valid_input(FromSpan src) const { | 231 | 451 | validation_result ret{}; | 232 | | | 233 | 451 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 451 | const auto implementations = get_supported_implementations(); | 235 | 451 | std::vector<simdutf::result> results; | 236 | 451 | results.reserve(implementations.size()); | 237 | | | 238 | 1.35k | for (auto impl : implementations) { | 239 | 1.35k | results.push_back( | 240 | 1.35k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.35k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.35k | const bool validation2 = | 245 | 1.35k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.35k | src.data(), src.size()); | 247 | 1.35k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.35k | } | 258 | | | 259 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 451 | } else { | 273 | 451 | ret.implementations_agree = true; | 274 | 451 | } | 275 | 451 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 451 | return r.error == simdutf::SUCCESS; | 277 | 451 | }); | 278 | 451 | return ret; | 279 | 451 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 391 | validation_result verify_valid_input(FromSpan src) const { | 231 | 391 | validation_result ret{}; | 232 | | | 233 | 391 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 391 | const auto implementations = get_supported_implementations(); | 235 | 391 | std::vector<simdutf::result> results; | 236 | 391 | results.reserve(implementations.size()); | 237 | | | 238 | 1.17k | for (auto impl : implementations) { | 239 | 1.17k | results.push_back( | 240 | 1.17k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.17k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.17k | const bool validation2 = | 245 | 1.17k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.17k | src.data(), src.size()); | 247 | 1.17k | 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.17k | } | 258 | | | 259 | 391 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 391 | 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 | 391 | } else { | 273 | 391 | ret.implementations_agree = true; | 274 | 391 | } | 275 | 391 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 391 | return r.error == simdutf::SUCCESS; | 277 | 391 | }); | 278 | 391 | return ret; | 279 | 391 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 459 | validation_result verify_valid_input(FromSpan src) const { | 231 | 459 | validation_result ret{}; | 232 | | | 233 | 459 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 459 | const auto implementations = get_supported_implementations(); | 235 | 459 | std::vector<simdutf::result> results; | 236 | 459 | results.reserve(implementations.size()); | 237 | | | 238 | 1.37k | for (auto impl : implementations) { | 239 | 1.37k | results.push_back( | 240 | 1.37k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.37k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.37k | const bool validation2 = | 245 | 1.37k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.37k | src.data(), src.size()); | 247 | 1.37k | 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.37k | } | 258 | | | 259 | 459 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 459 | 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 | 459 | } else { | 273 | 459 | ret.implementations_agree = true; | 274 | 459 | } | 275 | 459 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 459 | return r.error == simdutf::SUCCESS; | 277 | 459 | }); | 278 | 459 | return ret; | 279 | 459 | } |
|
280 | | |
281 | | template <typename Dummy = void> |
282 | | requires(From == UtfEncodings::LATIN1) |
283 | 389 | validation_result verify_valid_input(FromSpan) const { |
284 | | // all latin1 input is valid. there is no simdutf validation function for |
285 | | // it. |
286 | 389 | return validation_result{.valid = true, .implementations_agree = true}; |
287 | 389 | } _ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_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_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 54 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 54 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 54 | } |
_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 | 243 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 243 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 243 | } |
|
288 | | |
289 | 6.87k | bool count_the_input(FromSpan src) const { |
290 | 6.87k | const auto implementations = get_supported_implementations(); |
291 | 6.87k | std::vector<std::size_t> results; |
292 | 6.87k | results.reserve(implementations.size()); |
293 | | |
294 | 20.6k | for (auto impl : implementations) { |
295 | 20.6k | std::size_t ret; |
296 | 20.6k | if constexpr (From == UtfEncodings::UTF16BE) { |
297 | 4.00k | ret = impl->count_utf16be(src.data(), src.size()); |
298 | 4.26k | } else if constexpr (From == UtfEncodings::UTF16LE) { |
299 | 4.26k | ret = impl->count_utf16le(src.data(), src.size()); |
300 | 12.3k | } else if constexpr (From == UtfEncodings::UTF8) { |
301 | 12.3k | ret = impl->count_utf8(src.data(), src.size()); |
302 | 12.3k | } |
303 | 20.6k | results.push_back(ret); |
304 | 20.6k | } |
305 | 13.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 | 474 | 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 | 848 | 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 | 440 | 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 | 904 | 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.45k | 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.31k | 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.48k | 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 | 116 | 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 | 134 | 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 | 716 | 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 | 248 | 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 | 366 | 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 | 616 | 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 | 264 | 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 | 386 | 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 | 712 | 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 | 670 | 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 | 902 | 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 | 782 | 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 | 918 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
306 | 6.87k | 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.87k | return true; |
321 | 6.87k | } 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 | 237 | bool count_the_input(FromSpan src) const { | 290 | 237 | const auto implementations = get_supported_implementations(); | 291 | 237 | std::vector<std::size_t> results; | 292 | 237 | results.reserve(implementations.size()); | 293 | | | 294 | 711 | for (auto impl : implementations) { | 295 | 711 | std::size_t ret; | 296 | 711 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 711 | 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 | 711 | results.push_back(ret); | 304 | 711 | } | 305 | 237 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 237 | 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 | 237 | return true; | 321 | 237 | } |
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 | 424 | bool count_the_input(FromSpan src) const { | 290 | 424 | const auto implementations = get_supported_implementations(); | 291 | 424 | std::vector<std::size_t> results; | 292 | 424 | results.reserve(implementations.size()); | 293 | | | 294 | 1.27k | for (auto impl : implementations) { | 295 | 1.27k | std::size_t ret; | 296 | 1.27k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.27k | 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.27k | results.push_back(ret); | 304 | 1.27k | } | 305 | 424 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 424 | 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 | 424 | return true; | 321 | 424 | } |
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 | 220 | bool count_the_input(FromSpan src) const { | 290 | 220 | const auto implementations = get_supported_implementations(); | 291 | 220 | std::vector<std::size_t> results; | 292 | 220 | results.reserve(implementations.size()); | 293 | | | 294 | 660 | for (auto impl : implementations) { | 295 | 660 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 660 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 660 | 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 | 660 | results.push_back(ret); | 304 | 660 | } | 305 | 220 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 220 | 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 | 220 | return true; | 321 | 220 | } |
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 | 452 | bool count_the_input(FromSpan src) const { | 290 | 452 | const auto implementations = get_supported_implementations(); | 291 | 452 | std::vector<std::size_t> results; | 292 | 452 | results.reserve(implementations.size()); | 293 | | | 294 | 1.35k | for (auto impl : implementations) { | 295 | 1.35k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.35k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.35k | 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.35k | results.push_back(ret); | 304 | 1.35k | } | 305 | 452 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 452 | 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 | 452 | return true; | 321 | 452 | } |
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 | 726 | bool count_the_input(FromSpan src) const { | 290 | 726 | const auto implementations = get_supported_implementations(); | 291 | 726 | std::vector<std::size_t> results; | 292 | 726 | results.reserve(implementations.size()); | 293 | | | 294 | 2.17k | for (auto impl : implementations) { | 295 | 2.17k | 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 | 2.17k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 2.17k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 2.17k | } | 303 | 2.17k | results.push_back(ret); | 304 | 2.17k | } | 305 | 726 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 726 | 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 | 726 | return true; | 321 | 726 | } |
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 | 656 | bool count_the_input(FromSpan src) const { | 290 | 656 | const auto implementations = get_supported_implementations(); | 291 | 656 | std::vector<std::size_t> results; | 292 | 656 | results.reserve(implementations.size()); | 293 | | | 294 | 1.96k | for (auto impl : implementations) { | 295 | 1.96k | 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.96k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.96k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.96k | } | 303 | 1.96k | results.push_back(ret); | 304 | 1.96k | } | 305 | 656 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 656 | 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 | 656 | return true; | 321 | 656 | } |
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 | 742 | bool count_the_input(FromSpan src) const { | 290 | 742 | const auto implementations = get_supported_implementations(); | 291 | 742 | std::vector<std::size_t> results; | 292 | 742 | results.reserve(implementations.size()); | 293 | | | 294 | 2.22k | for (auto impl : implementations) { | 295 | 2.22k | 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 | 2.22k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 2.22k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 2.22k | } | 303 | 2.22k | results.push_back(ret); | 304 | 2.22k | } | 305 | 742 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 742 | 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 | 742 | return true; | 321 | 742 | } |
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 | 58 | bool count_the_input(FromSpan src) const { | 290 | 58 | const auto implementations = get_supported_implementations(); | 291 | 58 | std::vector<std::size_t> results; | 292 | 58 | results.reserve(implementations.size()); | 293 | | | 294 | 174 | for (auto impl : implementations) { | 295 | 174 | std::size_t ret; | 296 | 174 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 174 | 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 | 174 | results.push_back(ret); | 304 | 174 | } | 305 | 58 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 58 | 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 | 58 | return true; | 321 | 58 | } |
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 | 67 | bool count_the_input(FromSpan src) const { | 290 | 67 | const auto implementations = get_supported_implementations(); | 291 | 67 | std::vector<std::size_t> results; | 292 | 67 | results.reserve(implementations.size()); | 293 | | | 294 | 201 | for (auto impl : implementations) { | 295 | 201 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 201 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 201 | 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 | 201 | results.push_back(ret); | 304 | 201 | } | 305 | 67 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 67 | 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 | 67 | return true; | 321 | 67 | } |
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 | 358 | bool count_the_input(FromSpan src) const { | 290 | 358 | const auto implementations = get_supported_implementations(); | 291 | 358 | std::vector<std::size_t> results; | 292 | 358 | results.reserve(implementations.size()); | 293 | | | 294 | 1.07k | for (auto impl : implementations) { | 295 | 1.07k | 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.07k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.07k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.07k | } | 303 | 1.07k | results.push_back(ret); | 304 | 1.07k | } | 305 | 358 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 358 | 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 | 358 | return true; | 321 | 358 | } |
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 | 124 | bool count_the_input(FromSpan src) const { | 290 | 124 | const auto implementations = get_supported_implementations(); | 291 | 124 | std::vector<std::size_t> results; | 292 | 124 | results.reserve(implementations.size()); | 293 | | | 294 | 372 | for (auto impl : implementations) { | 295 | 372 | std::size_t ret; | 296 | 372 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 372 | 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 | 372 | results.push_back(ret); | 304 | 372 | } | 305 | 124 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 124 | 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 | 124 | return true; | 321 | 124 | } |
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 | 183 | bool count_the_input(FromSpan src) const { | 290 | 183 | const auto implementations = get_supported_implementations(); | 291 | 183 | std::vector<std::size_t> results; | 292 | 183 | results.reserve(implementations.size()); | 293 | | | 294 | 549 | for (auto impl : implementations) { | 295 | 549 | std::size_t ret; | 296 | 549 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 549 | 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 | 549 | results.push_back(ret); | 304 | 549 | } | 305 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 307 | 0 | std::cerr << "begin errormessage for count_the_input()\n"; | 308 | 0 | std::cerr << "in fuzz case for " | 309 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 310 | 0 | << " invoked with " << src.size() << " elements:\n"; | 311 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 312 | 0 | std::cerr << "got return " << std::dec << results[i] | 313 | 0 | << " from implementation " << implementations[i]->name() | 314 | 0 | << '\n'; | 315 | 0 | } | 316 | 0 | std::cerr << "end errormessage\n"; | 317 | 0 | return false; | 318 | 0 | } | 319 | | | 320 | 183 | return true; | 321 | 183 | } |
Conversion<(UtfEncodings)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 | 308 | bool count_the_input(FromSpan src) const { | 290 | 308 | const auto implementations = get_supported_implementations(); | 291 | 308 | std::vector<std::size_t> results; | 292 | 308 | results.reserve(implementations.size()); | 293 | | | 294 | 924 | for (auto impl : implementations) { | 295 | 924 | std::size_t ret; | 296 | 924 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 924 | 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 | 924 | results.push_back(ret); | 304 | 924 | } | 305 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 308 | 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 | 308 | return true; | 321 | 308 | } |
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 | 132 | bool count_the_input(FromSpan src) const { | 290 | 132 | const auto implementations = get_supported_implementations(); | 291 | 132 | std::vector<std::size_t> results; | 292 | 132 | results.reserve(implementations.size()); | 293 | | | 294 | 396 | for (auto impl : implementations) { | 295 | 396 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 396 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 396 | 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 | 396 | results.push_back(ret); | 304 | 396 | } | 305 | 132 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 132 | 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 | 132 | return true; | 321 | 132 | } |
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 | 193 | bool count_the_input(FromSpan src) const { | 290 | 193 | const auto implementations = get_supported_implementations(); | 291 | 193 | std::vector<std::size_t> results; | 292 | 193 | results.reserve(implementations.size()); | 293 | | | 294 | 579 | for (auto impl : implementations) { | 295 | 579 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 579 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 579 | 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 | 579 | results.push_back(ret); | 304 | 579 | } | 305 | 193 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 193 | 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 | 193 | return true; | 321 | 193 | } |
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 | 356 | bool count_the_input(FromSpan src) const { | 290 | 356 | const auto implementations = get_supported_implementations(); | 291 | 356 | std::vector<std::size_t> results; | 292 | 356 | results.reserve(implementations.size()); | 293 | | | 294 | 1.06k | for (auto impl : implementations) { | 295 | 1.06k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.06k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.06k | ret = impl->count_utf16le(src.data(), src.size()); | 300 | | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | | ret = impl->count_utf8(src.data(), src.size()); | 302 | | } | 303 | 1.06k | results.push_back(ret); | 304 | 1.06k | } | 305 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 356 | 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 | 356 | return true; | 321 | 356 | } |
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 | 335 | bool count_the_input(FromSpan src) const { | 290 | 335 | const auto implementations = get_supported_implementations(); | 291 | 335 | std::vector<std::size_t> results; | 292 | 335 | results.reserve(implementations.size()); | 293 | | | 294 | 1.00k | for (auto impl : implementations) { | 295 | 1.00k | 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.00k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.00k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.00k | } | 303 | 1.00k | results.push_back(ret); | 304 | 1.00k | } | 305 | 335 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 335 | 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 | 335 | return true; | 321 | 335 | } |
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 | 451 | bool count_the_input(FromSpan src) const { | 290 | 451 | const auto implementations = get_supported_implementations(); | 291 | 451 | std::vector<std::size_t> results; | 292 | 451 | results.reserve(implementations.size()); | 293 | | | 294 | 1.35k | for (auto impl : implementations) { | 295 | 1.35k | 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.35k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.35k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.35k | } | 303 | 1.35k | results.push_back(ret); | 304 | 1.35k | } | 305 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 451 | 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 | 451 | return true; | 321 | 451 | } |
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 | 391 | bool count_the_input(FromSpan src) const { | 290 | 391 | const auto implementations = get_supported_implementations(); | 291 | 391 | std::vector<std::size_t> results; | 292 | 391 | results.reserve(implementations.size()); | 293 | | | 294 | 1.17k | for (auto impl : implementations) { | 295 | 1.17k | 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.17k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.17k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.17k | } | 303 | 1.17k | results.push_back(ret); | 304 | 1.17k | } | 305 | 391 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 391 | 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 | 391 | return true; | 321 | 391 | } |
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 | 459 | bool count_the_input(FromSpan src) const { | 290 | 459 | const auto implementations = get_supported_implementations(); | 291 | 459 | std::vector<std::size_t> results; | 292 | 459 | results.reserve(implementations.size()); | 293 | | | 294 | 1.37k | for (auto impl : implementations) { | 295 | 1.37k | 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.37k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.37k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.37k | } | 303 | 1.37k | results.push_back(ret); | 304 | 1.37k | } | 305 | 459 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 459 | 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 | 459 | return true; | 321 | 459 | } |
|
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 | 27.2k | FromSpan src) const { |
331 | 27.2k | return std::invoke(lengthcalc, impl, src.data(), src.size()); |
332 | 27.2k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 711 | FromSpan src) const { | 331 | 711 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 711 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.27k | FromSpan src) const { | 331 | 1.27k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.27k | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 660 | FromSpan src) const { | 331 | 660 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 660 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.35k | FromSpan src) const { | 331 | 1.35k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.35k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 993 | FromSpan src) const { | 331 | 993 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 993 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.20k | FromSpan src) const { | 331 | 1.20k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.20k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.38k | FromSpan src) const { | 331 | 1.38k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.38k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 2.17k | FromSpan src) const { | 331 | 2.17k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 2.17k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.96k | FromSpan src) const { | 331 | 1.96k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.96k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 2.22k | FromSpan src) const { | 331 | 2.22k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 2.22k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.07k | FromSpan src) const { | 331 | 1.07k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.07k | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 549 | FromSpan src) const { | 331 | 549 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 549 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 924 | FromSpan src) const { | 331 | 924 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 924 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 579 | FromSpan src) const { | 331 | 579 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 579 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.06k | FromSpan src) const { | 331 | 1.06k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.06k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.01k | FromSpan src) const { | 331 | 1.01k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.01k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.15k | FromSpan src) const { | 331 | 1.15k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.15k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.29k | FromSpan src) const { | 331 | 1.29k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.29k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_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 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.35k | FromSpan src) const { | 331 | 1.35k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.35k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.17k | FromSpan src) const { | 331 | 1.17k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.17k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.37k | FromSpan src) const { | 331 | 1.37k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.37k | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 729 | FromSpan src) const { | 331 | 729 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 729 | } |
|
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.59k | FromSpan src) const { |
339 | 2.59k | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); |
340 | 2.59k | } _ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 174 | FromSpan src) const { | 339 | 174 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 174 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 201 | FromSpan src) const { | 339 | 201 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 201 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 279 | FromSpan src) const { | 339 | 279 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 279 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 372 | FromSpan src) const { | 339 | 372 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 372 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 396 | FromSpan src) const { | 339 | 396 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 396 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 732 | FromSpan src) const { | 339 | 732 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 732 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_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_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 162 | FromSpan src) const { | 339 | 162 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 162 | } |
_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.94k | length_result calculate_length(FromSpan src, const bool inputisvalid) const { |
343 | 9.94k | length_result ret{}; |
344 | | |
345 | 9.94k | const auto implementations = get_supported_implementations(); |
346 | 9.94k | std::vector<std::size_t> results; |
347 | 9.94k | results.reserve(implementations.size()); |
348 | | |
349 | 29.8k | for (auto impl : implementations) { |
350 | 29.8k | const auto len = invoke_lengthcalc(impl, src); |
351 | 29.8k | results.push_back(len); |
352 | 29.8k | ret.length.push_back(len); |
353 | 29.8k | } |
354 | | |
355 | 19.8k | 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 | 474 | 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 | 848 | 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 | 440 | 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 | 904 | 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 | 662 | 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 | 802 | 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 | 924 | 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.45k | 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.31k | 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.48k | 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 | 116 | 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 | 134 | 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 | 186 | 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 | 716 | 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 | 248 | 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 | 366 | 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 | 616 | 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 | 264 | 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 | 386 | 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 | 712 | 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 | 488 | 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 | 678 | 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 | 772 | 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 | 860 | 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 | 670 | 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 | 902 | 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 | 782 | 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 | 918 | 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 | 102 | 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 | 108 | 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 | 486 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
356 | 9.94k | 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.94k | } else { |
375 | 9.94k | ret.implementations_agree = true; |
376 | 9.94k | } |
377 | 9.94k | return ret; |
378 | 9.94k | } 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 | 237 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 237 | length_result ret{}; | 344 | | | 345 | 237 | const auto implementations = get_supported_implementations(); | 346 | 237 | std::vector<std::size_t> results; | 347 | 237 | results.reserve(implementations.size()); | 348 | | | 349 | 711 | for (auto impl : implementations) { | 350 | 711 | const auto len = invoke_lengthcalc(impl, src); | 351 | 711 | results.push_back(len); | 352 | 711 | ret.length.push_back(len); | 353 | 711 | } | 354 | | | 355 | 237 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 237 | 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 | 237 | } else { | 375 | 237 | ret.implementations_agree = true; | 376 | 237 | } | 377 | 237 | return ret; | 378 | 237 | } |
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 | 424 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 424 | length_result ret{}; | 344 | | | 345 | 424 | const auto implementations = get_supported_implementations(); | 346 | 424 | std::vector<std::size_t> results; | 347 | 424 | results.reserve(implementations.size()); | 348 | | | 349 | 1.27k | for (auto impl : implementations) { | 350 | 1.27k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.27k | results.push_back(len); | 352 | 1.27k | ret.length.push_back(len); | 353 | 1.27k | } | 354 | | | 355 | 424 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 424 | 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 | 424 | } else { | 375 | 424 | ret.implementations_agree = true; | 376 | 424 | } | 377 | 424 | return ret; | 378 | 424 | } |
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 | 220 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 220 | length_result ret{}; | 344 | | | 345 | 220 | const auto implementations = get_supported_implementations(); | 346 | 220 | std::vector<std::size_t> results; | 347 | 220 | results.reserve(implementations.size()); | 348 | | | 349 | 660 | for (auto impl : implementations) { | 350 | 660 | const auto len = invoke_lengthcalc(impl, src); | 351 | 660 | results.push_back(len); | 352 | 660 | ret.length.push_back(len); | 353 | 660 | } | 354 | | | 355 | 220 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 220 | 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 | 220 | } else { | 375 | 220 | ret.implementations_agree = true; | 376 | 220 | } | 377 | 220 | return ret; | 378 | 220 | } |
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 | 452 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 452 | length_result ret{}; | 344 | | | 345 | 452 | const auto implementations = get_supported_implementations(); | 346 | 452 | std::vector<std::size_t> results; | 347 | 452 | results.reserve(implementations.size()); | 348 | | | 349 | 1.35k | for (auto impl : implementations) { | 350 | 1.35k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.35k | results.push_back(len); | 352 | 1.35k | ret.length.push_back(len); | 353 | 1.35k | } | 354 | | | 355 | 452 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 452 | 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 | 452 | } else { | 375 | 452 | ret.implementations_agree = true; | 376 | 452 | } | 377 | 452 | return ret; | 378 | 452 | } |
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 | 331 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 331 | length_result ret{}; | 344 | | | 345 | 331 | const auto implementations = get_supported_implementations(); | 346 | 331 | std::vector<std::size_t> results; | 347 | 331 | results.reserve(implementations.size()); | 348 | | | 349 | 993 | for (auto impl : implementations) { | 350 | 993 | const auto len = invoke_lengthcalc(impl, src); | 351 | 993 | results.push_back(len); | 352 | 993 | ret.length.push_back(len); | 353 | 993 | } | 354 | | | 355 | 331 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 331 | 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 | 331 | } else { | 375 | 331 | ret.implementations_agree = true; | 376 | 331 | } | 377 | 331 | return ret; | 378 | 331 | } |
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 | 401 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 401 | length_result ret{}; | 344 | | | 345 | 401 | const auto implementations = get_supported_implementations(); | 346 | 401 | std::vector<std::size_t> results; | 347 | 401 | results.reserve(implementations.size()); | 348 | | | 349 | 1.20k | for (auto impl : implementations) { | 350 | 1.20k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.20k | results.push_back(len); | 352 | 1.20k | ret.length.push_back(len); | 353 | 1.20k | } | 354 | | | 355 | 401 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 401 | 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 | 401 | } else { | 375 | 401 | ret.implementations_agree = true; | 376 | 401 | } | 377 | 401 | return ret; | 378 | 401 | } |
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 | 462 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 462 | length_result ret{}; | 344 | | | 345 | 462 | const auto implementations = get_supported_implementations(); | 346 | 462 | std::vector<std::size_t> results; | 347 | 462 | results.reserve(implementations.size()); | 348 | | | 349 | 1.38k | for (auto impl : implementations) { | 350 | 1.38k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.38k | results.push_back(len); | 352 | 1.38k | ret.length.push_back(len); | 353 | 1.38k | } | 354 | | | 355 | 462 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 462 | 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 | 462 | } else { | 375 | 462 | ret.implementations_agree = true; | 376 | 462 | } | 377 | 462 | return ret; | 378 | 462 | } |
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 | 726 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 726 | length_result ret{}; | 344 | | | 345 | 726 | const auto implementations = get_supported_implementations(); | 346 | 726 | std::vector<std::size_t> results; | 347 | 726 | results.reserve(implementations.size()); | 348 | | | 349 | 2.17k | for (auto impl : implementations) { | 350 | 2.17k | const auto len = invoke_lengthcalc(impl, src); | 351 | 2.17k | results.push_back(len); | 352 | 2.17k | ret.length.push_back(len); | 353 | 2.17k | } | 354 | | | 355 | 726 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 726 | 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 | 726 | } else { | 375 | 726 | ret.implementations_agree = true; | 376 | 726 | } | 377 | 726 | return ret; | 378 | 726 | } |
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 | 656 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 656 | length_result ret{}; | 344 | | | 345 | 656 | const auto implementations = get_supported_implementations(); | 346 | 656 | std::vector<std::size_t> results; | 347 | 656 | results.reserve(implementations.size()); | 348 | | | 349 | 1.96k | for (auto impl : implementations) { | 350 | 1.96k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.96k | results.push_back(len); | 352 | 1.96k | ret.length.push_back(len); | 353 | 1.96k | } | 354 | | | 355 | 656 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 656 | 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 | 656 | } else { | 375 | 656 | ret.implementations_agree = true; | 376 | 656 | } | 377 | 656 | return ret; | 378 | 656 | } |
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 | 742 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 742 | length_result ret{}; | 344 | | | 345 | 742 | const auto implementations = get_supported_implementations(); | 346 | 742 | std::vector<std::size_t> results; | 347 | 742 | results.reserve(implementations.size()); | 348 | | | 349 | 2.22k | for (auto impl : implementations) { | 350 | 2.22k | const auto len = invoke_lengthcalc(impl, src); | 351 | 2.22k | results.push_back(len); | 352 | 2.22k | ret.length.push_back(len); | 353 | 2.22k | } | 354 | | | 355 | 742 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 742 | 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 | 742 | } else { | 375 | 742 | ret.implementations_agree = true; | 376 | 742 | } | 377 | 742 | return ret; | 378 | 742 | } |
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 | 58 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 58 | length_result ret{}; | 344 | | | 345 | 58 | const auto implementations = get_supported_implementations(); | 346 | 58 | std::vector<std::size_t> results; | 347 | 58 | results.reserve(implementations.size()); | 348 | | | 349 | 174 | for (auto impl : implementations) { | 350 | 174 | const auto len = invoke_lengthcalc(impl, src); | 351 | 174 | results.push_back(len); | 352 | 174 | ret.length.push_back(len); | 353 | 174 | } | 354 | | | 355 | 58 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 58 | 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 | 58 | } else { | 375 | 58 | ret.implementations_agree = true; | 376 | 58 | } | 377 | 58 | return ret; | 378 | 58 | } |
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 | 67 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 67 | length_result ret{}; | 344 | | | 345 | 67 | const auto implementations = get_supported_implementations(); | 346 | 67 | std::vector<std::size_t> results; | 347 | 67 | results.reserve(implementations.size()); | 348 | | | 349 | 201 | for (auto impl : implementations) { | 350 | 201 | const auto len = invoke_lengthcalc(impl, src); | 351 | 201 | results.push_back(len); | 352 | 201 | ret.length.push_back(len); | 353 | 201 | } | 354 | | | 355 | 67 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 67 | 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 | 67 | } else { | 375 | 67 | ret.implementations_agree = true; | 376 | 67 | } | 377 | 67 | return ret; | 378 | 67 | } |
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 | 93 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 93 | length_result ret{}; | 344 | | | 345 | 93 | const auto implementations = get_supported_implementations(); | 346 | 93 | std::vector<std::size_t> results; | 347 | 93 | results.reserve(implementations.size()); | 348 | | | 349 | 279 | for (auto impl : implementations) { | 350 | 279 | const auto len = invoke_lengthcalc(impl, src); | 351 | 279 | results.push_back(len); | 352 | 279 | ret.length.push_back(len); | 353 | 279 | } | 354 | | | 355 | 93 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 93 | 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 | 93 | } else { | 375 | 93 | ret.implementations_agree = true; | 376 | 93 | } | 377 | 93 | return ret; | 378 | 93 | } |
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 | 358 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 358 | length_result ret{}; | 344 | | | 345 | 358 | const auto implementations = get_supported_implementations(); | 346 | 358 | std::vector<std::size_t> results; | 347 | 358 | results.reserve(implementations.size()); | 348 | | | 349 | 1.07k | for (auto impl : implementations) { | 350 | 1.07k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.07k | results.push_back(len); | 352 | 1.07k | ret.length.push_back(len); | 353 | 1.07k | } | 354 | | | 355 | 358 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 358 | 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 | 358 | } else { | 375 | 358 | ret.implementations_agree = true; | 376 | 358 | } | 377 | 358 | return ret; | 378 | 358 | } |
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 | 124 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 124 | length_result ret{}; | 344 | | | 345 | 124 | const auto implementations = get_supported_implementations(); | 346 | 124 | std::vector<std::size_t> results; | 347 | 124 | results.reserve(implementations.size()); | 348 | | | 349 | 372 | for (auto impl : implementations) { | 350 | 372 | const auto len = invoke_lengthcalc(impl, src); | 351 | 372 | results.push_back(len); | 352 | 372 | ret.length.push_back(len); | 353 | 372 | } | 354 | | | 355 | 124 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 124 | 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 | 124 | } else { | 375 | 124 | ret.implementations_agree = true; | 376 | 124 | } | 377 | 124 | return ret; | 378 | 124 | } |
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 | 183 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 183 | length_result ret{}; | 344 | | | 345 | 183 | const auto implementations = get_supported_implementations(); | 346 | 183 | std::vector<std::size_t> results; | 347 | 183 | results.reserve(implementations.size()); | 348 | | | 349 | 549 | for (auto impl : implementations) { | 350 | 549 | const auto len = invoke_lengthcalc(impl, src); | 351 | 549 | results.push_back(len); | 352 | 549 | ret.length.push_back(len); | 353 | 549 | } | 354 | | | 355 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 183 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 183 | } else { | 375 | 183 | ret.implementations_agree = true; | 376 | 183 | } | 377 | 183 | return ret; | 378 | 183 | } |
Conversion<(UtfEncodings)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 | 308 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 308 | length_result ret{}; | 344 | | | 345 | 308 | const auto implementations = get_supported_implementations(); | 346 | 308 | std::vector<std::size_t> results; | 347 | 308 | results.reserve(implementations.size()); | 348 | | | 349 | 924 | for (auto impl : implementations) { | 350 | 924 | const auto len = invoke_lengthcalc(impl, src); | 351 | 924 | results.push_back(len); | 352 | 924 | ret.length.push_back(len); | 353 | 924 | } | 354 | | | 355 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 308 | } else { | 375 | 308 | ret.implementations_agree = true; | 376 | 308 | } | 377 | 308 | return ret; | 378 | 308 | } |
Conversion<(UtfEncodings)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 | 132 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 132 | length_result ret{}; | 344 | | | 345 | 132 | const auto implementations = get_supported_implementations(); | 346 | 132 | std::vector<std::size_t> results; | 347 | 132 | results.reserve(implementations.size()); | 348 | | | 349 | 396 | for (auto impl : implementations) { | 350 | 396 | const auto len = invoke_lengthcalc(impl, src); | 351 | 396 | results.push_back(len); | 352 | 396 | ret.length.push_back(len); | 353 | 396 | } | 354 | | | 355 | 132 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 132 | 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 | 132 | } else { | 375 | 132 | ret.implementations_agree = true; | 376 | 132 | } | 377 | 132 | return ret; | 378 | 132 | } |
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 | 193 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 193 | length_result ret{}; | 344 | | | 345 | 193 | const auto implementations = get_supported_implementations(); | 346 | 193 | std::vector<std::size_t> results; | 347 | 193 | results.reserve(implementations.size()); | 348 | | | 349 | 579 | for (auto impl : implementations) { | 350 | 579 | const auto len = invoke_lengthcalc(impl, src); | 351 | 579 | results.push_back(len); | 352 | 579 | ret.length.push_back(len); | 353 | 579 | } | 354 | | | 355 | 193 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 193 | 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 | 193 | } else { | 375 | 193 | ret.implementations_agree = true; | 376 | 193 | } | 377 | 193 | return ret; | 378 | 193 | } |
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 | 356 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 356 | length_result ret{}; | 344 | | | 345 | 356 | const auto implementations = get_supported_implementations(); | 346 | 356 | std::vector<std::size_t> results; | 347 | 356 | results.reserve(implementations.size()); | 348 | | | 349 | 1.06k | for (auto impl : implementations) { | 350 | 1.06k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.06k | results.push_back(len); | 352 | 1.06k | ret.length.push_back(len); | 353 | 1.06k | } | 354 | | | 355 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 356 | 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 | 356 | } else { | 375 | 356 | ret.implementations_agree = true; | 376 | 356 | } | 377 | 356 | return ret; | 378 | 356 | } |
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 | 244 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 244 | length_result ret{}; | 344 | | | 345 | 244 | const auto implementations = get_supported_implementations(); | 346 | 244 | std::vector<std::size_t> results; | 347 | 244 | results.reserve(implementations.size()); | 348 | | | 349 | 732 | for (auto impl : implementations) { | 350 | 732 | const auto len = invoke_lengthcalc(impl, src); | 351 | 732 | results.push_back(len); | 352 | 732 | ret.length.push_back(len); | 353 | 732 | } | 354 | | | 355 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 244 | 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 | 244 | } else { | 375 | 244 | ret.implementations_agree = true; | 376 | 244 | } | 377 | 244 | return ret; | 378 | 244 | } |
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 | 339 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 339 | length_result ret{}; | 344 | | | 345 | 339 | const auto implementations = get_supported_implementations(); | 346 | 339 | std::vector<std::size_t> results; | 347 | 339 | results.reserve(implementations.size()); | 348 | | | 349 | 1.01k | for (auto impl : implementations) { | 350 | 1.01k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.01k | results.push_back(len); | 352 | 1.01k | ret.length.push_back(len); | 353 | 1.01k | } | 354 | | | 355 | 339 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 339 | 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 | 339 | } else { | 375 | 339 | ret.implementations_agree = true; | 376 | 339 | } | 377 | 339 | return ret; | 378 | 339 | } |
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 | 386 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 386 | length_result ret{}; | 344 | | | 345 | 386 | const auto implementations = get_supported_implementations(); | 346 | 386 | std::vector<std::size_t> results; | 347 | 386 | results.reserve(implementations.size()); | 348 | | | 349 | 1.15k | for (auto impl : implementations) { | 350 | 1.15k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.15k | results.push_back(len); | 352 | 1.15k | ret.length.push_back(len); | 353 | 1.15k | } | 354 | | | 355 | 386 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 386 | 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 | 386 | } else { | 375 | 386 | ret.implementations_agree = true; | 376 | 386 | } | 377 | 386 | return ret; | 378 | 386 | } |
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 | 430 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 430 | length_result ret{}; | 344 | | | 345 | 430 | const auto implementations = get_supported_implementations(); | 346 | 430 | std::vector<std::size_t> results; | 347 | 430 | results.reserve(implementations.size()); | 348 | | | 349 | 1.29k | for (auto impl : implementations) { | 350 | 1.29k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.29k | results.push_back(len); | 352 | 1.29k | ret.length.push_back(len); | 353 | 1.29k | } | 354 | | | 355 | 430 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 430 | 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 | 430 | } else { | 375 | 430 | ret.implementations_agree = true; | 376 | 430 | } | 377 | 430 | return ret; | 378 | 430 | } |
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 | 335 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 335 | length_result ret{}; | 344 | | | 345 | 335 | const auto implementations = get_supported_implementations(); | 346 | 335 | std::vector<std::size_t> results; | 347 | 335 | 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 | 335 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 335 | 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 | 335 | } else { | 375 | 335 | ret.implementations_agree = true; | 376 | 335 | } | 377 | 335 | return ret; | 378 | 335 | } |
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 | 451 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 451 | length_result ret{}; | 344 | | | 345 | 451 | const auto implementations = get_supported_implementations(); | 346 | 451 | std::vector<std::size_t> results; | 347 | 451 | results.reserve(implementations.size()); | 348 | | | 349 | 1.35k | for (auto impl : implementations) { | 350 | 1.35k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.35k | results.push_back(len); | 352 | 1.35k | ret.length.push_back(len); | 353 | 1.35k | } | 354 | | | 355 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 451 | } else { | 375 | 451 | ret.implementations_agree = true; | 376 | 451 | } | 377 | 451 | return ret; | 378 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)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 | 391 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 391 | length_result ret{}; | 344 | | | 345 | 391 | const auto implementations = get_supported_implementations(); | 346 | 391 | std::vector<std::size_t> results; | 347 | 391 | results.reserve(implementations.size()); | 348 | | | 349 | 1.17k | for (auto impl : implementations) { | 350 | 1.17k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.17k | results.push_back(len); | 352 | 1.17k | ret.length.push_back(len); | 353 | 1.17k | } | 354 | | | 355 | 391 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 391 | 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 | 391 | } else { | 375 | 391 | ret.implementations_agree = true; | 376 | 391 | } | 377 | 391 | return ret; | 378 | 391 | } |
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 | 459 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 459 | length_result ret{}; | 344 | | | 345 | 459 | const auto implementations = get_supported_implementations(); | 346 | 459 | std::vector<std::size_t> results; | 347 | 459 | results.reserve(implementations.size()); | 348 | | | 349 | 1.37k | for (auto impl : implementations) { | 350 | 1.37k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.37k | results.push_back(len); | 352 | 1.37k | ret.length.push_back(len); | 353 | 1.37k | } | 354 | | | 355 | 459 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 459 | 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 | 459 | } else { | 375 | 459 | ret.implementations_agree = true; | 376 | 459 | } | 377 | 459 | return ret; | 378 | 459 | } |
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 | 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)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 | 54 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 54 | length_result ret{}; | 344 | | | 345 | 54 | const auto implementations = get_supported_implementations(); | 346 | 54 | std::vector<std::size_t> results; | 347 | 54 | results.reserve(implementations.size()); | 348 | | | 349 | 162 | for (auto impl : implementations) { | 350 | 162 | const auto len = invoke_lengthcalc(impl, src); | 351 | 162 | results.push_back(len); | 352 | 162 | ret.length.push_back(len); | 353 | 162 | } | 354 | | | 355 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "implementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 54 | } else { | 375 | 54 | ret.implementations_agree = true; | 376 | 54 | } | 377 | 54 | return ret; | 378 | 54 | } |
Conversion<(UtfEncodings)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 | 243 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 243 | length_result ret{}; | 344 | | | 345 | 243 | const auto implementations = get_supported_implementations(); | 346 | 243 | std::vector<std::size_t> results; | 347 | 243 | results.reserve(implementations.size()); | 348 | | | 349 | 729 | for (auto impl : implementations) { | 350 | 729 | const auto len = invoke_lengthcalc(impl, src); | 351 | 729 | results.push_back(len); | 352 | 729 | ret.length.push_back(len); | 353 | 729 | } | 354 | | | 355 | 243 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 243 | 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 | 243 | } else { | 375 | 243 | ret.implementations_agree = true; | 376 | 243 | } | 377 | 243 | return ret; | 378 | 243 | } |
|
379 | | |
380 | | conversion_result do_conversion(FromSpan src, |
381 | | const std::vector<std::size_t>& outlength, |
382 | 9.84k | const bool inputisvalid) const { |
383 | 9.84k | conversion_result ret{}; |
384 | | |
385 | 9.84k | const auto implementations = get_supported_implementations(); |
386 | | |
387 | 9.84k | std::vector<result<ConversionResult>> results; |
388 | 9.84k | results.reserve(implementations.size()); |
389 | | |
390 | | // put the output in a separate allocation to make access violations easier |
391 | | // to catch |
392 | 9.84k | std::vector<std::vector<ToType>> outputbuffers; |
393 | 9.84k | outputbuffers.reserve(implementations.size()); |
394 | 39.3k | for (std::size_t i = 0; i < implementations.size(); ++i) { |
395 | 29.5k | auto impl = implementations[i]; |
396 | 29.5k | const ToType canary1{42}; |
397 | 29.5k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); |
398 | 29.5k | const auto implret1 = std::invoke(conversion, impl, src.data(), |
399 | 29.5k | src.size(), outputbuffer.data()); |
400 | | // was the conversion successful? |
401 | 29.5k | const auto success = [](const ConversionResult& r) -> bool { |
402 | 29.5k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { |
403 | 16.5k | return r != 0; |
404 | 16.5k | } else { |
405 | 12.9k | return r.error == simdutf::error_code::SUCCESS; |
406 | 12.9k | } |
407 | 29.5k | }(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 | 654 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 654 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 654 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 654 | }(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.21k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.21k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.21k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.21k | }(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 | 639 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 639 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 639 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 639 | }(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.31k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.31k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.31k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.31k | }(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 | 978 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 978 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 978 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 978 | }(implret1); |
Conversion<(UtfEncodings)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.19k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.19k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.19k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.19k | }(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.36k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.36k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.36k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.36k | }(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 | 2.14k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.14k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.14k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 2.14k | }(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.94k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.94k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.94k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.94k | }(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 | 2.19k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.19k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.19k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 2.19k | }(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 | 174 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 174 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 174 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 174 | }(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 | 201 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 201 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 201 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 201 | }(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 | 279 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 279 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 279 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 279 | }(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 | 1.07k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.07k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.07k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.07k | }(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 | 372 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 372 | } else { | 405 | 372 | return r.error == simdutf::error_code::SUCCESS; | 406 | 372 | } | 407 | 372 | }(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 | 549 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 549 | } else { | 405 | 549 | return r.error == simdutf::error_code::SUCCESS; | 406 | 549 | } | 407 | 549 | }(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 | 924 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 924 | } else { | 405 | 924 | return r.error == simdutf::error_code::SUCCESS; | 406 | 924 | } | 407 | 924 | }(implret1); |
Conversion<(UtfEncodings)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 | 396 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 396 | } else { | 405 | 396 | return r.error == simdutf::error_code::SUCCESS; | 406 | 396 | } | 407 | 396 | }(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 | 579 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 579 | } else { | 405 | 579 | return r.error == simdutf::error_code::SUCCESS; | 406 | 579 | } | 407 | 579 | }(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.06k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.06k | } else { | 405 | 1.06k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.06k | } | 407 | 1.06k | }(implret1); |
Conversion<(UtfEncodings)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 | 732 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 732 | } else { | 405 | 732 | return r.error == simdutf::error_code::SUCCESS; | 406 | 732 | } | 407 | 732 | }(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 | 1.01k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.01k | } else { | 405 | 1.01k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.01k | } | 407 | 1.01k | }(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.15k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.15k | } else { | 405 | 1.15k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.15k | } | 407 | 1.15k | }(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.29k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.29k | } else { | 405 | 1.29k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.29k | } | 407 | 1.29k | }(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 | 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)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.35k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.35k | } else { | 405 | 1.35k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.35k | } | 407 | 1.35k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)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 | 1.17k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.17k | } else { | 405 | 1.17k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.17k | } | 407 | 1.17k | }(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.37k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.37k | } else { | 405 | 1.37k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.37k | } | 407 | 1.37k | }(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 | 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)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 | 162 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 162 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 162 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 162 | }(implret1); |
Conversion<(UtfEncodings)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 | 729 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 729 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 729 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 729 | }(implret1); |
|
408 | 29.5k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); |
409 | 29.5k | 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 | 29.5k | const ToType canary2{25}; |
414 | 29.5k | const auto outputbuffer_first_run = outputbuffer; |
415 | 29.5k | std::ranges::fill(outputbuffer, canary2); |
416 | 29.5k | const auto implret2 = std::invoke(conversion, impl, src.data(), |
417 | 29.5k | src.size(), outputbuffer.data()); |
418 | | |
419 | 29.5k | if (implret1 != implret2) { |
420 | 0 | std::cerr << "different return value the second time!\n"; |
421 | 0 | std::abort(); |
422 | 0 | } |
423 | 29.5k | if (inputisvalid && success) { |
424 | | // only care about the output if the input is valid |
425 | 13.4k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); |
426 | 13.4k | if (hash1 != hash2) { |
427 | 0 | std::cerr << "different output the second time!\n"; |
428 | 0 | std::cerr << "implementation " << impl->name() << " " << name |
429 | 0 | << '\n'; |
430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; |
431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; |
432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; |
433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { |
434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] |
435 | 0 | << '\t' << +outputbuffer[j] << '\n'; |
436 | 0 | } |
437 | 0 | std::abort(); |
438 | 0 | } |
439 | 13.4k | } |
440 | 29.5k | } |
441 | 29.5k | results.emplace_back(implret1, success ? hash1 : ""); |
442 | 29.5k | } |
443 | | |
444 | | // do not require implementations to give the same output if |
445 | | // the input is not valid. |
446 | 9.84k | if (!inputisvalid) { |
447 | 15.3k | for (auto& e : results) { |
448 | 15.3k | e.outputhash.clear(); |
449 | 15.3k | } |
450 | 5.10k | } |
451 | | |
452 | 19.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>::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 | 436 | 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 | 810 | 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 | 426 | 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 | 878 | 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 | 652 | 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 | 794 | 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 | 908 | 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.43k | 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.29k | 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.46k | 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 | 116 | 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 | 134 | 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 | 186 | 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 | 716 | 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 | 248 | 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 | 366 | 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 | 616 | 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 | 264 | 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 | 386 | 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 | 712 | 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 | 488 | 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 | 678 | 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 | 772 | 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 | 860 | 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 | 670 | 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 | 902 | 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 | 782 | 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 | 918 | 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 | 102 | 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 | 108 | 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 | 486 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
453 | 9.84k | 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.84k | } else { |
474 | 9.84k | ret.implementations_agree = true; |
475 | 9.84k | } |
476 | 9.84k | return ret; |
477 | 9.84k | } 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 | 218 | const bool inputisvalid) const { | 383 | 218 | conversion_result ret{}; | 384 | | | 385 | 218 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 218 | std::vector<result<ConversionResult>> results; | 388 | 218 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 218 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 218 | outputbuffers.reserve(implementations.size()); | 394 | 872 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 654 | auto impl = implementations[i]; | 396 | 654 | const ToType canary1{42}; | 397 | 654 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 654 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 654 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 654 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 654 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 654 | return r != 0; | 404 | 654 | } else { | 405 | 654 | return r.error == simdutf::error_code::SUCCESS; | 406 | 654 | } | 407 | 654 | }(implret1); | 408 | 654 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 654 | 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 | 654 | const ToType canary2{25}; | 414 | 654 | const auto outputbuffer_first_run = outputbuffer; | 415 | 654 | std::ranges::fill(outputbuffer, canary2); | 416 | 654 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 654 | src.size(), outputbuffer.data()); | 418 | | | 419 | 654 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 654 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 348 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 348 | 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 | 348 | } | 440 | 654 | } | 441 | 654 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 654 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 218 | if (!inputisvalid) { | 447 | 297 | for (auto& e : results) { | 448 | 297 | e.outputhash.clear(); | 449 | 297 | } | 450 | 99 | } | 451 | | | 452 | 218 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 218 | 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 | 218 | } else { | 474 | 218 | ret.implementations_agree = true; | 475 | 218 | } | 476 | 218 | return ret; | 477 | 218 | } |
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 | 405 | const bool inputisvalid) const { | 383 | 405 | conversion_result ret{}; | 384 | | | 385 | 405 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 405 | std::vector<result<ConversionResult>> results; | 388 | 405 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 405 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 405 | outputbuffers.reserve(implementations.size()); | 394 | 1.62k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.21k | auto impl = implementations[i]; | 396 | 1.21k | const ToType canary1{42}; | 397 | 1.21k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.21k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.21k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.21k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.21k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.21k | return r != 0; | 404 | 1.21k | } else { | 405 | 1.21k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.21k | } | 407 | 1.21k | }(implret1); | 408 | 1.21k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.21k | 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.21k | const ToType canary2{25}; | 414 | 1.21k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.21k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.21k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.21k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.21k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.21k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 921 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 921 | 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 | 921 | } | 440 | 1.21k | } | 441 | 1.21k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.21k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 405 | if (!inputisvalid) { | 447 | 282 | for (auto& e : results) { | 448 | 282 | e.outputhash.clear(); | 449 | 282 | } | 450 | 94 | } | 451 | | | 452 | 405 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 405 | 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 | 405 | } else { | 474 | 405 | ret.implementations_agree = true; | 475 | 405 | } | 476 | 405 | return ret; | 477 | 405 | } |
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 | 213 | const bool inputisvalid) const { | 383 | 213 | conversion_result ret{}; | 384 | | | 385 | 213 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 213 | std::vector<result<ConversionResult>> results; | 388 | 213 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 213 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 213 | outputbuffers.reserve(implementations.size()); | 394 | 852 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 639 | auto impl = implementations[i]; | 396 | 639 | const ToType canary1{42}; | 397 | 639 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 639 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 639 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 639 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 639 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 639 | return r != 0; | 404 | 639 | } else { | 405 | 639 | return r.error == simdutf::error_code::SUCCESS; | 406 | 639 | } | 407 | 639 | }(implret1); | 408 | 639 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 639 | 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 | 639 | const ToType canary2{25}; | 414 | 639 | const auto outputbuffer_first_run = outputbuffer; | 415 | 639 | std::ranges::fill(outputbuffer, canary2); | 416 | 639 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 639 | src.size(), outputbuffer.data()); | 418 | | | 419 | 639 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 639 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 354 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 354 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 354 | } | 440 | 639 | } | 441 | 639 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 639 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 213 | if (!inputisvalid) { | 447 | 273 | for (auto& e : results) { | 448 | 273 | e.outputhash.clear(); | 449 | 273 | } | 450 | 91 | } | 451 | | | 452 | 213 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 213 | 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 | 213 | } else { | 474 | 213 | ret.implementations_agree = true; | 475 | 213 | } | 476 | 213 | return ret; | 477 | 213 | } |
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 | 439 | const bool inputisvalid) const { | 383 | 439 | conversion_result ret{}; | 384 | | | 385 | 439 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 439 | std::vector<result<ConversionResult>> results; | 388 | 439 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 439 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 439 | outputbuffers.reserve(implementations.size()); | 394 | 1.75k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.31k | auto impl = implementations[i]; | 396 | 1.31k | const ToType canary1{42}; | 397 | 1.31k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.31k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.31k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.31k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.31k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.31k | return r != 0; | 404 | 1.31k | } else { | 405 | 1.31k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.31k | } | 407 | 1.31k | }(implret1); | 408 | 1.31k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.31k | 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.31k | const ToType canary2{25}; | 414 | 1.31k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.31k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.31k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.31k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.31k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.31k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 966 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 966 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 966 | } | 440 | 1.31k | } | 441 | 1.31k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.31k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 439 | if (!inputisvalid) { | 447 | 339 | for (auto& e : results) { | 448 | 339 | e.outputhash.clear(); | 449 | 339 | } | 450 | 113 | } | 451 | | | 452 | 439 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 439 | 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 | 439 | } else { | 474 | 439 | ret.implementations_agree = true; | 475 | 439 | } | 476 | 439 | return ret; | 477 | 439 | } |
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 | 326 | const bool inputisvalid) const { | 383 | 326 | conversion_result ret{}; | 384 | | | 385 | 326 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 326 | std::vector<result<ConversionResult>> results; | 388 | 326 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 326 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 326 | outputbuffers.reserve(implementations.size()); | 394 | 1.30k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 978 | auto impl = implementations[i]; | 396 | 978 | const ToType canary1{42}; | 397 | 978 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 978 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 978 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 978 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 978 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 978 | return r != 0; | 404 | 978 | } else { | 405 | 978 | return r.error == simdutf::error_code::SUCCESS; | 406 | 978 | } | 407 | 978 | }(implret1); | 408 | 978 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 978 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 978 | const ToType canary2{25}; | 414 | 978 | const auto outputbuffer_first_run = outputbuffer; | 415 | 978 | std::ranges::fill(outputbuffer, canary2); | 416 | 978 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 978 | src.size(), outputbuffer.data()); | 418 | | | 419 | 978 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 978 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 411 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 411 | 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 | 411 | } | 440 | 978 | } | 441 | 978 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 978 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 326 | if (!inputisvalid) { | 447 | 555 | for (auto& e : results) { | 448 | 555 | e.outputhash.clear(); | 449 | 555 | } | 450 | 185 | } | 451 | | | 452 | 326 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 326 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 326 | } else { | 474 | 326 | ret.implementations_agree = true; | 475 | 326 | } | 476 | 326 | return ret; | 477 | 326 | } |
Conversion<(UtfEncodings)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 | 397 | const bool inputisvalid) const { | 383 | 397 | conversion_result ret{}; | 384 | | | 385 | 397 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 397 | std::vector<result<ConversionResult>> results; | 388 | 397 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 397 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 397 | outputbuffers.reserve(implementations.size()); | 394 | 1.58k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.19k | auto impl = implementations[i]; | 396 | 1.19k | const ToType canary1{42}; | 397 | 1.19k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.19k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.19k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.19k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.19k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.19k | return r != 0; | 404 | 1.19k | } else { | 405 | 1.19k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.19k | } | 407 | 1.19k | }(implret1); | 408 | 1.19k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.19k | 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.19k | const ToType canary2{25}; | 414 | 1.19k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.19k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.19k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.19k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.19k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.19k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 627 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 627 | 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 | 627 | } | 440 | 1.19k | } | 441 | 1.19k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.19k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 397 | if (!inputisvalid) { | 447 | 549 | for (auto& e : results) { | 448 | 549 | e.outputhash.clear(); | 449 | 549 | } | 450 | 183 | } | 451 | | | 452 | 397 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 397 | 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 | 397 | } else { | 474 | 397 | ret.implementations_agree = true; | 475 | 397 | } | 476 | 397 | return ret; | 477 | 397 | } |
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 | 454 | const bool inputisvalid) const { | 383 | 454 | conversion_result ret{}; | 384 | | | 385 | 454 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 454 | std::vector<result<ConversionResult>> results; | 388 | 454 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 454 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 454 | outputbuffers.reserve(implementations.size()); | 394 | 1.81k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.36k | auto impl = implementations[i]; | 396 | 1.36k | const ToType canary1{42}; | 397 | 1.36k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.36k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.36k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.36k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.36k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.36k | return r != 0; | 404 | 1.36k | } else { | 405 | 1.36k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.36k | } | 407 | 1.36k | }(implret1); | 408 | 1.36k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.36k | 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.36k | const ToType canary2{25}; | 414 | 1.36k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.36k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.36k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.36k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.36k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.36k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 486 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 486 | 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 | 486 | } | 440 | 1.36k | } | 441 | 1.36k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.36k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 454 | if (!inputisvalid) { | 447 | 864 | for (auto& e : results) { | 448 | 864 | e.outputhash.clear(); | 449 | 864 | } | 450 | 288 | } | 451 | | | 452 | 454 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 454 | 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 | 454 | } else { | 474 | 454 | ret.implementations_agree = true; | 475 | 454 | } | 476 | 454 | return ret; | 477 | 454 | } |
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 | 715 | const bool inputisvalid) const { | 383 | 715 | conversion_result ret{}; | 384 | | | 385 | 715 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 715 | std::vector<result<ConversionResult>> results; | 388 | 715 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 715 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 715 | outputbuffers.reserve(implementations.size()); | 394 | 2.86k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 2.14k | auto impl = implementations[i]; | 396 | 2.14k | const ToType canary1{42}; | 397 | 2.14k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 2.14k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 2.14k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 2.14k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.14k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.14k | return r != 0; | 404 | 2.14k | } else { | 405 | 2.14k | return r.error == simdutf::error_code::SUCCESS; | 406 | 2.14k | } | 407 | 2.14k | }(implret1); | 408 | 2.14k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 2.14k | 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 | 2.14k | const ToType canary2{25}; | 414 | 2.14k | const auto outputbuffer_first_run = outputbuffer; | 415 | 2.14k | std::ranges::fill(outputbuffer, canary2); | 416 | 2.14k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 2.14k | src.size(), outputbuffer.data()); | 418 | | | 419 | 2.14k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 2.14k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.02k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.02k | 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.02k | } | 440 | 2.14k | } | 441 | 2.14k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 2.14k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 715 | if (!inputisvalid) { | 447 | 1.11k | for (auto& e : results) { | 448 | 1.11k | e.outputhash.clear(); | 449 | 1.11k | } | 450 | 370 | } | 451 | | | 452 | 715 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 715 | 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 | 715 | } else { | 474 | 715 | ret.implementations_agree = true; | 475 | 715 | } | 476 | 715 | return ret; | 477 | 715 | } |
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 | 647 | const bool inputisvalid) const { | 383 | 647 | conversion_result ret{}; | 384 | | | 385 | 647 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 647 | std::vector<result<ConversionResult>> results; | 388 | 647 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 647 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 647 | outputbuffers.reserve(implementations.size()); | 394 | 2.58k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.94k | auto impl = implementations[i]; | 396 | 1.94k | const ToType canary1{42}; | 397 | 1.94k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.94k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.94k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.94k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.94k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.94k | return r != 0; | 404 | 1.94k | } else { | 405 | 1.94k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.94k | } | 407 | 1.94k | }(implret1); | 408 | 1.94k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.94k | 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.94k | const ToType canary2{25}; | 414 | 1.94k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.94k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.94k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.94k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.94k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.94k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 888 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 888 | 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 | 888 | } | 440 | 1.94k | } | 441 | 1.94k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.94k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 647 | if (!inputisvalid) { | 447 | 1.04k | for (auto& e : results) { | 448 | 1.04k | e.outputhash.clear(); | 449 | 1.04k | } | 450 | 348 | } | 451 | | | 452 | 647 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 647 | 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 | 647 | } else { | 474 | 647 | ret.implementations_agree = true; | 475 | 647 | } | 476 | 647 | return ret; | 477 | 647 | } |
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 | 731 | const bool inputisvalid) const { | 383 | 731 | conversion_result ret{}; | 384 | | | 385 | 731 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 731 | std::vector<result<ConversionResult>> results; | 388 | 731 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 731 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 731 | outputbuffers.reserve(implementations.size()); | 394 | 2.92k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 2.19k | auto impl = implementations[i]; | 396 | 2.19k | const ToType canary1{42}; | 397 | 2.19k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 2.19k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 2.19k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 2.19k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.19k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.19k | return r != 0; | 404 | 2.19k | } else { | 405 | 2.19k | return r.error == simdutf::error_code::SUCCESS; | 406 | 2.19k | } | 407 | 2.19k | }(implret1); | 408 | 2.19k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 2.19k | 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 | 2.19k | const ToType canary2{25}; | 414 | 2.19k | const auto outputbuffer_first_run = outputbuffer; | 415 | 2.19k | std::ranges::fill(outputbuffer, canary2); | 416 | 2.19k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 2.19k | src.size(), outputbuffer.data()); | 418 | | | 419 | 2.19k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 2.19k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.12k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.12k | 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.12k | } | 440 | 2.19k | } | 441 | 2.19k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 2.19k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 731 | if (!inputisvalid) { | 447 | 1.05k | for (auto& e : results) { | 448 | 1.05k | e.outputhash.clear(); | 449 | 1.05k | } | 450 | 353 | } | 451 | | | 452 | 731 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 731 | 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 | 731 | } else { | 474 | 731 | ret.implementations_agree = true; | 475 | 731 | } | 476 | 731 | return ret; | 477 | 731 | } |
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 | 58 | const bool inputisvalid) const { | 383 | 58 | conversion_result ret{}; | 384 | | | 385 | 58 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 58 | std::vector<result<ConversionResult>> results; | 388 | 58 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 58 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 58 | outputbuffers.reserve(implementations.size()); | 394 | 232 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 174 | auto impl = implementations[i]; | 396 | 174 | const ToType canary1{42}; | 397 | 174 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 174 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 174 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 174 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 174 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 174 | return r != 0; | 404 | 174 | } else { | 405 | 174 | return r.error == simdutf::error_code::SUCCESS; | 406 | 174 | } | 407 | 174 | }(implret1); | 408 | 174 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 174 | 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 | 174 | const ToType canary2{25}; | 414 | 174 | const auto outputbuffer_first_run = outputbuffer; | 415 | 174 | std::ranges::fill(outputbuffer, canary2); | 416 | 174 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 174 | src.size(), outputbuffer.data()); | 418 | | | 419 | 174 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 174 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 66 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 66 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 66 | } | 440 | 174 | } | 441 | 174 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 174 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 58 | if (!inputisvalid) { | 447 | 36 | for (auto& e : results) { | 448 | 36 | e.outputhash.clear(); | 449 | 36 | } | 450 | 12 | } | 451 | | | 452 | 58 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 58 | 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 | 58 | } else { | 474 | 58 | ret.implementations_agree = true; | 475 | 58 | } | 476 | 58 | return ret; | 477 | 58 | } |
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 | 67 | const bool inputisvalid) const { | 383 | 67 | conversion_result ret{}; | 384 | | | 385 | 67 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 67 | std::vector<result<ConversionResult>> results; | 388 | 67 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 67 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 67 | outputbuffers.reserve(implementations.size()); | 394 | 268 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 201 | auto impl = implementations[i]; | 396 | 201 | const ToType canary1{42}; | 397 | 201 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 201 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 201 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 201 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 201 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 201 | return r != 0; | 404 | 201 | } else { | 405 | 201 | return r.error == simdutf::error_code::SUCCESS; | 406 | 201 | } | 407 | 201 | }(implret1); | 408 | 201 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 201 | 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 | 201 | const ToType canary2{25}; | 414 | 201 | const auto outputbuffer_first_run = outputbuffer; | 415 | 201 | std::ranges::fill(outputbuffer, canary2); | 416 | 201 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 201 | src.size(), outputbuffer.data()); | 418 | | | 419 | 201 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 201 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 69 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 69 | 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 | 69 | } | 440 | 201 | } | 441 | 201 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 201 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 67 | if (!inputisvalid) { | 447 | 54 | for (auto& e : results) { | 448 | 54 | e.outputhash.clear(); | 449 | 54 | } | 450 | 18 | } | 451 | | | 452 | 67 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 67 | 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 | 67 | } else { | 474 | 67 | ret.implementations_agree = true; | 475 | 67 | } | 476 | 67 | return ret; | 477 | 67 | } |
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 | 93 | const bool inputisvalid) const { | 383 | 93 | conversion_result ret{}; | 384 | | | 385 | 93 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 93 | std::vector<result<ConversionResult>> results; | 388 | 93 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 93 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 93 | outputbuffers.reserve(implementations.size()); | 394 | 372 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 279 | auto impl = implementations[i]; | 396 | 279 | const ToType canary1{42}; | 397 | 279 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 279 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 279 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 279 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 279 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 279 | return r != 0; | 404 | 279 | } else { | 405 | 279 | return r.error == simdutf::error_code::SUCCESS; | 406 | 279 | } | 407 | 279 | }(implret1); | 408 | 279 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 279 | 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 | 279 | const ToType canary2{25}; | 414 | 279 | const auto outputbuffer_first_run = outputbuffer; | 415 | 279 | std::ranges::fill(outputbuffer, canary2); | 416 | 279 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 279 | src.size(), outputbuffer.data()); | 418 | | | 419 | 279 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 279 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 48 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 48 | 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 | 48 | } | 440 | 279 | } | 441 | 279 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 279 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 93 | if (!inputisvalid) { | 447 | 222 | for (auto& e : results) { | 448 | 222 | e.outputhash.clear(); | 449 | 222 | } | 450 | 74 | } | 451 | | | 452 | 93 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 93 | 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 | 93 | } else { | 474 | 93 | ret.implementations_agree = true; | 475 | 93 | } | 476 | 93 | return ret; | 477 | 93 | } |
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 | 358 | const bool inputisvalid) const { | 383 | 358 | conversion_result ret{}; | 384 | | | 385 | 358 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 358 | std::vector<result<ConversionResult>> results; | 388 | 358 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 358 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 358 | outputbuffers.reserve(implementations.size()); | 394 | 1.43k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.07k | auto impl = implementations[i]; | 396 | 1.07k | const ToType canary1{42}; | 397 | 1.07k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.07k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.07k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.07k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.07k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.07k | return r != 0; | 404 | 1.07k | } else { | 405 | 1.07k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.07k | } | 407 | 1.07k | }(implret1); | 408 | 1.07k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.07k | 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.07k | const ToType canary2{25}; | 414 | 1.07k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.07k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.07k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.07k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.07k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.07k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 291 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 291 | 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 | 291 | } | 440 | 1.07k | } | 441 | 1.07k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.07k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 358 | if (!inputisvalid) { | 447 | 750 | for (auto& e : results) { | 448 | 750 | e.outputhash.clear(); | 449 | 750 | } | 450 | 250 | } | 451 | | | 452 | 358 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 358 | 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 | 358 | } else { | 474 | 358 | ret.implementations_agree = true; | 475 | 358 | } | 476 | 358 | return ret; | 477 | 358 | } |
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 | 124 | const bool inputisvalid) const { | 383 | 124 | conversion_result ret{}; | 384 | | | 385 | 124 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 124 | std::vector<result<ConversionResult>> results; | 388 | 124 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 124 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 124 | outputbuffers.reserve(implementations.size()); | 394 | 496 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 372 | auto impl = implementations[i]; | 396 | 372 | const ToType canary1{42}; | 397 | 372 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 372 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 372 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 372 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 372 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 372 | return r != 0; | 404 | 372 | } else { | 405 | 372 | return r.error == simdutf::error_code::SUCCESS; | 406 | 372 | } | 407 | 372 | }(implret1); | 408 | 372 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 372 | 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 | 372 | const ToType canary2{25}; | 414 | 372 | const auto outputbuffer_first_run = outputbuffer; | 415 | 372 | std::ranges::fill(outputbuffer, canary2); | 416 | 372 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 372 | src.size(), outputbuffer.data()); | 418 | | | 419 | 372 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 372 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 126 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 126 | 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 | 126 | } | 440 | 372 | } | 441 | 372 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 372 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 124 | if (!inputisvalid) { | 447 | 54 | for (auto& e : results) { | 448 | 54 | e.outputhash.clear(); | 449 | 54 | } | 450 | 18 | } | 451 | | | 452 | 124 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 124 | 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 | 124 | } else { | 474 | 124 | ret.implementations_agree = true; | 475 | 124 | } | 476 | 124 | return ret; | 477 | 124 | } |
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 | 183 | const bool inputisvalid) const { | 383 | 183 | conversion_result ret{}; | 384 | | | 385 | 183 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 183 | std::vector<result<ConversionResult>> results; | 388 | 183 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 183 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 183 | outputbuffers.reserve(implementations.size()); | 394 | 732 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 549 | auto impl = implementations[i]; | 396 | 549 | const ToType canary1{42}; | 397 | 549 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 549 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 549 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 549 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 549 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 549 | return r != 0; | 404 | 549 | } else { | 405 | 549 | return r.error == simdutf::error_code::SUCCESS; | 406 | 549 | } | 407 | 549 | }(implret1); | 408 | 549 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 549 | 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 | 549 | const ToType canary2{25}; | 414 | 549 | const auto outputbuffer_first_run = outputbuffer; | 415 | 549 | std::ranges::fill(outputbuffer, canary2); | 416 | 549 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 549 | src.size(), outputbuffer.data()); | 418 | | | 419 | 549 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 549 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 255 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 255 | 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 | 255 | } | 440 | 549 | } | 441 | 549 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 549 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 183 | if (!inputisvalid) { | 447 | 294 | for (auto& e : results) { | 448 | 294 | e.outputhash.clear(); | 449 | 294 | } | 450 | 98 | } | 451 | | | 452 | 183 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 183 | 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 | 183 | } else { | 474 | 183 | ret.implementations_agree = true; | 475 | 183 | } | 476 | 183 | return ret; | 477 | 183 | } |
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 | 308 | const bool inputisvalid) const { | 383 | 308 | conversion_result ret{}; | 384 | | | 385 | 308 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 308 | std::vector<result<ConversionResult>> results; | 388 | 308 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 308 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 308 | outputbuffers.reserve(implementations.size()); | 394 | 1.23k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 924 | auto impl = implementations[i]; | 396 | 924 | const ToType canary1{42}; | 397 | 924 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 924 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 924 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 924 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 924 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 924 | return r != 0; | 404 | 924 | } else { | 405 | 924 | return r.error == simdutf::error_code::SUCCESS; | 406 | 924 | } | 407 | 924 | }(implret1); | 408 | 924 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 924 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 924 | const ToType canary2{25}; | 414 | 924 | const auto outputbuffer_first_run = outputbuffer; | 415 | 924 | std::ranges::fill(outputbuffer, canary2); | 416 | 924 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 924 | src.size(), outputbuffer.data()); | 418 | | | 419 | 924 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 924 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 558 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 558 | 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 | 558 | } | 440 | 924 | } | 441 | 924 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 924 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 308 | if (!inputisvalid) { | 447 | 366 | for (auto& e : results) { | 448 | 366 | e.outputhash.clear(); | 449 | 366 | } | 450 | 122 | } | 451 | | | 452 | 308 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 308 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 308 | } else { | 474 | 308 | ret.implementations_agree = true; | 475 | 308 | } | 476 | 308 | return ret; | 477 | 308 | } |
Conversion<(UtfEncodings)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 | 132 | const bool inputisvalid) const { | 383 | 132 | conversion_result ret{}; | 384 | | | 385 | 132 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 132 | std::vector<result<ConversionResult>> results; | 388 | 132 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 132 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 132 | outputbuffers.reserve(implementations.size()); | 394 | 528 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 396 | auto impl = implementations[i]; | 396 | 396 | const ToType canary1{42}; | 397 | 396 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 396 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 396 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 396 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 396 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 396 | return r != 0; | 404 | 396 | } else { | 405 | 396 | return r.error == simdutf::error_code::SUCCESS; | 406 | 396 | } | 407 | 396 | }(implret1); | 408 | 396 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 396 | 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 | 396 | const ToType canary2{25}; | 414 | 396 | const auto outputbuffer_first_run = outputbuffer; | 415 | 396 | std::ranges::fill(outputbuffer, canary2); | 416 | 396 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 396 | src.size(), outputbuffer.data()); | 418 | | | 419 | 396 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 396 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 135 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 135 | 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 | 135 | } | 440 | 396 | } | 441 | 396 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 396 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 132 | if (!inputisvalid) { | 447 | 54 | for (auto& e : results) { | 448 | 54 | e.outputhash.clear(); | 449 | 54 | } | 450 | 18 | } | 451 | | | 452 | 132 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 132 | 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 | 132 | } else { | 474 | 132 | ret.implementations_agree = true; | 475 | 132 | } | 476 | 132 | return ret; | 477 | 132 | } |
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 | 193 | const bool inputisvalid) const { | 383 | 193 | conversion_result ret{}; | 384 | | | 385 | 193 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 193 | std::vector<result<ConversionResult>> results; | 388 | 193 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 193 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 193 | outputbuffers.reserve(implementations.size()); | 394 | 772 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 579 | auto impl = implementations[i]; | 396 | 579 | const ToType canary1{42}; | 397 | 579 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 579 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 579 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 579 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 579 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 579 | return r != 0; | 404 | 579 | } else { | 405 | 579 | return r.error == simdutf::error_code::SUCCESS; | 406 | 579 | } | 407 | 579 | }(implret1); | 408 | 579 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 579 | 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 | 579 | const ToType canary2{25}; | 414 | 579 | const auto outputbuffer_first_run = outputbuffer; | 415 | 579 | std::ranges::fill(outputbuffer, canary2); | 416 | 579 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 579 | src.size(), outputbuffer.data()); | 418 | | | 419 | 579 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 579 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 282 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 282 | 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 | 282 | } | 440 | 579 | } | 441 | 579 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 579 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 193 | if (!inputisvalid) { | 447 | 297 | for (auto& e : results) { | 448 | 297 | e.outputhash.clear(); | 449 | 297 | } | 450 | 99 | } | 451 | | | 452 | 193 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 193 | 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 | 193 | } else { | 474 | 193 | ret.implementations_agree = true; | 475 | 193 | } | 476 | 193 | return ret; | 477 | 193 | } |
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 | 356 | const bool inputisvalid) const { | 383 | 356 | conversion_result ret{}; | 384 | | | 385 | 356 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 356 | std::vector<result<ConversionResult>> results; | 388 | 356 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 356 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 356 | outputbuffers.reserve(implementations.size()); | 394 | 1.42k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.06k | auto impl = implementations[i]; | 396 | 1.06k | const ToType canary1{42}; | 397 | 1.06k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.06k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.06k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.06k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.06k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.06k | return r != 0; | 404 | 1.06k | } else { | 405 | 1.06k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.06k | } | 407 | 1.06k | }(implret1); | 408 | 1.06k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.06k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.06k | const ToType canary2{25}; | 414 | 1.06k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.06k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.06k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.06k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.06k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.06k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 660 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 660 | 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 | 660 | } | 440 | 1.06k | } | 441 | 1.06k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.06k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 356 | if (!inputisvalid) { | 447 | 408 | for (auto& e : results) { | 448 | 408 | e.outputhash.clear(); | 449 | 408 | } | 450 | 136 | } | 451 | | | 452 | 356 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 356 | 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 | 356 | } else { | 474 | 356 | ret.implementations_agree = true; | 475 | 356 | } | 476 | 356 | return ret; | 477 | 356 | } |
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 | 244 | const bool inputisvalid) const { | 383 | 244 | conversion_result ret{}; | 384 | | | 385 | 244 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 244 | std::vector<result<ConversionResult>> results; | 388 | 244 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 244 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 244 | outputbuffers.reserve(implementations.size()); | 394 | 976 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 732 | auto impl = implementations[i]; | 396 | 732 | const ToType canary1{42}; | 397 | 732 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 732 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 732 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 732 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 732 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 732 | return r != 0; | 404 | 732 | } else { | 405 | 732 | return r.error == simdutf::error_code::SUCCESS; | 406 | 732 | } | 407 | 732 | }(implret1); | 408 | 732 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 732 | 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 | 732 | const ToType canary2{25}; | 414 | 732 | const auto outputbuffer_first_run = outputbuffer; | 415 | 732 | std::ranges::fill(outputbuffer, canary2); | 416 | 732 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 732 | src.size(), outputbuffer.data()); | 418 | | | 419 | 732 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 732 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 78 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 78 | 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 | 78 | } | 440 | 732 | } | 441 | 732 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 732 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 244 | if (!inputisvalid) { | 447 | 627 | for (auto& e : results) { | 448 | 627 | e.outputhash.clear(); | 449 | 627 | } | 450 | 209 | } | 451 | | | 452 | 244 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 244 | 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 | 244 | } else { | 474 | 244 | ret.implementations_agree = true; | 475 | 244 | } | 476 | 244 | return ret; | 477 | 244 | } |
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 | 339 | const bool inputisvalid) const { | 383 | 339 | conversion_result ret{}; | 384 | | | 385 | 339 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 339 | std::vector<result<ConversionResult>> results; | 388 | 339 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 339 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 339 | outputbuffers.reserve(implementations.size()); | 394 | 1.35k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.01k | auto impl = implementations[i]; | 396 | 1.01k | const ToType canary1{42}; | 397 | 1.01k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.01k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.01k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.01k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.01k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.01k | return r != 0; | 404 | 1.01k | } else { | 405 | 1.01k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.01k | } | 407 | 1.01k | }(implret1); | 408 | 1.01k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.01k | 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.01k | const ToType canary2{25}; | 414 | 1.01k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.01k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.01k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.01k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.01k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.01k | 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.01k | } | 441 | 1.01k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.01k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 339 | if (!inputisvalid) { | 447 | 747 | for (auto& e : results) { | 448 | 747 | e.outputhash.clear(); | 449 | 747 | } | 450 | 249 | } | 451 | | | 452 | 339 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 339 | 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 | 339 | } else { | 474 | 339 | ret.implementations_agree = true; | 475 | 339 | } | 476 | 339 | return ret; | 477 | 339 | } |
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 | 386 | const bool inputisvalid) const { | 383 | 386 | conversion_result ret{}; | 384 | | | 385 | 386 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 386 | std::vector<result<ConversionResult>> results; | 388 | 386 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 386 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 386 | outputbuffers.reserve(implementations.size()); | 394 | 1.54k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.15k | auto impl = implementations[i]; | 396 | 1.15k | const ToType canary1{42}; | 397 | 1.15k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.15k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.15k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.15k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.15k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.15k | return r != 0; | 404 | 1.15k | } else { | 405 | 1.15k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.15k | } | 407 | 1.15k | }(implret1); | 408 | 1.15k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.15k | 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.15k | const ToType canary2{25}; | 414 | 1.15k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.15k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.15k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.15k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.15k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.15k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 264 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 264 | 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 | 264 | } | 440 | 1.15k | } | 441 | 1.15k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.15k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 386 | if (!inputisvalid) { | 447 | 894 | for (auto& e : results) { | 448 | 894 | e.outputhash.clear(); | 449 | 894 | } | 450 | 298 | } | 451 | | | 452 | 386 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 386 | 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 | 386 | } else { | 474 | 386 | ret.implementations_agree = true; | 475 | 386 | } | 476 | 386 | return ret; | 477 | 386 | } |
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 | 430 | const bool inputisvalid) const { | 383 | 430 | conversion_result ret{}; | 384 | | | 385 | 430 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 430 | std::vector<result<ConversionResult>> results; | 388 | 430 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 430 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 430 | outputbuffers.reserve(implementations.size()); | 394 | 1.72k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.29k | auto impl = implementations[i]; | 396 | 1.29k | const ToType canary1{42}; | 397 | 1.29k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.29k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.29k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.29k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.29k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.29k | return r != 0; | 404 | 1.29k | } else { | 405 | 1.29k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.29k | } | 407 | 1.29k | }(implret1); | 408 | 1.29k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.29k | 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.29k | const ToType canary2{25}; | 414 | 1.29k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.29k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.29k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.29k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.29k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.29k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 309 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 309 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 309 | } | 440 | 1.29k | } | 441 | 1.29k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.29k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 430 | if (!inputisvalid) { | 447 | 981 | for (auto& e : results) { | 448 | 981 | e.outputhash.clear(); | 449 | 981 | } | 450 | 327 | } | 451 | | | 452 | 430 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 430 | 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 | 430 | } else { | 474 | 430 | ret.implementations_agree = true; | 475 | 430 | } | 476 | 430 | return ret; | 477 | 430 | } |
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 | 335 | const bool inputisvalid) const { | 383 | 335 | conversion_result ret{}; | 384 | | | 385 | 335 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 335 | std::vector<result<ConversionResult>> results; | 388 | 335 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 335 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 335 | 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 | 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 | 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 | 335 | if (!inputisvalid) { | 447 | 624 | for (auto& e : results) { | 448 | 624 | e.outputhash.clear(); | 449 | 624 | } | 450 | 208 | } | 451 | | | 452 | 335 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 335 | 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 | 335 | } else { | 474 | 335 | ret.implementations_agree = true; | 475 | 335 | } | 476 | 335 | return ret; | 477 | 335 | } |
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 | 451 | const bool inputisvalid) const { | 383 | 451 | conversion_result ret{}; | 384 | | | 385 | 451 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 451 | std::vector<result<ConversionResult>> results; | 388 | 451 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 451 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 451 | outputbuffers.reserve(implementations.size()); | 394 | 1.80k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.35k | auto impl = implementations[i]; | 396 | 1.35k | const ToType canary1{42}; | 397 | 1.35k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.35k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.35k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.35k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.35k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.35k | return r != 0; | 404 | 1.35k | } else { | 405 | 1.35k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.35k | } | 407 | 1.35k | }(implret1); | 408 | 1.35k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.35k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.35k | const ToType canary2{25}; | 414 | 1.35k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.35k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.35k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.35k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.35k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.35k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 540 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 540 | 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 | 540 | } | 440 | 1.35k | } | 441 | 1.35k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.35k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 451 | if (!inputisvalid) { | 447 | 813 | for (auto& e : results) { | 448 | 813 | e.outputhash.clear(); | 449 | 813 | } | 450 | 271 | } | 451 | | | 452 | 451 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 451 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 451 | } else { | 474 | 451 | ret.implementations_agree = true; | 475 | 451 | } | 476 | 451 | return ret; | 477 | 451 | } |
Conversion<(UtfEncodings)2, (UtfEncodings)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 | 391 | const bool inputisvalid) const { | 383 | 391 | conversion_result ret{}; | 384 | | | 385 | 391 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 391 | std::vector<result<ConversionResult>> results; | 388 | 391 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 391 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 391 | outputbuffers.reserve(implementations.size()); | 394 | 1.56k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.17k | auto impl = implementations[i]; | 396 | 1.17k | const ToType canary1{42}; | 397 | 1.17k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.17k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.17k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.17k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.17k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.17k | return r != 0; | 404 | 1.17k | } else { | 405 | 1.17k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.17k | } | 407 | 1.17k | }(implret1); | 408 | 1.17k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.17k | 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.17k | const ToType canary2{25}; | 414 | 1.17k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.17k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.17k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.17k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.17k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.17k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 354 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 354 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 354 | } | 440 | 1.17k | } | 441 | 1.17k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.17k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 391 | if (!inputisvalid) { | 447 | 819 | for (auto& e : results) { | 448 | 819 | e.outputhash.clear(); | 449 | 819 | } | 450 | 273 | } | 451 | | | 452 | 391 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 391 | 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 | 391 | } else { | 474 | 391 | ret.implementations_agree = true; | 475 | 391 | } | 476 | 391 | return ret; | 477 | 391 | } |
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 | 459 | const bool inputisvalid) const { | 383 | 459 | conversion_result ret{}; | 384 | | | 385 | 459 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 459 | std::vector<result<ConversionResult>> results; | 388 | 459 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 459 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 459 | outputbuffers.reserve(implementations.size()); | 394 | 1.83k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.37k | auto impl = implementations[i]; | 396 | 1.37k | const ToType canary1{42}; | 397 | 1.37k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.37k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.37k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.37k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.37k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.37k | return r != 0; | 404 | 1.37k | } else { | 405 | 1.37k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.37k | } | 407 | 1.37k | }(implret1); | 408 | 1.37k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.37k | 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.37k | const ToType canary2{25}; | 414 | 1.37k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.37k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.37k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.37k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.37k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.37k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 486 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 486 | 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 | 486 | } | 440 | 1.37k | } | 441 | 1.37k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.37k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 459 | if (!inputisvalid) { | 447 | 891 | for (auto& e : results) { | 448 | 891 | e.outputhash.clear(); | 449 | 891 | } | 450 | 297 | } | 451 | | | 452 | 459 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 459 | 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 | 459 | } else { | 474 | 459 | ret.implementations_agree = true; | 475 | 459 | } | 476 | 459 | return ret; | 477 | 459 | } |
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 | 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)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 | 54 | const bool inputisvalid) const { | 383 | 54 | conversion_result ret{}; | 384 | | | 385 | 54 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 54 | std::vector<result<ConversionResult>> results; | 388 | 54 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 54 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 54 | outputbuffers.reserve(implementations.size()); | 394 | 216 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 162 | auto impl = implementations[i]; | 396 | 162 | const ToType canary1{42}; | 397 | 162 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 162 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 162 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 162 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 162 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 162 | return r != 0; | 404 | 162 | } else { | 405 | 162 | return r.error == simdutf::error_code::SUCCESS; | 406 | 162 | } | 407 | 162 | }(implret1); | 408 | 162 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 162 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 162 | const ToType canary2{25}; | 414 | 162 | const auto outputbuffer_first_run = outputbuffer; | 415 | 162 | std::ranges::fill(outputbuffer, canary2); | 416 | 162 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 162 | src.size(), outputbuffer.data()); | 418 | | | 419 | 162 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 162 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 156 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 156 | 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 | 156 | } | 440 | 162 | } | 441 | 162 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 162 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 54 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 54 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 54 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 54 | } else { | 474 | 54 | ret.implementations_agree = true; | 475 | 54 | } | 476 | 54 | return ret; | 477 | 54 | } |
Conversion<(UtfEncodings)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 | 243 | const bool inputisvalid) const { | 383 | 243 | conversion_result ret{}; | 384 | | | 385 | 243 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 243 | std::vector<result<ConversionResult>> results; | 388 | 243 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 243 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 243 | outputbuffers.reserve(implementations.size()); | 394 | 972 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 729 | auto impl = implementations[i]; | 396 | 729 | const ToType canary1{42}; | 397 | 729 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 729 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 729 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 729 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 729 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 729 | return r != 0; | 404 | 729 | } else { | 405 | 729 | return r.error == simdutf::error_code::SUCCESS; | 406 | 729 | } | 407 | 729 | }(implret1); | 408 | 729 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 729 | 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 | 729 | const ToType canary2{25}; | 414 | 729 | const auto outputbuffer_first_run = outputbuffer; | 415 | 729 | std::ranges::fill(outputbuffer, canary2); | 416 | 729 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 729 | src.size(), outputbuffer.data()); | 418 | | | 419 | 729 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 729 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 723 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 723 | 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 | 723 | } | 440 | 729 | } | 441 | 729 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 729 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 243 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 243 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 243 | 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 | 243 | } else { | 474 | 243 | ret.implementations_agree = true; | 475 | 243 | } | 476 | 243 | return ret; | 477 | 243 | } |
|
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.94k | +[](std::span<const char> chardata) { \ |
555 | 9.94k | const auto c = \ |
556 | 9.94k | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ |
557 | 9.94k | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ |
558 | 9.94k | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ |
559 | 9.94k | &I::lenfunc, &I::conversionfunc, \ |
560 | 9.94k | std::string{NAMEOF(&I::lenfunc)}, \ |
561 | 9.94k | std::string{NAMEOF(&I::conversionfunc)}}; \ |
562 | 9.94k | c.fuzz(chardata); \ |
563 | 9.94k | } \ conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 86 | +[](std::span<const char> chardata) { \ | 555 | 86 | const auto c = \ | 556 | 86 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 86 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 86 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 86 | &I::lenfunc, &I::conversionfunc, \ | 560 | 86 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 86 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 86 | c.fuzz(chardata); \ | 563 | 86 | } \ |
conversion.cpp:populate_functions()::$_1::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()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 66 | +[](std::span<const char> chardata) { \ | 555 | 66 | const auto c = \ | 556 | 66 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 66 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 66 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 66 | &I::lenfunc, &I::conversionfunc, \ | 560 | 66 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 66 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 66 | c.fuzz(chardata); \ | 563 | 66 | } \ |
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 199 | +[](std::span<const char> chardata) { \ | 555 | 199 | const auto c = \ | 556 | 199 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 199 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 199 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 199 | &I::lenfunc, &I::conversionfunc, \ | 560 | 199 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 199 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 199 | c.fuzz(chardata); \ | 563 | 199 | } \ |
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 73 | +[](std::span<const char> chardata) { \ | 555 | 73 | const auto c = \ | 556 | 73 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 73 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 73 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 73 | &I::lenfunc, &I::conversionfunc, \ | 560 | 73 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 73 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 73 | c.fuzz(chardata); \ | 563 | 73 | } \ |
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 150 | +[](std::span<const char> chardata) { \ | 555 | 150 | const auto c = \ | 556 | 150 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 150 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 150 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 150 | &I::lenfunc, &I::conversionfunc, \ | 560 | 150 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 150 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 150 | c.fuzz(chardata); \ | 563 | 150 | } \ |
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 105 | +[](std::span<const char> chardata) { \ | 555 | 105 | const auto c = \ | 556 | 105 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 105 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 105 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 105 | &I::lenfunc, &I::conversionfunc, \ | 560 | 105 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 105 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 105 | c.fuzz(chardata); \ | 563 | 105 | } \ |
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 239 | +[](std::span<const char> chardata) { \ | 555 | 239 | const auto c = \ | 556 | 239 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 239 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 239 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 239 | &I::lenfunc, &I::conversionfunc, \ | 560 | 239 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 239 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 239 | c.fuzz(chardata); \ | 563 | 239 | } \ |
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 181 | +[](std::span<const char> chardata) { \ | 555 | 181 | const auto c = \ | 556 | 181 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 181 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 181 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 181 | &I::lenfunc, &I::conversionfunc, \ | 560 | 181 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 181 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 181 | c.fuzz(chardata); \ | 563 | 181 | } \ |
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 267 | +[](std::span<const char> chardata) { \ | 555 | 267 | const auto c = \ | 556 | 267 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 267 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 267 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 267 | &I::lenfunc, &I::conversionfunc, \ | 560 | 267 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 267 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 267 | c.fuzz(chardata); \ | 563 | 267 | } \ |
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 58 | +[](std::span<const char> chardata) { \ | 555 | 58 | const auto c = \ | 556 | 58 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 58 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 58 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 58 | &I::lenfunc, &I::conversionfunc, \ | 560 | 58 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 58 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 58 | c.fuzz(chardata); \ | 563 | 58 | } \ |
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 151 | +[](std::span<const char> chardata) { \ | 555 | 151 | const auto c = \ | 556 | 151 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 151 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 151 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 151 | &I::lenfunc, &I::conversionfunc, \ | 560 | 151 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 151 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 151 | c.fuzz(chardata); \ | 563 | 151 | } \ |
conversion.cpp:populate_functions()::$_12::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 197 | +[](std::span<const char> chardata) { \ | 555 | 197 | const auto c = \ | 556 | 197 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 197 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 197 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 197 | &I::lenfunc, &I::conversionfunc, \ | 560 | 197 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 197 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 197 | c.fuzz(chardata); \ | 563 | 197 | } \ |
conversion.cpp:populate_functions()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 67 | +[](std::span<const char> chardata) { \ | 555 | 67 | const auto c = \ | 556 | 67 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 67 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 67 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 67 | &I::lenfunc, &I::conversionfunc, \ | 560 | 67 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 67 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 67 | c.fuzz(chardata); \ | 563 | 67 | } \ |
conversion.cpp:populate_functions()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 154 | +[](std::span<const char> chardata) { \ | 555 | 154 | const auto c = \ | 556 | 154 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 154 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 154 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 154 | &I::lenfunc, &I::conversionfunc, \ | 560 | 154 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 154 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 154 | c.fuzz(chardata); \ | 563 | 154 | } \ |
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 253 | +[](std::span<const char> chardata) { \ | 555 | 253 | const auto c = \ | 556 | 253 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 253 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 253 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 253 | &I::lenfunc, &I::conversionfunc, \ | 560 | 253 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 253 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 253 | c.fuzz(chardata); \ | 563 | 253 | } \ |
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 93 | +[](std::span<const char> chardata) { \ | 555 | 93 | const auto c = \ | 556 | 93 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 93 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 93 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 93 | &I::lenfunc, &I::conversionfunc, \ | 560 | 93 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 93 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 93 | c.fuzz(chardata); \ | 563 | 93 | } \ |
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 258 | +[](std::span<const char> chardata) { \ | 555 | 258 | const auto c = \ | 556 | 258 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 258 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 258 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 258 | &I::lenfunc, &I::conversionfunc, \ | 560 | 258 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 258 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 258 | c.fuzz(chardata); \ | 563 | 258 | } \ |
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 251 | +[](std::span<const char> chardata) { \ | 555 | 251 | const auto c = \ | 556 | 251 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 251 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 251 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 251 | &I::lenfunc, &I::conversionfunc, \ | 560 | 251 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 251 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 251 | c.fuzz(chardata); \ | 563 | 251 | } \ |
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 357 | +[](std::span<const char> chardata) { \ | 555 | 357 | const auto c = \ | 556 | 357 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 357 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 357 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 357 | &I::lenfunc, &I::conversionfunc, \ | 560 | 357 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 357 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 357 | c.fuzz(chardata); \ | 563 | 357 | } \ |
conversion.cpp:populate_functions()::$_20::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 358 | +[](std::span<const char> chardata) { \ | 555 | 358 | const auto c = \ | 556 | 358 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 358 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 358 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 358 | &I::lenfunc, &I::conversionfunc, \ | 560 | 358 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 358 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 358 | c.fuzz(chardata); \ | 563 | 358 | } \ |
conversion.cpp:populate_functions()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 487 | +[](std::span<const char> chardata) { \ | 555 | 487 | const auto c = \ | 556 | 487 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 487 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 487 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 487 | &I::lenfunc, &I::conversionfunc, \ | 560 | 487 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 487 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 487 | c.fuzz(chardata); \ | 563 | 487 | } \ |
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 475 | +[](std::span<const char> chardata) { \ | 555 | 475 | const auto c = \ | 556 | 475 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 475 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 475 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 475 | &I::lenfunc, &I::conversionfunc, \ | 560 | 475 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 475 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 475 | c.fuzz(chardata); \ | 563 | 475 | } \ |
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 475 | +[](std::span<const char> chardata) { \ | 555 | 475 | const auto c = \ | 556 | 475 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 475 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 475 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 475 | &I::lenfunc, &I::conversionfunc, \ | 560 | 475 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 475 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 475 | c.fuzz(chardata); \ | 563 | 475 | } \ |
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 124 | +[](std::span<const char> chardata) { \ | 555 | 124 | const auto c = \ | 556 | 124 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 124 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 124 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 124 | &I::lenfunc, &I::conversionfunc, \ | 560 | 124 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 124 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 124 | c.fuzz(chardata); \ | 563 | 124 | } \ |
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 183 | +[](std::span<const char> chardata) { \ | 555 | 183 | const auto c = \ | 556 | 183 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 183 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 183 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 183 | &I::lenfunc, &I::conversionfunc, \ | 560 | 183 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 183 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 183 | c.fuzz(chardata); \ | 563 | 183 | } \ |
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 308 | +[](std::span<const char> chardata) { \ | 555 | 308 | const auto c = \ | 556 | 308 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 308 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 308 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 308 | &I::lenfunc, &I::conversionfunc, \ | 560 | 308 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 308 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 308 | c.fuzz(chardata); \ | 563 | 308 | } \ |
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 132 | +[](std::span<const char> chardata) { \ | 555 | 132 | const auto c = \ | 556 | 132 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 132 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 132 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 132 | &I::lenfunc, &I::conversionfunc, \ | 560 | 132 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 132 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 132 | c.fuzz(chardata); \ | 563 | 132 | } \ |
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 193 | +[](std::span<const char> chardata) { \ | 555 | 193 | const auto c = \ | 556 | 193 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 193 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 193 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 193 | &I::lenfunc, &I::conversionfunc, \ | 560 | 193 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 193 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 193 | c.fuzz(chardata); \ | 563 | 193 | } \ |
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 356 | +[](std::span<const char> chardata) { \ | 555 | 356 | const auto c = \ | 556 | 356 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 356 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 356 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 356 | &I::lenfunc, &I::conversionfunc, \ | 560 | 356 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 356 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 356 | c.fuzz(chardata); \ | 563 | 356 | } \ |
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 244 | +[](std::span<const char> chardata) { \ | 555 | 244 | const auto c = \ | 556 | 244 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 244 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 244 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 244 | &I::lenfunc, &I::conversionfunc, \ | 560 | 244 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 244 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 244 | c.fuzz(chardata); \ | 563 | 244 | } \ |
conversion.cpp:populate_functions()::$_31::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 339 | +[](std::span<const char> chardata) { \ | 555 | 339 | const auto c = \ | 556 | 339 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 339 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 339 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 339 | &I::lenfunc, &I::conversionfunc, \ | 560 | 339 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 339 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 339 | c.fuzz(chardata); \ | 563 | 339 | } \ |
conversion.cpp:populate_functions()::$_32::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()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 430 | +[](std::span<const char> chardata) { \ | 555 | 430 | const auto c = \ | 556 | 430 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 430 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 430 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 430 | &I::lenfunc, &I::conversionfunc, \ | 560 | 430 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 430 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 430 | c.fuzz(chardata); \ | 563 | 430 | } \ |
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 335 | +[](std::span<const char> chardata) { \ | 555 | 335 | const auto c = \ | 556 | 335 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 335 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 335 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 335 | &I::lenfunc, &I::conversionfunc, \ | 560 | 335 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 335 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 335 | c.fuzz(chardata); \ | 563 | 335 | } \ |
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 451 | +[](std::span<const char> chardata) { \ | 555 | 451 | const auto c = \ | 556 | 451 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 451 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 451 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 451 | &I::lenfunc, &I::conversionfunc, \ | 560 | 451 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 451 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 451 | c.fuzz(chardata); \ | 563 | 451 | } \ |
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 391 | +[](std::span<const char> chardata) { \ | 555 | 391 | const auto c = \ | 556 | 391 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 391 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 391 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 391 | &I::lenfunc, &I::conversionfunc, \ | 560 | 391 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 391 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 391 | c.fuzz(chardata); \ | 563 | 391 | } \ |
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 459 | +[](std::span<const char> chardata) { \ | 555 | 459 | const auto c = \ | 556 | 459 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 459 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 459 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 459 | &I::lenfunc, &I::conversionfunc, \ | 560 | 459 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 459 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 459 | c.fuzz(chardata); \ | 563 | 459 | } \ |
conversion.cpp:populate_functions()::$_38::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()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 54 | +[](std::span<const char> chardata) { \ | 555 | 54 | const auto c = \ | 556 | 54 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 54 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 54 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 54 | &I::lenfunc, &I::conversionfunc, \ | 560 | 54 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 54 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 54 | c.fuzz(chardata); \ | 563 | 54 | } \ |
conversion.cpp:populate_functions()::$_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 | 243 | +[](std::span<const char> chardata) { \ | 555 | 243 | const auto c = \ | 556 | 243 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 243 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 243 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 243 | &I::lenfunc, &I::conversionfunc, \ | 560 | 243 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 243 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 243 | c.fuzz(chardata); \ | 563 | 243 | } \ |
|
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.95k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
640 | 9.95k | static const auto fptrs = populate_functions(); |
641 | 9.95k | 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.95k | if (size < 4) { |
647 | 3 | return 0; |
648 | 3 | } |
649 | | |
650 | 9.94k | constexpr auto actionmask = std::bit_ceil(Ncases) - 1; |
651 | 9.94k | const auto action = data[0] & actionmask; |
652 | 9.94k | data += 4; |
653 | 9.94k | size -= 4; |
654 | | |
655 | 9.94k | if (action >= Ncases) { |
656 | 1 | return 0; |
657 | 1 | } |
658 | | |
659 | 9.94k | if constexpr (use_separate_allocation) { |
660 | | // this is better at exercising null input and catch buffer underflows |
661 | 9.94k | const std::vector<char> separate{data, data + size}; |
662 | 9.94k | 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.94k | return 0; |
669 | 9.94k | } |