/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.34k | void fuzz(std::span<const char> chardata) const { |
176 | | // assume the input is aligned to FromType |
177 | 9.34k | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), |
178 | 9.34k | chardata.size() / sizeof(FromType)}; |
179 | | |
180 | 9.34k | static const bool do_print_testcase = |
181 | 9.34k | std::getenv("PRINT_FUZZ_CASE") != nullptr; |
182 | | |
183 | 9.34k | if (do_print_testcase) { |
184 | 0 | dump_testcase(from, std::cerr); |
185 | 0 | std::exit(EXIT_SUCCESS); |
186 | 0 | } |
187 | | |
188 | 9.34k | do { |
189 | | // step 0 - is the input valid? |
190 | 9.34k | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); |
191 | 9.34k | 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.36k | From == UtfEncodings::UTF8) { |
198 | 6.36k | if (!count_the_input(from) && !allow_implementations_to_differ) |
199 | 0 | break; |
200 | 6.36k | } |
201 | | |
202 | | // step 2 - what is the required size of the output? |
203 | 6.36k | const auto [output_length, length_agree] = |
204 | 9.34k | calculate_length(from, inputisvalid); |
205 | 9.34k | if (!length_agree && !allow_implementations_to_differ) |
206 | 0 | break; |
207 | | |
208 | 9.34k | if (!inputisvalid && name.find("valid") != std::string::npos) { |
209 | | // don't run the conversion step, it requires valid input |
210 | 82 | return; |
211 | 82 | } |
212 | | |
213 | | // step 3 - run the conversion |
214 | 9.25k | const auto [written, outputs_agree] = |
215 | 9.25k | do_conversion(from, output_length, inputisvalid); |
216 | 9.25k | if (!outputs_agree && !allow_implementations_to_differ) |
217 | 0 | break; |
218 | | |
219 | | // coming this far means no problems were found |
220 | 9.25k | return; |
221 | 9.25k | } 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.34k | } 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 | 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 | 243 | From == UtfEncodings::UTF8) { | 198 | 243 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 243 | } | 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 | 22 | return; | 211 | 22 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 221 | const auto [written, outputs_agree] = | 215 | 221 | do_conversion(from, output_length, inputisvalid); | 216 | 221 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 221 | return; | 221 | 221 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 243 | } |
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 | 403 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 403 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 403 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 403 | static const bool do_print_testcase = | 181 | 403 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 403 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 403 | do { | 189 | | // step 0 - is the input valid? | 190 | 403 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 403 | 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 | 403 | From == UtfEncodings::UTF8) { | 198 | 403 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 403 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 403 | const auto [output_length, length_agree] = | 204 | 403 | calculate_length(from, inputisvalid); | 205 | 403 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 403 | 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 | 392 | const auto [written, outputs_agree] = | 215 | 392 | do_conversion(from, output_length, inputisvalid); | 216 | 392 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 392 | return; | 221 | 392 | } 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 | 403 | } |
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 | 232 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 232 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 232 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 232 | static const bool do_print_testcase = | 181 | 232 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 232 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 232 | do { | 189 | | // step 0 - is the input valid? | 190 | 232 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 232 | 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 | 232 | From == UtfEncodings::UTF8) { | 198 | 232 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 232 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 232 | const auto [output_length, length_agree] = | 204 | 232 | calculate_length(from, inputisvalid); | 205 | 232 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 232 | 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 | 224 | const auto [written, outputs_agree] = | 215 | 224 | do_conversion(from, output_length, inputisvalid); | 216 | 224 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 224 | return; | 221 | 224 | } 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 | 232 | } |
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 | 398 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 398 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 398 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 398 | static const bool do_print_testcase = | 181 | 398 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 398 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 398 | do { | 189 | | // step 0 - is the input valid? | 190 | 398 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 398 | 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 | 398 | From == UtfEncodings::UTF8) { | 198 | 398 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 398 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 398 | const auto [output_length, length_agree] = | 204 | 398 | calculate_length(from, inputisvalid); | 205 | 398 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 398 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 12 | return; | 211 | 12 | } | 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 | 398 | } |
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 | 291 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 291 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 291 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 291 | static const bool do_print_testcase = | 181 | 291 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 291 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 291 | do { | 189 | | // step 0 - is the input valid? | 190 | 291 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 291 | 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 | 291 | const auto [output_length, length_agree] = | 204 | 291 | calculate_length(from, inputisvalid); | 205 | 291 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 291 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 2 | return; | 211 | 2 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 289 | const auto [written, outputs_agree] = | 215 | 289 | do_conversion(from, output_length, inputisvalid); | 216 | 289 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 289 | return; | 221 | 289 | } 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 | 291 | } |
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 | 384 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 384 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 384 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 384 | static const bool do_print_testcase = | 181 | 384 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 384 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 384 | do { | 189 | | // step 0 - is the input valid? | 190 | 384 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 384 | 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 | 384 | const auto [output_length, length_agree] = | 204 | 384 | calculate_length(from, inputisvalid); | 205 | 384 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 384 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 3 | return; | 211 | 3 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 381 | const auto [written, outputs_agree] = | 215 | 381 | do_conversion(from, output_length, inputisvalid); | 216 | 381 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 381 | return; | 221 | 381 | } 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 | 384 | } |
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 | 502 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 502 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 502 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 502 | static const bool do_print_testcase = | 181 | 502 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 502 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 502 | do { | 189 | | // step 0 - is the input valid? | 190 | 502 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 502 | 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 | 502 | const auto [output_length, length_agree] = | 204 | 502 | calculate_length(from, inputisvalid); | 205 | 502 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 502 | 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 | 498 | const auto [written, outputs_agree] = | 215 | 498 | do_conversion(from, output_length, inputisvalid); | 216 | 498 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 498 | return; | 221 | 498 | } 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 | 502 | } |
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 | 641 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 641 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 641 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 641 | static const bool do_print_testcase = | 181 | 641 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 641 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 641 | do { | 189 | | // step 0 - is the input valid? | 190 | 641 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 641 | 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 | 641 | From == UtfEncodings::UTF8) { | 198 | 641 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 641 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 641 | const auto [output_length, length_agree] = | 204 | 641 | calculate_length(from, inputisvalid); | 205 | 641 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 641 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 10 | return; | 211 | 10 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 631 | const auto [written, outputs_agree] = | 215 | 631 | do_conversion(from, output_length, inputisvalid); | 216 | 631 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 631 | return; | 221 | 631 | } 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 | 641 | } |
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 | 657 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 657 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 657 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 657 | static const bool do_print_testcase = | 181 | 657 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 657 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 657 | do { | 189 | | // step 0 - is the input valid? | 190 | 657 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 657 | 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 | 657 | From == UtfEncodings::UTF8) { | 198 | 657 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 657 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 657 | const auto [output_length, length_agree] = | 204 | 657 | calculate_length(from, inputisvalid); | 205 | 657 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 657 | 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 | 652 | const auto [written, outputs_agree] = | 215 | 652 | do_conversion(from, output_length, inputisvalid); | 216 | 652 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 652 | return; | 221 | 652 | } 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 | 657 | } |
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 | 677 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 677 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 677 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 677 | static const bool do_print_testcase = | 181 | 677 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 677 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 677 | do { | 189 | | // step 0 - is the input valid? | 190 | 677 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 677 | 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 | 677 | From == UtfEncodings::UTF8) { | 198 | 677 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 677 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 677 | const auto [output_length, length_agree] = | 204 | 677 | calculate_length(from, inputisvalid); | 205 | 677 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 677 | 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 | 672 | const auto [written, outputs_agree] = | 215 | 672 | do_conversion(from, output_length, inputisvalid); | 216 | 672 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 672 | return; | 221 | 672 | } 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 | 677 | } |
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 | 56 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 56 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 56 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 56 | static const bool do_print_testcase = | 181 | 56 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 56 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 56 | do { | 189 | | // step 0 - is the input valid? | 190 | 56 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 56 | 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 | 56 | From == UtfEncodings::UTF8) { | 198 | 56 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 56 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 56 | const auto [output_length, length_agree] = | 204 | 56 | calculate_length(from, inputisvalid); | 205 | 56 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 56 | 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 | 56 | const auto [written, outputs_agree] = | 215 | 56 | do_conversion(from, output_length, inputisvalid); | 216 | 56 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 56 | return; | 221 | 56 | } 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 | 56 | } |
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 | 74 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 74 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 74 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 74 | static const bool do_print_testcase = | 181 | 74 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 74 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 74 | do { | 189 | | // step 0 - is the input valid? | 190 | 74 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 74 | 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 | 74 | From == UtfEncodings::UTF8) { | 198 | 74 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 74 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 74 | const auto [output_length, length_agree] = | 204 | 74 | calculate_length(from, inputisvalid); | 205 | 74 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 74 | 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 | 74 | const auto [written, outputs_agree] = | 215 | 74 | do_conversion(from, output_length, inputisvalid); | 216 | 74 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 74 | return; | 221 | 74 | } 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 | 74 | } |
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 | 98 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 98 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 98 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 98 | static const bool do_print_testcase = | 181 | 98 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 98 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 98 | do { | 189 | | // step 0 - is the input valid? | 190 | 98 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 98 | 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 | 98 | const auto [output_length, length_agree] = | 204 | 98 | calculate_length(from, inputisvalid); | 205 | 98 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 98 | 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 | 98 | const auto [written, outputs_agree] = | 215 | 98 | do_conversion(from, output_length, inputisvalid); | 216 | 98 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 98 | return; | 221 | 98 | } 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 | 98 | } |
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 | 286 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 286 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 286 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 286 | static const bool do_print_testcase = | 181 | 286 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 286 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 286 | do { | 189 | | // step 0 - is the input valid? | 190 | 286 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 286 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | 286 | From == UtfEncodings::UTF8) { | 198 | 286 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 286 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 286 | const auto [output_length, length_agree] = | 204 | 286 | calculate_length(from, inputisvalid); | 205 | 286 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 286 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 286 | const auto [written, outputs_agree] = | 215 | 286 | do_conversion(from, output_length, inputisvalid); | 216 | 286 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 286 | return; | 221 | 286 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 286 | } |
Conversion<(UtfEncodings)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 | 130 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 130 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 130 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 130 | static const bool do_print_testcase = | 181 | 130 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 130 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 130 | do { | 189 | | // step 0 - is the input valid? | 190 | 130 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 130 | 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 | 130 | From == UtfEncodings::UTF8) { | 198 | 130 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 130 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 130 | const auto [output_length, length_agree] = | 204 | 130 | calculate_length(from, inputisvalid); | 205 | 130 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 130 | 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 | 130 | const auto [written, outputs_agree] = | 215 | 130 | do_conversion(from, output_length, inputisvalid); | 216 | 130 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 130 | return; | 221 | 130 | } 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 | 130 | } |
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 | 175 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 175 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 175 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 175 | static const bool do_print_testcase = | 181 | 175 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 175 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 175 | do { | 189 | | // step 0 - is the input valid? | 190 | 175 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 175 | 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 | 175 | From == UtfEncodings::UTF8) { | 198 | 175 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 175 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 175 | const auto [output_length, length_agree] = | 204 | 175 | calculate_length(from, inputisvalid); | 205 | 175 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 175 | 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 | 175 | const auto [written, outputs_agree] = | 215 | 175 | do_conversion(from, output_length, inputisvalid); | 216 | 175 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 175 | return; | 221 | 175 | } 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 | 175 | } |
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 | 316 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 316 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 316 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 316 | static const bool do_print_testcase = | 181 | 316 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 316 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 316 | do { | 189 | | // step 0 - is the input valid? | 190 | 316 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 316 | 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 | 316 | From == UtfEncodings::UTF8) { | 198 | 316 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 316 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 316 | const auto [output_length, length_agree] = | 204 | 316 | calculate_length(from, inputisvalid); | 205 | 316 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 316 | 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 | 316 | const auto [written, outputs_agree] = | 215 | 316 | do_conversion(from, output_length, inputisvalid); | 216 | 316 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 316 | return; | 221 | 316 | } 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 | 316 | } |
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 | 126 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 126 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 126 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 126 | static const bool do_print_testcase = | 181 | 126 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 126 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 126 | do { | 189 | | // step 0 - is the input valid? | 190 | 126 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 126 | 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 | 126 | From == UtfEncodings::UTF8) { | 198 | 126 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 126 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 126 | const auto [output_length, length_agree] = | 204 | 126 | calculate_length(from, inputisvalid); | 205 | 126 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 126 | 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 | 126 | const auto [written, outputs_agree] = | 215 | 126 | do_conversion(from, output_length, inputisvalid); | 216 | 126 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 126 | return; | 221 | 126 | } 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 | 126 | } |
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 | 162 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 162 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 162 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 162 | static const bool do_print_testcase = | 181 | 162 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 162 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 162 | do { | 189 | | // step 0 - is the input valid? | 190 | 162 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 162 | 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 | 162 | From == UtfEncodings::UTF8) { | 198 | 162 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 162 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 162 | const auto [output_length, length_agree] = | 204 | 162 | calculate_length(from, inputisvalid); | 205 | 162 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 162 | 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 | 162 | const auto [written, outputs_agree] = | 215 | 162 | do_conversion(from, output_length, inputisvalid); | 216 | 162 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 162 | return; | 221 | 162 | } 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 | 162 | } |
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 | 352 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 352 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 352 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 352 | static const bool do_print_testcase = | 181 | 352 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 352 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 352 | do { | 189 | | // step 0 - is the input valid? | 190 | 352 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 352 | 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 | 352 | From == UtfEncodings::UTF8) { | 198 | 352 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 352 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 352 | const auto [output_length, length_agree] = | 204 | 352 | calculate_length(from, inputisvalid); | 205 | 352 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 352 | 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 | 352 | const auto [written, outputs_agree] = | 215 | 352 | do_conversion(from, output_length, inputisvalid); | 216 | 352 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 352 | return; | 221 | 352 | } 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 | 352 | } |
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 | 205 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 205 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 205 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 205 | static const bool do_print_testcase = | 181 | 205 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 205 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 205 | do { | 189 | | // step 0 - is the input valid? | 190 | 205 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 205 | 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 | 205 | const auto [output_length, length_agree] = | 204 | 205 | calculate_length(from, inputisvalid); | 205 | 205 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 205 | 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 | 205 | const auto [written, outputs_agree] = | 215 | 205 | do_conversion(from, output_length, inputisvalid); | 216 | 205 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 205 | return; | 221 | 205 | } 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 | 205 | } |
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 | 318 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 318 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 318 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 318 | static const bool do_print_testcase = | 181 | 318 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 318 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 318 | do { | 189 | | // step 0 - is the input valid? | 190 | 318 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 318 | if (!valid_input_agree && !allow_implementations_to_differ) | 192 | 0 | break; | 193 | | | 194 | | // step 1 - count the input (only makes sense for some of the encodings) | 195 | | if constexpr (From == UtfEncodings::UTF16BE || | 196 | | From == UtfEncodings::UTF16LE || | 197 | | From == UtfEncodings::UTF8) { | 198 | | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | | break; | 200 | | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 318 | const auto [output_length, length_agree] = | 204 | 318 | calculate_length(from, inputisvalid); | 205 | 318 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 318 | if (!inputisvalid && name.find("valid") != std::string::npos) { | 209 | | // don't run the conversion step, it requires valid input | 210 | 0 | return; | 211 | 0 | } | 212 | | | 213 | | // step 3 - run the conversion | 214 | 318 | const auto [written, outputs_agree] = | 215 | 318 | do_conversion(from, output_length, inputisvalid); | 216 | 318 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 318 | return; | 221 | 318 | } while (0); | 222 | | // if we come here, something failed | 223 | 0 | std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a " | 224 | 0 | "reproducer to stderr\n"; | 225 | 0 | std::abort(); | 226 | 318 | } |
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 | 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 | | 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 | 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)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 | 432 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 432 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 432 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 432 | static const bool do_print_testcase = | 181 | 432 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 432 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 432 | do { | 189 | | // step 0 - is the input valid? | 190 | 432 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 432 | 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 | 432 | const auto [output_length, length_agree] = | 204 | 432 | calculate_length(from, inputisvalid); | 205 | 432 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 432 | 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 | 432 | const auto [written, outputs_agree] = | 215 | 432 | do_conversion(from, output_length, inputisvalid); | 216 | 432 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 432 | return; | 221 | 432 | } 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 | 432 | } |
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 | 326 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 326 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 326 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 326 | static const bool do_print_testcase = | 181 | 326 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 326 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 326 | do { | 189 | | // step 0 - is the input valid? | 190 | 326 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 326 | 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 | 326 | From == UtfEncodings::UTF8) { | 198 | 326 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 326 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 326 | const auto [output_length, length_agree] = | 204 | 326 | calculate_length(from, inputisvalid); | 205 | 326 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 326 | 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 | 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 | 326 | } |
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 | 413 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 413 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 413 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 413 | static const bool do_print_testcase = | 181 | 413 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 413 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 413 | do { | 189 | | // step 0 - is the input valid? | 190 | 413 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 413 | 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 | 413 | From == UtfEncodings::UTF8) { | 198 | 413 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 413 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 413 | const auto [output_length, length_agree] = | 204 | 413 | calculate_length(from, inputisvalid); | 205 | 413 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 413 | 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 | 413 | const auto [written, outputs_agree] = | 215 | 413 | do_conversion(from, output_length, inputisvalid); | 216 | 413 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 413 | return; | 221 | 413 | } 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 | 413 | } |
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 | 295 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 295 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 295 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 295 | static const bool do_print_testcase = | 181 | 295 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 295 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 295 | do { | 189 | | // step 0 - is the input valid? | 190 | 295 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 295 | 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 | 295 | From == UtfEncodings::UTF8) { | 198 | 295 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 295 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 295 | const auto [output_length, length_agree] = | 204 | 295 | calculate_length(from, inputisvalid); | 205 | 295 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 295 | 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 | 295 | const auto [written, outputs_agree] = | 215 | 295 | do_conversion(from, output_length, inputisvalid); | 216 | 295 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 295 | return; | 221 | 295 | } 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 | 295 | } |
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 | 404 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 404 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 404 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 404 | static const bool do_print_testcase = | 181 | 404 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 404 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 404 | do { | 189 | | // step 0 - is the input valid? | 190 | 404 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 404 | 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 | 404 | From == UtfEncodings::UTF8) { | 198 | 404 | if (!count_the_input(from) && !allow_implementations_to_differ) | 199 | 0 | break; | 200 | 404 | } | 201 | | | 202 | | // step 2 - what is the required size of the output? | 203 | 404 | const auto [output_length, length_agree] = | 204 | 404 | calculate_length(from, inputisvalid); | 205 | 404 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 404 | 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 | 404 | const auto [written, outputs_agree] = | 215 | 404 | do_conversion(from, output_length, inputisvalid); | 216 | 404 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 404 | return; | 221 | 404 | } 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 | 404 | } |
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 | 53 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 53 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 53 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 53 | static const bool do_print_testcase = | 181 | 53 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 53 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 53 | do { | 189 | | // step 0 - is the input valid? | 190 | 53 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 53 | 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 | 53 | const auto [output_length, length_agree] = | 204 | 53 | calculate_length(from, inputisvalid); | 205 | 53 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 53 | 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 | 53 | const auto [written, outputs_agree] = | 215 | 53 | do_conversion(from, output_length, inputisvalid); | 216 | 53 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 53 | return; | 221 | 53 | } 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 | 53 | } |
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 | 45 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 45 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 45 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 45 | static const bool do_print_testcase = | 181 | 45 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 45 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 45 | do { | 189 | | // step 0 - is the input valid? | 190 | 45 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 45 | 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 | 45 | const auto [output_length, length_agree] = | 204 | 45 | calculate_length(from, inputisvalid); | 205 | 45 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 45 | 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 | 45 | const auto [written, outputs_agree] = | 215 | 45 | do_conversion(from, output_length, inputisvalid); | 216 | 45 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 45 | return; | 221 | 45 | } 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 | 45 | } |
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 | 42 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 42 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 42 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 42 | static const bool do_print_testcase = | 181 | 42 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 42 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 42 | do { | 189 | | // step 0 - is the input valid? | 190 | 42 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 42 | 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 | 42 | const auto [output_length, length_agree] = | 204 | 42 | calculate_length(from, inputisvalid); | 205 | 42 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 42 | 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 | 42 | const auto [written, outputs_agree] = | 215 | 42 | do_conversion(from, output_length, inputisvalid); | 216 | 42 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 42 | return; | 221 | 42 | } 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 | 42 | } |
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 | 270 | void fuzz(std::span<const char> chardata) const { | 176 | | // assume the input is aligned to FromType | 177 | 270 | const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()), | 178 | 270 | chardata.size() / sizeof(FromType)}; | 179 | | | 180 | 270 | static const bool do_print_testcase = | 181 | 270 | std::getenv("PRINT_FUZZ_CASE") != nullptr; | 182 | | | 183 | 270 | if (do_print_testcase) { | 184 | 0 | dump_testcase(from, std::cerr); | 185 | 0 | std::exit(EXIT_SUCCESS); | 186 | 0 | } | 187 | | | 188 | 270 | do { | 189 | | // step 0 - is the input valid? | 190 | 270 | const auto [inputisvalid, valid_input_agree] = verify_valid_input(from); | 191 | 270 | 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 | 270 | const auto [output_length, length_agree] = | 204 | 270 | calculate_length(from, inputisvalid); | 205 | 270 | if (!length_agree && !allow_implementations_to_differ) | 206 | 0 | break; | 207 | | | 208 | 270 | 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 | 270 | const auto [written, outputs_agree] = | 215 | 270 | do_conversion(from, output_length, inputisvalid); | 216 | 270 | if (!outputs_agree && !allow_implementations_to_differ) | 217 | 0 | break; | 218 | | | 219 | | // coming this far means no problems were found | 220 | 270 | return; | 221 | 270 | } 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 | 270 | } |
|
227 | | |
228 | | template <typename Dummy = void> |
229 | | requires(From != UtfEncodings::LATIN1) |
230 | 8.93k | validation_result verify_valid_input(FromSpan src) const { |
231 | 8.93k | validation_result ret{}; |
232 | | |
233 | 8.93k | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; |
234 | 8.93k | const auto implementations = get_supported_implementations(); |
235 | 8.93k | std::vector<simdutf::result> results; |
236 | 8.93k | results.reserve(implementations.size()); |
237 | | |
238 | 26.7k | for (auto impl : implementations) { |
239 | 26.7k | results.push_back( |
240 | 26.7k | std::invoke(input_validation, impl, src.data(), src.size())); |
241 | | |
242 | | // make sure the validation variant that returns a bool agrees |
243 | 26.7k | const bool validation1 = results.back().error == simdutf::SUCCESS; |
244 | 26.7k | const bool validation2 = |
245 | 26.7k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, |
246 | 26.7k | src.data(), src.size()); |
247 | 26.7k | if (validation1 != validation2) { |
248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; |
249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName |
250 | 0 | << " gives " << validation1 << " while " |
251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " |
252 | 0 | << validation2 << " for implementation " << impl->name() |
253 | 0 | << '\n'; |
254 | 0 | std::cerr << "end errormessage\n"; |
255 | 0 | std::abort(); |
256 | 0 | } |
257 | 26.7k | } |
258 | | |
259 | 17.8k | 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 | 486 | 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 | 806 | 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 | 464 | 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 | 796 | 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 | 582 | 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 | 768 | 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 | 1.00k | 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.28k | 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.35k | 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 | 112 | 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 | 148 | 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 | 196 | 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 | 572 | 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 | 260 | 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 | 350 | 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 | 632 | 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 | 252 | 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 | 324 | 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 | 704 | 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 | 410 | 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 | 636 | 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 | 670 | 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 | 864 | 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 | 652 | 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 | 826 | 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 | 590 | 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 | 808 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
260 | 8.93k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; |
262 | 0 | std::cerr << "in fuzz case for " |
263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName |
264 | 0 | << " invoked with " << src.size() << " elements:\n"; |
265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
266 | 0 | std::cerr << "got return " << std::dec << results[i] |
267 | 0 | << " from implementation " << implementations[i]->name() |
268 | 0 | << '\n'; |
269 | 0 | } |
270 | 0 | std::cerr << "end errormessage\n"; |
271 | 0 | ret.implementations_agree = false; |
272 | 8.93k | } else { |
273 | 8.93k | ret.implementations_agree = true; |
274 | 8.93k | } |
275 | 17.8k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { |
276 | 17.8k | return r.error == simdutf::SUCCESS; |
277 | 17.8k | }); _ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 505 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 505 | return r.error == simdutf::SUCCESS; | 277 | 505 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.00k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.00k | return r.error == simdutf::SUCCESS; | 277 | 1.00k | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 504 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 504 | return r.error == simdutf::SUCCESS; | 277 | 504 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.01k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.01k | return r.error == simdutf::SUCCESS; | 277 | 1.01k | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 545 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 545 | return r.error == simdutf::SUCCESS; | 277 | 545 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 782 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 782 | return r.error == simdutf::SUCCESS; | 277 | 782 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 916 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 916 | return r.error == simdutf::SUCCESS; | 277 | 916 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.37k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.37k | return r.error == simdutf::SUCCESS; | 277 | 1.37k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.30k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.30k | return r.error == simdutf::SUCCESS; | 277 | 1.30k | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 1.45k | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 1.45k | return r.error == simdutf::SUCCESS; | 277 | 1.45k | }); |
_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 | 172 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 172 | return r.error == simdutf::SUCCESS; | 277 | 172 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 144 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 144 | return r.error == simdutf::SUCCESS; | 277 | 144 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_ Line | Count | Source | 275 | 446 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 446 | return r.error == simdutf::SUCCESS; | 277 | 446 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 326 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 326 | return r.error == simdutf::SUCCESS; | 277 | 326 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 355 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 355 | return r.error == simdutf::SUCCESS; | 277 | 355 | }); |
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 702 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 702 | return r.error == simdutf::SUCCESS; | 277 | 702 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 350 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 350 | return r.error == simdutf::SUCCESS; | 277 | 350 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 320 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 320 | return r.error == simdutf::SUCCESS; | 277 | 320 | }); |
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 820 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 820 | return r.error == simdutf::SUCCESS; | 277 | 820 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_ Line | Count | Source | 275 | 275 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 275 | return r.error == simdutf::SUCCESS; | 277 | 275 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 494 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 494 | return r.error == simdutf::SUCCESS; | 277 | 494 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 535 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 535 | return r.error == simdutf::SUCCESS; | 277 | 535 | }); |
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 656 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 656 | return r.error == simdutf::SUCCESS; | 277 | 656 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 602 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 602 | return r.error == simdutf::SUCCESS; | 277 | 602 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 767 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 767 | return r.error == simdutf::SUCCESS; | 277 | 767 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 541 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 541 | return r.error == simdutf::SUCCESS; | 277 | 541 | }); |
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_ Line | Count | Source | 275 | 750 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 750 | return r.error == simdutf::SUCCESS; | 277 | 750 | }); |
|
278 | 8.93k | return ret; |
279 | 8.93k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 243 | validation_result verify_valid_input(FromSpan src) const { | 231 | 243 | validation_result ret{}; | 232 | | | 233 | 243 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 243 | const auto implementations = get_supported_implementations(); | 235 | 243 | std::vector<simdutf::result> results; | 236 | 243 | results.reserve(implementations.size()); | 237 | | | 238 | 729 | for (auto impl : implementations) { | 239 | 729 | results.push_back( | 240 | 729 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 729 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 729 | const bool validation2 = | 245 | 729 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 729 | src.data(), src.size()); | 247 | 729 | 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 | 729 | } | 258 | | | 259 | 243 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 243 | 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 | 243 | } else { | 273 | 243 | ret.implementations_agree = true; | 274 | 243 | } | 275 | 243 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 243 | return r.error == simdutf::SUCCESS; | 277 | 243 | }); | 278 | 243 | return ret; | 279 | 243 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 403 | validation_result verify_valid_input(FromSpan src) const { | 231 | 403 | validation_result ret{}; | 232 | | | 233 | 403 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 403 | const auto implementations = get_supported_implementations(); | 235 | 403 | std::vector<simdutf::result> results; | 236 | 403 | 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 | 403 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 403 | 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 | 403 | } else { | 273 | 403 | ret.implementations_agree = true; | 274 | 403 | } | 275 | 403 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 403 | return r.error == simdutf::SUCCESS; | 277 | 403 | }); | 278 | 403 | return ret; | 279 | 403 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 232 | validation_result verify_valid_input(FromSpan src) const { | 231 | 232 | validation_result ret{}; | 232 | | | 233 | 232 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 232 | const auto implementations = get_supported_implementations(); | 235 | 232 | std::vector<simdutf::result> results; | 236 | 232 | results.reserve(implementations.size()); | 237 | | | 238 | 696 | for (auto impl : implementations) { | 239 | 696 | results.push_back( | 240 | 696 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 696 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 696 | const bool validation2 = | 245 | 696 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 696 | src.data(), src.size()); | 247 | 696 | 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 | 696 | } | 258 | | | 259 | 232 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 232 | 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 | 232 | } else { | 273 | 232 | ret.implementations_agree = true; | 274 | 232 | } | 275 | 232 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 232 | return r.error == simdutf::SUCCESS; | 277 | 232 | }); | 278 | 232 | return ret; | 279 | 232 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 398 | validation_result verify_valid_input(FromSpan src) const { | 231 | 398 | validation_result ret{}; | 232 | | | 233 | 398 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 398 | const auto implementations = get_supported_implementations(); | 235 | 398 | std::vector<simdutf::result> results; | 236 | 398 | results.reserve(implementations.size()); | 237 | | | 238 | 1.19k | for (auto impl : implementations) { | 239 | 1.19k | results.push_back( | 240 | 1.19k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.19k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.19k | const bool validation2 = | 245 | 1.19k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.19k | src.data(), src.size()); | 247 | 1.19k | 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.19k | } | 258 | | | 259 | 398 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 398 | 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 | 398 | } else { | 273 | 398 | ret.implementations_agree = true; | 274 | 398 | } | 275 | 398 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 398 | return r.error == simdutf::SUCCESS; | 277 | 398 | }); | 278 | 398 | return ret; | 279 | 398 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 291 | validation_result verify_valid_input(FromSpan src) const { | 231 | 291 | validation_result ret{}; | 232 | | | 233 | 291 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 291 | const auto implementations = get_supported_implementations(); | 235 | 291 | std::vector<simdutf::result> results; | 236 | 291 | results.reserve(implementations.size()); | 237 | | | 238 | 873 | for (auto impl : implementations) { | 239 | 873 | results.push_back( | 240 | 873 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 873 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 873 | const bool validation2 = | 245 | 873 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 873 | src.data(), src.size()); | 247 | 873 | 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 | 873 | } | 258 | | | 259 | 291 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 291 | 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 | 291 | } else { | 273 | 291 | ret.implementations_agree = true; | 274 | 291 | } | 275 | 291 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 291 | return r.error == simdutf::SUCCESS; | 277 | 291 | }); | 278 | 291 | return ret; | 279 | 291 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 384 | validation_result verify_valid_input(FromSpan src) const { | 231 | 384 | validation_result ret{}; | 232 | | | 233 | 384 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 384 | const auto implementations = get_supported_implementations(); | 235 | 384 | std::vector<simdutf::result> results; | 236 | 384 | 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 | 384 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 384 | 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 | 384 | } else { | 273 | 384 | ret.implementations_agree = true; | 274 | 384 | } | 275 | 384 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 384 | return r.error == simdutf::SUCCESS; | 277 | 384 | }); | 278 | 384 | return ret; | 279 | 384 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 502 | validation_result verify_valid_input(FromSpan src) const { | 231 | 502 | validation_result ret{}; | 232 | | | 233 | 502 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 502 | const auto implementations = get_supported_implementations(); | 235 | 502 | std::vector<simdutf::result> results; | 236 | 502 | results.reserve(implementations.size()); | 237 | | | 238 | 1.50k | for (auto impl : implementations) { | 239 | 1.50k | results.push_back( | 240 | 1.50k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.50k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.50k | const bool validation2 = | 245 | 1.50k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.50k | src.data(), src.size()); | 247 | 1.50k | 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.50k | } | 258 | | | 259 | 502 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 502 | 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 | 502 | } else { | 273 | 502 | ret.implementations_agree = true; | 274 | 502 | } | 275 | 502 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 502 | return r.error == simdutf::SUCCESS; | 277 | 502 | }); | 278 | 502 | return ret; | 279 | 502 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 641 | validation_result verify_valid_input(FromSpan src) const { | 231 | 641 | validation_result ret{}; | 232 | | | 233 | 641 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 641 | const auto implementations = get_supported_implementations(); | 235 | 641 | std::vector<simdutf::result> results; | 236 | 641 | results.reserve(implementations.size()); | 237 | | | 238 | 1.92k | for (auto impl : implementations) { | 239 | 1.92k | results.push_back( | 240 | 1.92k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.92k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.92k | const bool validation2 = | 245 | 1.92k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.92k | src.data(), src.size()); | 247 | 1.92k | 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.92k | } | 258 | | | 259 | 641 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 641 | 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 | 641 | } else { | 273 | 641 | ret.implementations_agree = true; | 274 | 641 | } | 275 | 641 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 641 | return r.error == simdutf::SUCCESS; | 277 | 641 | }); | 278 | 641 | return ret; | 279 | 641 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 657 | validation_result verify_valid_input(FromSpan src) const { | 231 | 657 | validation_result ret{}; | 232 | | | 233 | 657 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 657 | const auto implementations = get_supported_implementations(); | 235 | 657 | std::vector<simdutf::result> results; | 236 | 657 | results.reserve(implementations.size()); | 237 | | | 238 | 1.97k | for (auto impl : implementations) { | 239 | 1.97k | results.push_back( | 240 | 1.97k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.97k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.97k | const bool validation2 = | 245 | 1.97k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.97k | src.data(), src.size()); | 247 | 1.97k | 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.97k | } | 258 | | | 259 | 657 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 657 | 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 | 657 | } else { | 273 | 657 | ret.implementations_agree = true; | 274 | 657 | } | 275 | 657 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 657 | return r.error == simdutf::SUCCESS; | 277 | 657 | }); | 278 | 657 | return ret; | 279 | 657 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 677 | validation_result verify_valid_input(FromSpan src) const { | 231 | 677 | validation_result ret{}; | 232 | | | 233 | 677 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 677 | const auto implementations = get_supported_implementations(); | 235 | 677 | std::vector<simdutf::result> results; | 236 | 677 | results.reserve(implementations.size()); | 237 | | | 238 | 2.03k | for (auto impl : implementations) { | 239 | 2.03k | results.push_back( | 240 | 2.03k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 2.03k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 2.03k | const bool validation2 = | 245 | 2.03k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 2.03k | src.data(), src.size()); | 247 | 2.03k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 2.03k | } | 258 | | | 259 | 677 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 677 | 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 | 677 | } else { | 273 | 677 | ret.implementations_agree = true; | 274 | 677 | } | 275 | 677 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 677 | return r.error == simdutf::SUCCESS; | 277 | 677 | }); | 278 | 677 | return ret; | 279 | 677 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 56 | validation_result verify_valid_input(FromSpan src) const { | 231 | 56 | validation_result ret{}; | 232 | | | 233 | 56 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 56 | const auto implementations = get_supported_implementations(); | 235 | 56 | std::vector<simdutf::result> results; | 236 | 56 | results.reserve(implementations.size()); | 237 | | | 238 | 168 | for (auto impl : implementations) { | 239 | 168 | results.push_back( | 240 | 168 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 168 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 168 | const bool validation2 = | 245 | 168 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 168 | src.data(), src.size()); | 247 | 168 | 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 | 168 | } | 258 | | | 259 | 56 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 56 | 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 | 56 | } else { | 273 | 56 | ret.implementations_agree = true; | 274 | 56 | } | 275 | 56 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 56 | return r.error == simdutf::SUCCESS; | 277 | 56 | }); | 278 | 56 | return ret; | 279 | 56 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 74 | validation_result verify_valid_input(FromSpan src) const { | 231 | 74 | validation_result ret{}; | 232 | | | 233 | 74 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 74 | const auto implementations = get_supported_implementations(); | 235 | 74 | std::vector<simdutf::result> results; | 236 | 74 | results.reserve(implementations.size()); | 237 | | | 238 | 222 | for (auto impl : implementations) { | 239 | 222 | results.push_back( | 240 | 222 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 222 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 222 | const bool validation2 = | 245 | 222 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 222 | src.data(), src.size()); | 247 | 222 | 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 | 222 | } | 258 | | | 259 | 74 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 74 | 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 | 74 | } else { | 273 | 74 | ret.implementations_agree = true; | 274 | 74 | } | 275 | 74 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 74 | return r.error == simdutf::SUCCESS; | 277 | 74 | }); | 278 | 74 | return ret; | 279 | 74 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 230 | 98 | validation_result verify_valid_input(FromSpan src) const { | 231 | 98 | validation_result ret{}; | 232 | | | 233 | 98 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 98 | const auto implementations = get_supported_implementations(); | 235 | 98 | std::vector<simdutf::result> results; | 236 | 98 | results.reserve(implementations.size()); | 237 | | | 238 | 294 | for (auto impl : implementations) { | 239 | 294 | results.push_back( | 240 | 294 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 294 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 294 | const bool validation2 = | 245 | 294 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 294 | src.data(), src.size()); | 247 | 294 | 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 | 294 | } | 258 | | | 259 | 98 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 98 | 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 | 98 | } else { | 273 | 98 | ret.implementations_agree = true; | 274 | 98 | } | 275 | 98 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 98 | return r.error == simdutf::SUCCESS; | 277 | 98 | }); | 278 | 98 | return ret; | 279 | 98 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 286 | validation_result verify_valid_input(FromSpan src) const { | 231 | 286 | validation_result ret{}; | 232 | | | 233 | 286 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 286 | const auto implementations = get_supported_implementations(); | 235 | 286 | std::vector<simdutf::result> results; | 236 | 286 | results.reserve(implementations.size()); | 237 | | | 238 | 858 | for (auto impl : implementations) { | 239 | 858 | results.push_back( | 240 | 858 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 858 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 858 | const bool validation2 = | 245 | 858 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 858 | src.data(), src.size()); | 247 | 858 | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 858 | } | 258 | | | 259 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 286 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 261 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 262 | 0 | std::cerr << "in fuzz case for " | 263 | 0 | << ValidationFunctionTrait<From>::ValidationWithErrorsName | 264 | 0 | << " invoked with " << src.size() << " elements:\n"; | 265 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 266 | 0 | std::cerr << "got return " << std::dec << results[i] | 267 | 0 | << " from implementation " << implementations[i]->name() | 268 | 0 | << '\n'; | 269 | 0 | } | 270 | 0 | std::cerr << "end errormessage\n"; | 271 | 0 | ret.implementations_agree = false; | 272 | 286 | } else { | 273 | 286 | ret.implementations_agree = true; | 274 | 286 | } | 275 | 286 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 286 | return r.error == simdutf::SUCCESS; | 277 | 286 | }); | 278 | 286 | return ret; | 279 | 286 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 130 | validation_result verify_valid_input(FromSpan src) const { | 231 | 130 | validation_result ret{}; | 232 | | | 233 | 130 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 130 | const auto implementations = get_supported_implementations(); | 235 | 130 | std::vector<simdutf::result> results; | 236 | 130 | results.reserve(implementations.size()); | 237 | | | 238 | 390 | for (auto impl : implementations) { | 239 | 390 | results.push_back( | 240 | 390 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 390 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 390 | const bool validation2 = | 245 | 390 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 390 | src.data(), src.size()); | 247 | 390 | 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 | 390 | } | 258 | | | 259 | 130 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 130 | 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 | 130 | } else { | 273 | 130 | ret.implementations_agree = true; | 274 | 130 | } | 275 | 130 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 130 | return r.error == simdutf::SUCCESS; | 277 | 130 | }); | 278 | 130 | return ret; | 279 | 130 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 175 | validation_result verify_valid_input(FromSpan src) const { | 231 | 175 | validation_result ret{}; | 232 | | | 233 | 175 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 175 | const auto implementations = get_supported_implementations(); | 235 | 175 | std::vector<simdutf::result> results; | 236 | 175 | results.reserve(implementations.size()); | 237 | | | 238 | 525 | for (auto impl : implementations) { | 239 | 525 | results.push_back( | 240 | 525 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 525 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 525 | const bool validation2 = | 245 | 525 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 525 | src.data(), src.size()); | 247 | 525 | 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 | 525 | } | 258 | | | 259 | 175 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 175 | 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 | 175 | } else { | 273 | 175 | ret.implementations_agree = true; | 274 | 175 | } | 275 | 175 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 175 | return r.error == simdutf::SUCCESS; | 277 | 175 | }); | 278 | 175 | return ret; | 279 | 175 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 316 | validation_result verify_valid_input(FromSpan src) const { | 231 | 316 | validation_result ret{}; | 232 | | | 233 | 316 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 316 | const auto implementations = get_supported_implementations(); | 235 | 316 | std::vector<simdutf::result> results; | 236 | 316 | results.reserve(implementations.size()); | 237 | | | 238 | 948 | for (auto impl : implementations) { | 239 | 948 | results.push_back( | 240 | 948 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 948 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 948 | const bool validation2 = | 245 | 948 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 948 | src.data(), src.size()); | 247 | 948 | 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 | 948 | } | 258 | | | 259 | 316 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 316 | 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 | 316 | } else { | 273 | 316 | ret.implementations_agree = true; | 274 | 316 | } | 275 | 316 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 316 | return r.error == simdutf::SUCCESS; | 277 | 316 | }); | 278 | 316 | return ret; | 279 | 316 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 126 | validation_result verify_valid_input(FromSpan src) const { | 231 | 126 | validation_result ret{}; | 232 | | | 233 | 126 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 126 | const auto implementations = get_supported_implementations(); | 235 | 126 | std::vector<simdutf::result> results; | 236 | 126 | results.reserve(implementations.size()); | 237 | | | 238 | 378 | for (auto impl : implementations) { | 239 | 378 | results.push_back( | 240 | 378 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 378 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 378 | const bool validation2 = | 245 | 378 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 378 | src.data(), src.size()); | 247 | 378 | 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 | 378 | } | 258 | | | 259 | 126 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 126 | 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 | 126 | } else { | 273 | 126 | ret.implementations_agree = true; | 274 | 126 | } | 275 | 126 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 126 | return r.error == simdutf::SUCCESS; | 277 | 126 | }); | 278 | 126 | return ret; | 279 | 126 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 162 | validation_result verify_valid_input(FromSpan src) const { | 231 | 162 | validation_result ret{}; | 232 | | | 233 | 162 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 162 | const auto implementations = get_supported_implementations(); | 235 | 162 | std::vector<simdutf::result> results; | 236 | 162 | results.reserve(implementations.size()); | 237 | | | 238 | 486 | for (auto impl : implementations) { | 239 | 486 | results.push_back( | 240 | 486 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 486 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 486 | const bool validation2 = | 245 | 486 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 486 | src.data(), src.size()); | 247 | 486 | 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 | 486 | } | 258 | | | 259 | 162 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 162 | 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 | 162 | } else { | 273 | 162 | ret.implementations_agree = true; | 274 | 162 | } | 275 | 162 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 162 | return r.error == simdutf::SUCCESS; | 277 | 162 | }); | 278 | 162 | return ret; | 279 | 162 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 352 | validation_result verify_valid_input(FromSpan src) const { | 231 | 352 | validation_result ret{}; | 232 | | | 233 | 352 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 352 | const auto implementations = get_supported_implementations(); | 235 | 352 | std::vector<simdutf::result> results; | 236 | 352 | results.reserve(implementations.size()); | 237 | | | 238 | 1.05k | for (auto impl : implementations) { | 239 | 1.05k | results.push_back( | 240 | 1.05k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.05k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.05k | const bool validation2 = | 245 | 1.05k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.05k | src.data(), src.size()); | 247 | 1.05k | if (validation1 != validation2) { | 248 | 0 | std::cerr << "begin errormessage for verify_valid_input()\n"; | 249 | 0 | std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName | 250 | 0 | << " gives " << validation1 << " while " | 251 | 0 | << ValidationFunctionTrait<From>::ValidationName << " gave " | 252 | 0 | << validation2 << " for implementation " << impl->name() | 253 | 0 | << '\n'; | 254 | 0 | std::cerr << "end errormessage\n"; | 255 | 0 | std::abort(); | 256 | 0 | } | 257 | 1.05k | } | 258 | | | 259 | 352 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 352 | 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 | 352 | } else { | 273 | 352 | ret.implementations_agree = true; | 274 | 352 | } | 275 | 352 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 352 | return r.error == simdutf::SUCCESS; | 277 | 352 | }); | 278 | 352 | return ret; | 279 | 352 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 230 | 205 | validation_result verify_valid_input(FromSpan src) const { | 231 | 205 | validation_result ret{}; | 232 | | | 233 | 205 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 205 | const auto implementations = get_supported_implementations(); | 235 | 205 | std::vector<simdutf::result> results; | 236 | 205 | results.reserve(implementations.size()); | 237 | | | 238 | 615 | for (auto impl : implementations) { | 239 | 615 | results.push_back( | 240 | 615 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 615 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 615 | const bool validation2 = | 245 | 615 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 615 | src.data(), src.size()); | 247 | 615 | 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 | 615 | } | 258 | | | 259 | 205 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 205 | 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 | 205 | } else { | 273 | 205 | ret.implementations_agree = true; | 274 | 205 | } | 275 | 205 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 205 | return r.error == simdutf::SUCCESS; | 277 | 205 | }); | 278 | 205 | return ret; | 279 | 205 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 318 | validation_result verify_valid_input(FromSpan src) const { | 231 | 318 | validation_result ret{}; | 232 | | | 233 | 318 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 318 | const auto implementations = get_supported_implementations(); | 235 | 318 | std::vector<simdutf::result> results; | 236 | 318 | results.reserve(implementations.size()); | 237 | | | 238 | 954 | for (auto impl : implementations) { | 239 | 954 | results.push_back( | 240 | 954 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 954 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 954 | const bool validation2 = | 245 | 954 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 954 | src.data(), src.size()); | 247 | 954 | 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 | 954 | } | 258 | | | 259 | 318 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 318 | 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 | 318 | } else { | 273 | 318 | ret.implementations_agree = true; | 274 | 318 | } | 275 | 318 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 318 | return r.error == simdutf::SUCCESS; | 277 | 318 | }); | 278 | 318 | return ret; | 279 | 318 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_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 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 432 | validation_result verify_valid_input(FromSpan src) const { | 231 | 432 | validation_result ret{}; | 232 | | | 233 | 432 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 432 | const auto implementations = get_supported_implementations(); | 235 | 432 | std::vector<simdutf::result> results; | 236 | 432 | 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 | 432 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 432 | 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 | 432 | } else { | 273 | 432 | ret.implementations_agree = true; | 274 | 432 | } | 275 | 432 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 432 | return r.error == simdutf::SUCCESS; | 277 | 432 | }); | 278 | 432 | return ret; | 279 | 432 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 326 | validation_result verify_valid_input(FromSpan src) const { | 231 | 326 | validation_result ret{}; | 232 | | | 233 | 326 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 326 | const auto implementations = get_supported_implementations(); | 235 | 326 | std::vector<simdutf::result> results; | 236 | 326 | results.reserve(implementations.size()); | 237 | | | 238 | 978 | for (auto impl : implementations) { | 239 | 978 | results.push_back( | 240 | 978 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 978 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 978 | const bool validation2 = | 245 | 978 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 978 | src.data(), src.size()); | 247 | 978 | 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 | 978 | } | 258 | | | 259 | 326 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 326 | 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 | 326 | } else { | 273 | 326 | ret.implementations_agree = true; | 274 | 326 | } | 275 | 326 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 326 | return r.error == simdutf::SUCCESS; | 277 | 326 | }); | 278 | 326 | return ret; | 279 | 326 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 413 | validation_result verify_valid_input(FromSpan src) const { | 231 | 413 | validation_result ret{}; | 232 | | | 233 | 413 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 413 | const auto implementations = get_supported_implementations(); | 235 | 413 | std::vector<simdutf::result> results; | 236 | 413 | results.reserve(implementations.size()); | 237 | | | 238 | 1.23k | for (auto impl : implementations) { | 239 | 1.23k | results.push_back( | 240 | 1.23k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.23k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.23k | const bool validation2 = | 245 | 1.23k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.23k | src.data(), src.size()); | 247 | 1.23k | 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.23k | } | 258 | | | 259 | 413 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 413 | 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 | 413 | } else { | 273 | 413 | ret.implementations_agree = true; | 274 | 413 | } | 275 | 413 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 413 | return r.error == simdutf::SUCCESS; | 277 | 413 | }); | 278 | 413 | return ret; | 279 | 413 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 295 | validation_result verify_valid_input(FromSpan src) const { | 231 | 295 | validation_result ret{}; | 232 | | | 233 | 295 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 295 | const auto implementations = get_supported_implementations(); | 235 | 295 | std::vector<simdutf::result> results; | 236 | 295 | results.reserve(implementations.size()); | 237 | | | 238 | 885 | for (auto impl : implementations) { | 239 | 885 | results.push_back( | 240 | 885 | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 885 | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 885 | const bool validation2 = | 245 | 885 | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 885 | src.data(), src.size()); | 247 | 885 | 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 | 885 | } | 258 | | | 259 | 295 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 295 | 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 | 295 | } else { | 273 | 295 | ret.implementations_agree = true; | 274 | 295 | } | 275 | 295 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 295 | return r.error == simdutf::SUCCESS; | 277 | 295 | }); | 278 | 295 | return ret; | 279 | 295 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 230 | 404 | validation_result verify_valid_input(FromSpan src) const { | 231 | 404 | validation_result ret{}; | 232 | | | 233 | 404 | auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors; | 234 | 404 | const auto implementations = get_supported_implementations(); | 235 | 404 | std::vector<simdutf::result> results; | 236 | 404 | results.reserve(implementations.size()); | 237 | | | 238 | 1.21k | for (auto impl : implementations) { | 239 | 1.21k | results.push_back( | 240 | 1.21k | std::invoke(input_validation, impl, src.data(), src.size())); | 241 | | | 242 | | // make sure the validation variant that returns a bool agrees | 243 | 1.21k | const bool validation1 = results.back().error == simdutf::SUCCESS; | 244 | 1.21k | const bool validation2 = | 245 | 1.21k | std::invoke(ValidationFunctionTrait<From>::Validation, impl, | 246 | 1.21k | src.data(), src.size()); | 247 | 1.21k | 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.21k | } | 258 | | | 259 | 404 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 260 | 404 | 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 | 404 | } else { | 273 | 404 | ret.implementations_agree = true; | 274 | 404 | } | 275 | 404 | ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) { | 276 | 404 | return r.error == simdutf::SUCCESS; | 277 | 404 | }); | 278 | 404 | return ret; | 279 | 404 | } |
|
280 | | |
281 | | template <typename Dummy = void> |
282 | | requires(From == UtfEncodings::LATIN1) |
283 | 410 | validation_result verify_valid_input(FromSpan) const { |
284 | | // all latin1 input is valid. there is no simdutf validation function for |
285 | | // it. |
286 | 410 | return validation_result{.valid = true, .implementations_agree = true}; |
287 | 410 | } _ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 53 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 53 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 53 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 45 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 45 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 45 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 283 | 42 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 42 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 42 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 283 | 270 | validation_result verify_valid_input(FromSpan) const { | 284 | | // all latin1 input is valid. there is no simdutf validation function for | 285 | | // it. | 286 | 270 | return validation_result{.valid = true, .implementations_agree = true}; | 287 | 270 | } |
|
288 | | |
289 | 6.36k | bool count_the_input(FromSpan src) const { |
290 | 6.36k | const auto implementations = get_supported_implementations(); |
291 | 6.36k | std::vector<std::size_t> results; |
292 | 6.36k | results.reserve(implementations.size()); |
293 | | |
294 | 19.0k | for (auto impl : implementations) { |
295 | 19.0k | std::size_t ret; |
296 | 19.0k | if constexpr (From == UtfEncodings::UTF16BE) { |
297 | 3.96k | ret = impl->count_utf16be(src.data(), src.size()); |
298 | 4.03k | } else if constexpr (From == UtfEncodings::UTF16LE) { |
299 | 4.03k | ret = impl->count_utf16le(src.data(), src.size()); |
300 | 11.0k | } else if constexpr (From == UtfEncodings::UTF8) { |
301 | 11.0k | ret = impl->count_utf8(src.data(), src.size()); |
302 | 11.0k | } |
303 | 19.0k | results.push_back(ret); |
304 | 19.0k | } |
305 | 12.7k | auto neq = [](const auto& a, const auto& b) { return a != b; };auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) constLine | Count | Source | 305 | 486 | 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 | 806 | 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 | 464 | 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 | 796 | 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.28k | 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.35k | 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 | 112 | 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 | 148 | 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 | 572 | 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 | 260 | 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 | 350 | 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 | 632 | 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 | 252 | 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 | 324 | 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 | 704 | 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 | 652 | 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 | 826 | 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 | 590 | 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 | 808 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
306 | 6.36k | 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.36k | return true; |
321 | 6.36k | } 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 | 243 | bool count_the_input(FromSpan src) const { | 290 | 243 | const auto implementations = get_supported_implementations(); | 291 | 243 | std::vector<std::size_t> results; | 292 | 243 | results.reserve(implementations.size()); | 293 | | | 294 | 729 | for (auto impl : implementations) { | 295 | 729 | std::size_t ret; | 296 | 729 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 729 | 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 | 729 | results.push_back(ret); | 304 | 729 | } | 305 | 243 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 243 | 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 | 243 | return true; | 321 | 243 | } |
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 | 403 | bool count_the_input(FromSpan src) const { | 290 | 403 | const auto implementations = get_supported_implementations(); | 291 | 403 | std::vector<std::size_t> results; | 292 | 403 | results.reserve(implementations.size()); | 293 | | | 294 | 1.20k | for (auto impl : implementations) { | 295 | 1.20k | std::size_t ret; | 296 | 1.20k | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 1.20k | 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.20k | results.push_back(ret); | 304 | 1.20k | } | 305 | 403 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 403 | 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 | 403 | return true; | 321 | 403 | } |
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 | 232 | bool count_the_input(FromSpan src) const { | 290 | 232 | const auto implementations = get_supported_implementations(); | 291 | 232 | std::vector<std::size_t> results; | 292 | 232 | results.reserve(implementations.size()); | 293 | | | 294 | 696 | for (auto impl : implementations) { | 295 | 696 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 696 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 696 | 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 | 696 | results.push_back(ret); | 304 | 696 | } | 305 | 232 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 232 | 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 | 232 | return true; | 321 | 232 | } |
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 | 398 | bool count_the_input(FromSpan src) const { | 290 | 398 | const auto implementations = get_supported_implementations(); | 291 | 398 | std::vector<std::size_t> results; | 292 | 398 | results.reserve(implementations.size()); | 293 | | | 294 | 1.19k | for (auto impl : implementations) { | 295 | 1.19k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.19k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.19k | 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.19k | results.push_back(ret); | 304 | 1.19k | } | 305 | 398 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 398 | 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 | 398 | return true; | 321 | 398 | } |
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 | 641 | bool count_the_input(FromSpan src) const { | 290 | 641 | const auto implementations = get_supported_implementations(); | 291 | 641 | std::vector<std::size_t> results; | 292 | 641 | results.reserve(implementations.size()); | 293 | | | 294 | 1.92k | for (auto impl : implementations) { | 295 | 1.92k | 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.92k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.92k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.92k | } | 303 | 1.92k | results.push_back(ret); | 304 | 1.92k | } | 305 | 641 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 641 | 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 | 641 | return true; | 321 | 641 | } |
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 | 657 | bool count_the_input(FromSpan src) const { | 290 | 657 | const auto implementations = get_supported_implementations(); | 291 | 657 | std::vector<std::size_t> results; | 292 | 657 | results.reserve(implementations.size()); | 293 | | | 294 | 1.97k | for (auto impl : implementations) { | 295 | 1.97k | 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.97k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.97k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.97k | } | 303 | 1.97k | results.push_back(ret); | 304 | 1.97k | } | 305 | 657 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 657 | 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 | 657 | return true; | 321 | 657 | } |
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 | 677 | bool count_the_input(FromSpan src) const { | 290 | 677 | const auto implementations = get_supported_implementations(); | 291 | 677 | std::vector<std::size_t> results; | 292 | 677 | results.reserve(implementations.size()); | 293 | | | 294 | 2.03k | for (auto impl : implementations) { | 295 | 2.03k | 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.03k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 2.03k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 2.03k | } | 303 | 2.03k | results.push_back(ret); | 304 | 2.03k | } | 305 | 677 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 677 | 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 | 677 | return true; | 321 | 677 | } |
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 | 56 | bool count_the_input(FromSpan src) const { | 290 | 56 | const auto implementations = get_supported_implementations(); | 291 | 56 | std::vector<std::size_t> results; | 292 | 56 | results.reserve(implementations.size()); | 293 | | | 294 | 168 | for (auto impl : implementations) { | 295 | 168 | std::size_t ret; | 296 | 168 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 168 | 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 | 168 | results.push_back(ret); | 304 | 168 | } | 305 | 56 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 56 | 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 | 56 | return true; | 321 | 56 | } |
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 | 74 | bool count_the_input(FromSpan src) const { | 290 | 74 | const auto implementations = get_supported_implementations(); | 291 | 74 | std::vector<std::size_t> results; | 292 | 74 | results.reserve(implementations.size()); | 293 | | | 294 | 222 | for (auto impl : implementations) { | 295 | 222 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 222 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 222 | 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 | 222 | results.push_back(ret); | 304 | 222 | } | 305 | 74 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 74 | 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 | 74 | return true; | 321 | 74 | } |
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 | 286 | bool count_the_input(FromSpan src) const { | 290 | 286 | const auto implementations = get_supported_implementations(); | 291 | 286 | std::vector<std::size_t> results; | 292 | 286 | results.reserve(implementations.size()); | 293 | | | 294 | 858 | for (auto impl : implementations) { | 295 | 858 | 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 | 858 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 858 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 858 | } | 303 | 858 | results.push_back(ret); | 304 | 858 | } | 305 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 286 | 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 | 286 | return true; | 321 | 286 | } |
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 | 130 | bool count_the_input(FromSpan src) const { | 290 | 130 | const auto implementations = get_supported_implementations(); | 291 | 130 | std::vector<std::size_t> results; | 292 | 130 | results.reserve(implementations.size()); | 293 | | | 294 | 390 | for (auto impl : implementations) { | 295 | 390 | std::size_t ret; | 296 | 390 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 390 | 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 | 390 | results.push_back(ret); | 304 | 390 | } | 305 | 130 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 130 | 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 | 130 | return true; | 321 | 130 | } |
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 | 175 | bool count_the_input(FromSpan src) const { | 290 | 175 | const auto implementations = get_supported_implementations(); | 291 | 175 | std::vector<std::size_t> results; | 292 | 175 | results.reserve(implementations.size()); | 293 | | | 294 | 525 | for (auto impl : implementations) { | 295 | 525 | std::size_t ret; | 296 | 525 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 525 | 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 | 525 | results.push_back(ret); | 304 | 525 | } | 305 | 175 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 175 | 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 | 175 | return true; | 321 | 175 | } |
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 | 316 | bool count_the_input(FromSpan src) const { | 290 | 316 | const auto implementations = get_supported_implementations(); | 291 | 316 | std::vector<std::size_t> results; | 292 | 316 | results.reserve(implementations.size()); | 293 | | | 294 | 948 | for (auto impl : implementations) { | 295 | 948 | std::size_t ret; | 296 | 948 | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | 948 | 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 | 948 | results.push_back(ret); | 304 | 948 | } | 305 | 316 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 316 | 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 | 316 | return true; | 321 | 316 | } |
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 | 126 | bool count_the_input(FromSpan src) const { | 290 | 126 | const auto implementations = get_supported_implementations(); | 291 | 126 | std::vector<std::size_t> results; | 292 | 126 | results.reserve(implementations.size()); | 293 | | | 294 | 378 | for (auto impl : implementations) { | 295 | 378 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 378 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 378 | 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 | 378 | results.push_back(ret); | 304 | 378 | } | 305 | 126 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 126 | 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 | 126 | return true; | 321 | 126 | } |
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 | 162 | bool count_the_input(FromSpan src) const { | 290 | 162 | const auto implementations = get_supported_implementations(); | 291 | 162 | std::vector<std::size_t> results; | 292 | 162 | results.reserve(implementations.size()); | 293 | | | 294 | 486 | for (auto impl : implementations) { | 295 | 486 | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 486 | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 486 | 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 | 486 | results.push_back(ret); | 304 | 486 | } | 305 | 162 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 162 | 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 | 162 | return true; | 321 | 162 | } |
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 | 352 | bool count_the_input(FromSpan src) const { | 290 | 352 | const auto implementations = get_supported_implementations(); | 291 | 352 | std::vector<std::size_t> results; | 292 | 352 | results.reserve(implementations.size()); | 293 | | | 294 | 1.05k | for (auto impl : implementations) { | 295 | 1.05k | std::size_t ret; | 296 | | if constexpr (From == UtfEncodings::UTF16BE) { | 297 | | ret = impl->count_utf16be(src.data(), src.size()); | 298 | 1.05k | } else if constexpr (From == UtfEncodings::UTF16LE) { | 299 | 1.05k | 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.05k | results.push_back(ret); | 304 | 1.05k | } | 305 | 352 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 352 | 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 | 352 | return true; | 321 | 352 | } |
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 | 326 | bool count_the_input(FromSpan src) const { | 290 | 326 | const auto implementations = get_supported_implementations(); | 291 | 326 | std::vector<std::size_t> results; | 292 | 326 | results.reserve(implementations.size()); | 293 | | | 294 | 978 | for (auto impl : implementations) { | 295 | 978 | 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 | 978 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 978 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 978 | } | 303 | 978 | results.push_back(ret); | 304 | 978 | } | 305 | 326 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 326 | 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 | 326 | return true; | 321 | 326 | } |
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 | 413 | bool count_the_input(FromSpan src) const { | 290 | 413 | const auto implementations = get_supported_implementations(); | 291 | 413 | std::vector<std::size_t> results; | 292 | 413 | results.reserve(implementations.size()); | 293 | | | 294 | 1.23k | for (auto impl : implementations) { | 295 | 1.23k | 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.23k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.23k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.23k | } | 303 | 1.23k | results.push_back(ret); | 304 | 1.23k | } | 305 | 413 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 413 | 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 | 413 | return true; | 321 | 413 | } |
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 | 295 | bool count_the_input(FromSpan src) const { | 290 | 295 | const auto implementations = get_supported_implementations(); | 291 | 295 | std::vector<std::size_t> results; | 292 | 295 | results.reserve(implementations.size()); | 293 | | | 294 | 885 | for (auto impl : implementations) { | 295 | 885 | 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 | 885 | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 885 | ret = impl->count_utf8(src.data(), src.size()); | 302 | 885 | } | 303 | 885 | results.push_back(ret); | 304 | 885 | } | 305 | 295 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 295 | 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 | 295 | return true; | 321 | 295 | } |
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 | 404 | bool count_the_input(FromSpan src) const { | 290 | 404 | const auto implementations = get_supported_implementations(); | 291 | 404 | std::vector<std::size_t> results; | 292 | 404 | results.reserve(implementations.size()); | 293 | | | 294 | 1.21k | for (auto impl : implementations) { | 295 | 1.21k | 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.21k | } else if constexpr (From == UtfEncodings::UTF8) { | 301 | 1.21k | ret = impl->count_utf8(src.data(), src.size()); | 302 | 1.21k | } | 303 | 1.21k | results.push_back(ret); | 304 | 1.21k | } | 305 | 404 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 306 | 404 | 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 | 404 | return true; | 321 | 404 | } |
|
322 | | |
323 | | // this quirk is needed because length calculations do not have consistent |
324 | | // signatures since some of them do not look at the input data, just the |
325 | | // length of it. |
326 | | template <typename Dummy = void> |
327 | | requires std::is_invocable_v<LengthFunction, const simdutf::implementation*, |
328 | | const FromType*, std::size_t> |
329 | | std::size_t invoke_lengthcalc(const simdutf::implementation* impl, |
330 | 25.5k | FromSpan src) const { |
331 | 25.5k | return std::invoke(lengthcalc, impl, src.data(), src.size()); |
332 | 25.5k | } _ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_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 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_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 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 696 | FromSpan src) const { | 331 | 696 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 696 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.19k | FromSpan src) const { | 331 | 1.19k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.19k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 873 | FromSpan src) const { | 331 | 873 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 873 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_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_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.50k | FromSpan src) const { | 331 | 1.50k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.50k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.92k | FromSpan src) const { | 331 | 1.92k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.92k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.97k | FromSpan src) const { | 331 | 1.97k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.97k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 2.03k | FromSpan src) const { | 331 | 2.03k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 2.03k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 858 | FromSpan src) const { | 331 | 858 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 858 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 525 | FromSpan src) const { | 331 | 525 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 525 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 948 | FromSpan src) const { | 331 | 948 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 948 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 486 | FromSpan src) const { | 331 | 486 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 486 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.05k | FromSpan src) const { | 331 | 1.05k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.05k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 954 | FromSpan src) const { | 331 | 954 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 954 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.00k | FromSpan src) const { | 331 | 1.00k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.00k | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.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 | 978 | FromSpan src) const { | 331 | 978 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 978 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.23k | FromSpan src) const { | 331 | 1.23k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.23k | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 885 | FromSpan src) const { | 331 | 885 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 885 | } |
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 1.21k | FromSpan src) const { | 331 | 1.21k | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 1.21k | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE Line | Count | Source | 330 | 810 | FromSpan src) const { | 331 | 810 | return std::invoke(lengthcalc, impl, src.data(), src.size()); | 332 | 810 | } |
|
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.48k | FromSpan src) const { |
339 | 2.48k | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); |
340 | 2.48k | } _ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 168 | FromSpan src) const { | 339 | 168 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 168 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 222 | FromSpan src) const { | 339 | 222 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 222 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 294 | FromSpan src) const { | 339 | 294 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 294 | } |
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 390 | FromSpan src) const { | 339 | 390 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 390 | } |
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 378 | FromSpan src) const { | 339 | 378 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 378 | } |
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE Line | Count | Source | 338 | 615 | FromSpan src) const { | 339 | 615 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 615 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 159 | FromSpan src) const { | 339 | 159 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 159 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 135 | FromSpan src) const { | 339 | 135 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 135 | } |
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE Line | Count | Source | 338 | 126 | FromSpan src) const { | 339 | 126 | return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size()); | 340 | 126 | } |
|
341 | | |
342 | 9.34k | length_result calculate_length(FromSpan src, const bool inputisvalid) const { |
343 | 9.34k | length_result ret{}; |
344 | | |
345 | 9.34k | const auto implementations = get_supported_implementations(); |
346 | 9.34k | std::vector<std::size_t> results; |
347 | 9.34k | results.reserve(implementations.size()); |
348 | | |
349 | 28.0k | for (auto impl : implementations) { |
350 | 28.0k | const auto len = invoke_lengthcalc(impl, src); |
351 | 28.0k | results.push_back(len); |
352 | 28.0k | ret.length.push_back(len); |
353 | 28.0k | } |
354 | | |
355 | 18.6k | auto neq = [](const auto& a, const auto& b) { return a != b; };auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) constLine | Count | Source | 355 | 486 | 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 | 806 | 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 | 464 | 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 | 796 | 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 | 582 | 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 | 768 | 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 | 1.00k | 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.28k | 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.35k | 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 | 112 | 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 | 148 | 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 | 196 | 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 | 572 | 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 | 260 | 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 | 350 | 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 | 632 | 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 | 252 | 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 | 324 | 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 | 704 | 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 | 410 | 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 | 636 | 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 | 670 | 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 | 864 | 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 | 652 | 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 | 826 | 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 | 590 | 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 | 808 | 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 | 106 | 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 | 90 | 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 | 84 | 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 | 540 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
356 | 9.34k | if (std::ranges::adjacent_find(results, neq) != results.end()) { |
357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; |
358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " |
359 | 0 | << src.size() << " elements with valid input=" << inputisvalid |
360 | 0 | << ":\n"; |
361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { |
362 | 0 | std::cerr << "got return " << std::dec << results[i] |
363 | 0 | << " from implementation " << implementations[i]->name() |
364 | 0 | << '\n'; |
365 | 0 | } |
366 | 0 | std::cerr << "end errormessage\n"; |
367 | 0 | if (inputisvalid) { |
368 | 0 | ret.implementations_agree = false; |
369 | 0 | } else { |
370 | 0 | std::cerr |
371 | 0 | << "impementations are allowed to disagree on invalid input\n"; |
372 | 0 | ret.implementations_agree = true; |
373 | 0 | } |
374 | 9.34k | } else { |
375 | 9.34k | ret.implementations_agree = true; |
376 | 9.34k | } |
377 | 9.34k | return ret; |
378 | 9.34k | } 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 | 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 | << "impementations 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 | } |
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 | 403 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 403 | length_result ret{}; | 344 | | | 345 | 403 | const auto implementations = get_supported_implementations(); | 346 | 403 | std::vector<std::size_t> results; | 347 | 403 | 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 | 403 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 403 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 403 | } else { | 375 | 403 | ret.implementations_agree = true; | 376 | 403 | } | 377 | 403 | return ret; | 378 | 403 | } |
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 | 232 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 232 | length_result ret{}; | 344 | | | 345 | 232 | const auto implementations = get_supported_implementations(); | 346 | 232 | std::vector<std::size_t> results; | 347 | 232 | results.reserve(implementations.size()); | 348 | | | 349 | 696 | for (auto impl : implementations) { | 350 | 696 | const auto len = invoke_lengthcalc(impl, src); | 351 | 696 | results.push_back(len); | 352 | 696 | ret.length.push_back(len); | 353 | 696 | } | 354 | | | 355 | 232 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 232 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 232 | } else { | 375 | 232 | ret.implementations_agree = true; | 376 | 232 | } | 377 | 232 | return ret; | 378 | 232 | } |
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 | 398 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 398 | length_result ret{}; | 344 | | | 345 | 398 | const auto implementations = get_supported_implementations(); | 346 | 398 | std::vector<std::size_t> results; | 347 | 398 | results.reserve(implementations.size()); | 348 | | | 349 | 1.19k | for (auto impl : implementations) { | 350 | 1.19k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.19k | results.push_back(len); | 352 | 1.19k | ret.length.push_back(len); | 353 | 1.19k | } | 354 | | | 355 | 398 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 398 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 398 | } else { | 375 | 398 | ret.implementations_agree = true; | 376 | 398 | } | 377 | 398 | return ret; | 378 | 398 | } |
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 | 291 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 291 | length_result ret{}; | 344 | | | 345 | 291 | const auto implementations = get_supported_implementations(); | 346 | 291 | std::vector<std::size_t> results; | 347 | 291 | results.reserve(implementations.size()); | 348 | | | 349 | 873 | for (auto impl : implementations) { | 350 | 873 | const auto len = invoke_lengthcalc(impl, src); | 351 | 873 | results.push_back(len); | 352 | 873 | ret.length.push_back(len); | 353 | 873 | } | 354 | | | 355 | 291 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 291 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 291 | } else { | 375 | 291 | ret.implementations_agree = true; | 376 | 291 | } | 377 | 291 | return ret; | 378 | 291 | } |
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 | 384 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 384 | length_result ret{}; | 344 | | | 345 | 384 | const auto implementations = get_supported_implementations(); | 346 | 384 | std::vector<std::size_t> results; | 347 | 384 | 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 | 384 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 384 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 384 | } else { | 375 | 384 | ret.implementations_agree = true; | 376 | 384 | } | 377 | 384 | return ret; | 378 | 384 | } |
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 | 502 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 502 | length_result ret{}; | 344 | | | 345 | 502 | const auto implementations = get_supported_implementations(); | 346 | 502 | std::vector<std::size_t> results; | 347 | 502 | results.reserve(implementations.size()); | 348 | | | 349 | 1.50k | for (auto impl : implementations) { | 350 | 1.50k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.50k | results.push_back(len); | 352 | 1.50k | ret.length.push_back(len); | 353 | 1.50k | } | 354 | | | 355 | 502 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 502 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 502 | } else { | 375 | 502 | ret.implementations_agree = true; | 376 | 502 | } | 377 | 502 | return ret; | 378 | 502 | } |
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 | 641 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 641 | length_result ret{}; | 344 | | | 345 | 641 | const auto implementations = get_supported_implementations(); | 346 | 641 | std::vector<std::size_t> results; | 347 | 641 | results.reserve(implementations.size()); | 348 | | | 349 | 1.92k | for (auto impl : implementations) { | 350 | 1.92k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.92k | results.push_back(len); | 352 | 1.92k | ret.length.push_back(len); | 353 | 1.92k | } | 354 | | | 355 | 641 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 641 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 641 | } else { | 375 | 641 | ret.implementations_agree = true; | 376 | 641 | } | 377 | 641 | return ret; | 378 | 641 | } |
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 | 657 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 657 | length_result ret{}; | 344 | | | 345 | 657 | const auto implementations = get_supported_implementations(); | 346 | 657 | std::vector<std::size_t> results; | 347 | 657 | results.reserve(implementations.size()); | 348 | | | 349 | 1.97k | for (auto impl : implementations) { | 350 | 1.97k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.97k | results.push_back(len); | 352 | 1.97k | ret.length.push_back(len); | 353 | 1.97k | } | 354 | | | 355 | 657 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 657 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 657 | } else { | 375 | 657 | ret.implementations_agree = true; | 376 | 657 | } | 377 | 657 | return ret; | 378 | 657 | } |
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 | 677 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 677 | length_result ret{}; | 344 | | | 345 | 677 | const auto implementations = get_supported_implementations(); | 346 | 677 | std::vector<std::size_t> results; | 347 | 677 | results.reserve(implementations.size()); | 348 | | | 349 | 2.03k | for (auto impl : implementations) { | 350 | 2.03k | const auto len = invoke_lengthcalc(impl, src); | 351 | 2.03k | results.push_back(len); | 352 | 2.03k | ret.length.push_back(len); | 353 | 2.03k | } | 354 | | | 355 | 677 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 677 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 677 | } else { | 375 | 677 | ret.implementations_agree = true; | 376 | 677 | } | 377 | 677 | return ret; | 378 | 677 | } |
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 | 56 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 56 | length_result ret{}; | 344 | | | 345 | 56 | const auto implementations = get_supported_implementations(); | 346 | 56 | std::vector<std::size_t> results; | 347 | 56 | results.reserve(implementations.size()); | 348 | | | 349 | 168 | for (auto impl : implementations) { | 350 | 168 | const auto len = invoke_lengthcalc(impl, src); | 351 | 168 | results.push_back(len); | 352 | 168 | ret.length.push_back(len); | 353 | 168 | } | 354 | | | 355 | 56 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 56 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 56 | } else { | 375 | 56 | ret.implementations_agree = true; | 376 | 56 | } | 377 | 56 | return ret; | 378 | 56 | } |
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 | 74 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 74 | length_result ret{}; | 344 | | | 345 | 74 | const auto implementations = get_supported_implementations(); | 346 | 74 | std::vector<std::size_t> results; | 347 | 74 | results.reserve(implementations.size()); | 348 | | | 349 | 222 | for (auto impl : implementations) { | 350 | 222 | const auto len = invoke_lengthcalc(impl, src); | 351 | 222 | results.push_back(len); | 352 | 222 | ret.length.push_back(len); | 353 | 222 | } | 354 | | | 355 | 74 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 74 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 74 | } else { | 375 | 74 | ret.implementations_agree = true; | 376 | 74 | } | 377 | 74 | return ret; | 378 | 74 | } |
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 | 98 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 98 | length_result ret{}; | 344 | | | 345 | 98 | const auto implementations = get_supported_implementations(); | 346 | 98 | std::vector<std::size_t> results; | 347 | 98 | results.reserve(implementations.size()); | 348 | | | 349 | 294 | for (auto impl : implementations) { | 350 | 294 | const auto len = invoke_lengthcalc(impl, src); | 351 | 294 | results.push_back(len); | 352 | 294 | ret.length.push_back(len); | 353 | 294 | } | 354 | | | 355 | 98 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 98 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 98 | } else { | 375 | 98 | ret.implementations_agree = true; | 376 | 98 | } | 377 | 98 | return ret; | 378 | 98 | } |
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 | 286 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 286 | length_result ret{}; | 344 | | | 345 | 286 | const auto implementations = get_supported_implementations(); | 346 | 286 | std::vector<std::size_t> results; | 347 | 286 | results.reserve(implementations.size()); | 348 | | | 349 | 858 | for (auto impl : implementations) { | 350 | 858 | const auto len = invoke_lengthcalc(impl, src); | 351 | 858 | results.push_back(len); | 352 | 858 | ret.length.push_back(len); | 353 | 858 | } | 354 | | | 355 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 286 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 286 | } else { | 375 | 286 | ret.implementations_agree = true; | 376 | 286 | } | 377 | 286 | return ret; | 378 | 286 | } |
Conversion<(UtfEncodings)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 | 130 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 130 | length_result ret{}; | 344 | | | 345 | 130 | const auto implementations = get_supported_implementations(); | 346 | 130 | std::vector<std::size_t> results; | 347 | 130 | results.reserve(implementations.size()); | 348 | | | 349 | 390 | for (auto impl : implementations) { | 350 | 390 | const auto len = invoke_lengthcalc(impl, src); | 351 | 390 | results.push_back(len); | 352 | 390 | ret.length.push_back(len); | 353 | 390 | } | 354 | | | 355 | 130 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 130 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 130 | } else { | 375 | 130 | ret.implementations_agree = true; | 376 | 130 | } | 377 | 130 | return ret; | 378 | 130 | } |
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 | 175 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 175 | length_result ret{}; | 344 | | | 345 | 175 | const auto implementations = get_supported_implementations(); | 346 | 175 | std::vector<std::size_t> results; | 347 | 175 | results.reserve(implementations.size()); | 348 | | | 349 | 525 | for (auto impl : implementations) { | 350 | 525 | const auto len = invoke_lengthcalc(impl, src); | 351 | 525 | results.push_back(len); | 352 | 525 | ret.length.push_back(len); | 353 | 525 | } | 354 | | | 355 | 175 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 175 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 175 | } else { | 375 | 175 | ret.implementations_agree = true; | 376 | 175 | } | 377 | 175 | return ret; | 378 | 175 | } |
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 | 316 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 316 | length_result ret{}; | 344 | | | 345 | 316 | const auto implementations = get_supported_implementations(); | 346 | 316 | std::vector<std::size_t> results; | 347 | 316 | results.reserve(implementations.size()); | 348 | | | 349 | 948 | for (auto impl : implementations) { | 350 | 948 | const auto len = invoke_lengthcalc(impl, src); | 351 | 948 | results.push_back(len); | 352 | 948 | ret.length.push_back(len); | 353 | 948 | } | 354 | | | 355 | 316 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 316 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 316 | } else { | 375 | 316 | ret.implementations_agree = true; | 376 | 316 | } | 377 | 316 | return ret; | 378 | 316 | } |
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 | 126 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 126 | length_result ret{}; | 344 | | | 345 | 126 | const auto implementations = get_supported_implementations(); | 346 | 126 | std::vector<std::size_t> results; | 347 | 126 | results.reserve(implementations.size()); | 348 | | | 349 | 378 | for (auto impl : implementations) { | 350 | 378 | const auto len = invoke_lengthcalc(impl, src); | 351 | 378 | results.push_back(len); | 352 | 378 | ret.length.push_back(len); | 353 | 378 | } | 354 | | | 355 | 126 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 126 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 126 | } else { | 375 | 126 | ret.implementations_agree = true; | 376 | 126 | } | 377 | 126 | return ret; | 378 | 126 | } |
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 | 162 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 162 | length_result ret{}; | 344 | | | 345 | 162 | const auto implementations = get_supported_implementations(); | 346 | 162 | std::vector<std::size_t> results; | 347 | 162 | results.reserve(implementations.size()); | 348 | | | 349 | 486 | for (auto impl : implementations) { | 350 | 486 | const auto len = invoke_lengthcalc(impl, src); | 351 | 486 | results.push_back(len); | 352 | 486 | ret.length.push_back(len); | 353 | 486 | } | 354 | | | 355 | 162 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 162 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 162 | } else { | 375 | 162 | ret.implementations_agree = true; | 376 | 162 | } | 377 | 162 | return ret; | 378 | 162 | } |
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 | 352 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 352 | length_result ret{}; | 344 | | | 345 | 352 | const auto implementations = get_supported_implementations(); | 346 | 352 | std::vector<std::size_t> results; | 347 | 352 | results.reserve(implementations.size()); | 348 | | | 349 | 1.05k | for (auto impl : implementations) { | 350 | 1.05k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.05k | results.push_back(len); | 352 | 1.05k | ret.length.push_back(len); | 353 | 1.05k | } | 354 | | | 355 | 352 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 352 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 352 | } else { | 375 | 352 | ret.implementations_agree = true; | 376 | 352 | } | 377 | 352 | return ret; | 378 | 352 | } |
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 | 205 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 205 | length_result ret{}; | 344 | | | 345 | 205 | const auto implementations = get_supported_implementations(); | 346 | 205 | std::vector<std::size_t> results; | 347 | 205 | results.reserve(implementations.size()); | 348 | | | 349 | 615 | for (auto impl : implementations) { | 350 | 615 | const auto len = invoke_lengthcalc(impl, src); | 351 | 615 | results.push_back(len); | 352 | 615 | ret.length.push_back(len); | 353 | 615 | } | 354 | | | 355 | 205 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 205 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 205 | } else { | 375 | 205 | ret.implementations_agree = true; | 376 | 205 | } | 377 | 205 | return ret; | 378 | 205 | } |
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 | 318 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 318 | length_result ret{}; | 344 | | | 345 | 318 | const auto implementations = get_supported_implementations(); | 346 | 318 | std::vector<std::size_t> results; | 347 | 318 | results.reserve(implementations.size()); | 348 | | | 349 | 954 | for (auto impl : implementations) { | 350 | 954 | const auto len = invoke_lengthcalc(impl, src); | 351 | 954 | results.push_back(len); | 352 | 954 | ret.length.push_back(len); | 353 | 954 | } | 354 | | | 355 | 318 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 318 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 318 | } else { | 375 | 318 | ret.implementations_agree = true; | 376 | 318 | } | 377 | 318 | return ret; | 378 | 318 | } |
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 | 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 | << "impementations 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)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 | 432 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 432 | length_result ret{}; | 344 | | | 345 | 432 | const auto implementations = get_supported_implementations(); | 346 | 432 | std::vector<std::size_t> results; | 347 | 432 | 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 | 432 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 432 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 432 | } else { | 375 | 432 | ret.implementations_agree = true; | 376 | 432 | } | 377 | 432 | return ret; | 378 | 432 | } |
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 | 326 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 326 | length_result ret{}; | 344 | | | 345 | 326 | const auto implementations = get_supported_implementations(); | 346 | 326 | std::vector<std::size_t> results; | 347 | 326 | results.reserve(implementations.size()); | 348 | | | 349 | 978 | for (auto impl : implementations) { | 350 | 978 | const auto len = invoke_lengthcalc(impl, src); | 351 | 978 | results.push_back(len); | 352 | 978 | ret.length.push_back(len); | 353 | 978 | } | 354 | | | 355 | 326 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 326 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 326 | } else { | 375 | 326 | ret.implementations_agree = true; | 376 | 326 | } | 377 | 326 | return ret; | 378 | 326 | } |
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 | 413 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 413 | length_result ret{}; | 344 | | | 345 | 413 | const auto implementations = get_supported_implementations(); | 346 | 413 | std::vector<std::size_t> results; | 347 | 413 | results.reserve(implementations.size()); | 348 | | | 349 | 1.23k | for (auto impl : implementations) { | 350 | 1.23k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.23k | results.push_back(len); | 352 | 1.23k | ret.length.push_back(len); | 353 | 1.23k | } | 354 | | | 355 | 413 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 413 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 413 | } else { | 375 | 413 | ret.implementations_agree = true; | 376 | 413 | } | 377 | 413 | return ret; | 378 | 413 | } |
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 | 295 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 295 | length_result ret{}; | 344 | | | 345 | 295 | const auto implementations = get_supported_implementations(); | 346 | 295 | std::vector<std::size_t> results; | 347 | 295 | results.reserve(implementations.size()); | 348 | | | 349 | 885 | for (auto impl : implementations) { | 350 | 885 | const auto len = invoke_lengthcalc(impl, src); | 351 | 885 | results.push_back(len); | 352 | 885 | ret.length.push_back(len); | 353 | 885 | } | 354 | | | 355 | 295 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 295 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 295 | } else { | 375 | 295 | ret.implementations_agree = true; | 376 | 295 | } | 377 | 295 | return ret; | 378 | 295 | } |
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 | 404 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 404 | length_result ret{}; | 344 | | | 345 | 404 | const auto implementations = get_supported_implementations(); | 346 | 404 | std::vector<std::size_t> results; | 347 | 404 | results.reserve(implementations.size()); | 348 | | | 349 | 1.21k | for (auto impl : implementations) { | 350 | 1.21k | const auto len = invoke_lengthcalc(impl, src); | 351 | 1.21k | results.push_back(len); | 352 | 1.21k | ret.length.push_back(len); | 353 | 1.21k | } | 354 | | | 355 | 404 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 404 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 404 | } else { | 375 | 404 | ret.implementations_agree = true; | 376 | 404 | } | 377 | 404 | return ret; | 378 | 404 | } |
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 | 53 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 53 | length_result ret{}; | 344 | | | 345 | 53 | const auto implementations = get_supported_implementations(); | 346 | 53 | std::vector<std::size_t> results; | 347 | 53 | results.reserve(implementations.size()); | 348 | | | 349 | 159 | for (auto impl : implementations) { | 350 | 159 | const auto len = invoke_lengthcalc(impl, src); | 351 | 159 | results.push_back(len); | 352 | 159 | ret.length.push_back(len); | 353 | 159 | } | 354 | | | 355 | 53 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 53 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 53 | } else { | 375 | 53 | ret.implementations_agree = true; | 376 | 53 | } | 377 | 53 | return ret; | 378 | 53 | } |
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 | 45 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 45 | length_result ret{}; | 344 | | | 345 | 45 | const auto implementations = get_supported_implementations(); | 346 | 45 | std::vector<std::size_t> results; | 347 | 45 | results.reserve(implementations.size()); | 348 | | | 349 | 135 | for (auto impl : implementations) { | 350 | 135 | const auto len = invoke_lengthcalc(impl, src); | 351 | 135 | results.push_back(len); | 352 | 135 | ret.length.push_back(len); | 353 | 135 | } | 354 | | | 355 | 45 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 45 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 45 | } else { | 375 | 45 | ret.implementations_agree = true; | 376 | 45 | } | 377 | 45 | return ret; | 378 | 45 | } |
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 | 42 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 42 | length_result ret{}; | 344 | | | 345 | 42 | const auto implementations = get_supported_implementations(); | 346 | 42 | std::vector<std::size_t> results; | 347 | 42 | results.reserve(implementations.size()); | 348 | | | 349 | 126 | for (auto impl : implementations) { | 350 | 126 | const auto len = invoke_lengthcalc(impl, src); | 351 | 126 | results.push_back(len); | 352 | 126 | ret.length.push_back(len); | 353 | 126 | } | 354 | | | 355 | 42 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 42 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 42 | } else { | 375 | 42 | ret.implementations_agree = true; | 376 | 42 | } | 377 | 42 | return ret; | 378 | 42 | } |
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 | 270 | length_result calculate_length(FromSpan src, const bool inputisvalid) const { | 343 | 270 | length_result ret{}; | 344 | | | 345 | 270 | const auto implementations = get_supported_implementations(); | 346 | 270 | std::vector<std::size_t> results; | 347 | 270 | results.reserve(implementations.size()); | 348 | | | 349 | 810 | for (auto impl : implementations) { | 350 | 810 | const auto len = invoke_lengthcalc(impl, src); | 351 | 810 | results.push_back(len); | 352 | 810 | ret.length.push_back(len); | 353 | 810 | } | 354 | | | 355 | 270 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 356 | 270 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 357 | 0 | std::cerr << "begin errormessage for calculate_length\n"; | 358 | 0 | std::cerr << "in fuzz case invoking " << lengthcalcname << " with " | 359 | 0 | << src.size() << " elements with valid input=" << inputisvalid | 360 | 0 | << ":\n"; | 361 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 362 | 0 | std::cerr << "got return " << std::dec << results[i] | 363 | 0 | << " from implementation " << implementations[i]->name() | 364 | 0 | << '\n'; | 365 | 0 | } | 366 | 0 | std::cerr << "end errormessage\n"; | 367 | 0 | if (inputisvalid) { | 368 | 0 | ret.implementations_agree = false; | 369 | 0 | } else { | 370 | 0 | std::cerr | 371 | 0 | << "impementations are allowed to disagree on invalid input\n"; | 372 | 0 | ret.implementations_agree = true; | 373 | 0 | } | 374 | 270 | } else { | 375 | 270 | ret.implementations_agree = true; | 376 | 270 | } | 377 | 270 | return ret; | 378 | 270 | } |
|
379 | | |
380 | | conversion_result do_conversion(FromSpan src, |
381 | | const std::vector<std::size_t>& outlength, |
382 | 9.25k | const bool inputisvalid) const { |
383 | 9.25k | conversion_result ret{}; |
384 | | |
385 | 9.25k | const auto implementations = get_supported_implementations(); |
386 | | |
387 | 9.25k | std::vector<result<ConversionResult>> results; |
388 | 9.25k | results.reserve(implementations.size()); |
389 | | |
390 | | // put the output in a separate allocation to make access violations easier |
391 | | // to catch |
392 | 9.25k | std::vector<std::vector<ToType>> outputbuffers; |
393 | 9.25k | outputbuffers.reserve(implementations.size()); |
394 | 37.0k | for (std::size_t i = 0; i < implementations.size(); ++i) { |
395 | 27.7k | auto impl = implementations[i]; |
396 | 27.7k | const ToType canary1{42}; |
397 | 27.7k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); |
398 | 27.7k | const auto implret1 = std::invoke(conversion, impl, src.data(), |
399 | 27.7k | src.size(), outputbuffer.data()); |
400 | | // was the conversion successful? |
401 | 27.7k | const auto success = [](const ConversionResult& r) -> bool { |
402 | 27.7k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { |
403 | 15.8k | return r != 0; |
404 | 15.8k | } else { |
405 | 11.9k | return r.error == simdutf::error_code::SUCCESS; |
406 | 11.9k | } |
407 | 27.7k | }(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 | 663 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 663 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 663 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 663 | }(implret1); |
Conversion<(UtfEncodings)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.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 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.17k | }(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 | 672 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 672 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 672 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 672 | }(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.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 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.15k | }(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 | 867 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 867 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 867 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 867 | }(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.14k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.14k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.14k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.14k | }(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.49k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.49k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.49k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.49k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) constLine | Count | Source | 401 | 1.89k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.89k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.89k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.89k | }(implret1); |
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) constLine | Count | Source | 401 | 1.95k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.95k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.95k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 1.95k | }(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.01k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.01k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.01k | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 2.01k | }(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 | 168 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 168 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 168 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 168 | }(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 | 222 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 222 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 222 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 222 | }(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 | 294 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 294 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 294 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 294 | }(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 | 858 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 858 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 858 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 858 | }(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 | 390 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 390 | } else { | 405 | 390 | return r.error == simdutf::error_code::SUCCESS; | 406 | 390 | } | 407 | 390 | }(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 | 525 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 525 | } else { | 405 | 525 | return r.error == simdutf::error_code::SUCCESS; | 406 | 525 | } | 407 | 525 | }(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 | 948 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 948 | } else { | 405 | 948 | return r.error == simdutf::error_code::SUCCESS; | 406 | 948 | } | 407 | 948 | }(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 | 378 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 378 | } else { | 405 | 378 | return r.error == simdutf::error_code::SUCCESS; | 406 | 378 | } | 407 | 378 | }(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 | 486 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 486 | } else { | 405 | 486 | return r.error == simdutf::error_code::SUCCESS; | 406 | 486 | } | 407 | 486 | }(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.05k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.05k | } else { | 405 | 1.05k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.05k | } | 407 | 1.05k | }(implret1); |
Conversion<(UtfEncodings)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 | 615 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 615 | } else { | 405 | 615 | return r.error == simdutf::error_code::SUCCESS; | 406 | 615 | } | 407 | 615 | }(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 | 954 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 954 | } else { | 405 | 954 | return r.error == simdutf::error_code::SUCCESS; | 406 | 954 | } | 407 | 954 | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) constLine | Count | Source | 401 | 1.00k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.00k | } else { | 405 | 1.00k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.00k | } | 407 | 1.00k | }(implret1); |
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) constLine | Count | Source | 401 | 1.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 | 978 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 978 | } else { | 405 | 978 | return r.error == simdutf::error_code::SUCCESS; | 406 | 978 | } | 407 | 978 | }(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.23k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.23k | } else { | 405 | 1.23k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.23k | } | 407 | 1.23k | }(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 | 885 | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 885 | } else { | 405 | 885 | return r.error == simdutf::error_code::SUCCESS; | 406 | 885 | } | 407 | 885 | }(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.21k | const auto success = [](const ConversionResult& r) -> bool { | 402 | | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | | return r != 0; | 404 | 1.21k | } else { | 405 | 1.21k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.21k | } | 407 | 1.21k | }(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 | 159 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 159 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 159 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 159 | }(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 | 135 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 135 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 135 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 135 | }(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 | 126 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 126 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 126 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 126 | }(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 | 810 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 810 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 810 | return r != 0; | 404 | | } else { | 405 | | return r.error == simdutf::error_code::SUCCESS; | 406 | | } | 407 | 810 | }(implret1); |
|
408 | 27.7k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); |
409 | 27.7k | if constexpr (use_canary_in_output) { |
410 | | // optionally convert again, this time with the buffer filled with |
411 | | // a different value. if the output differs, it means some of the buffer |
412 | | // was not written to by the conversion function. |
413 | 27.7k | const ToType canary2{25}; |
414 | 27.7k | const auto outputbuffer_first_run = outputbuffer; |
415 | 27.7k | std::ranges::fill(outputbuffer, canary2); |
416 | 27.7k | const auto implret2 = std::invoke(conversion, impl, src.data(), |
417 | 27.7k | src.size(), outputbuffer.data()); |
418 | | |
419 | 27.7k | if (implret1 != implret2) { |
420 | 0 | std::cerr << "different return value the second time!\n"; |
421 | 0 | std::abort(); |
422 | 0 | } |
423 | 27.7k | if (inputisvalid && success) { |
424 | | // only care about the output if the input is valid |
425 | 13.7k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); |
426 | 13.7k | 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.7k | } |
440 | 27.7k | } |
441 | 27.7k | results.emplace_back(implret1, success ? hash1 : ""); |
442 | 27.7k | } |
443 | | |
444 | | // do not require implementations to give the same output if |
445 | | // the input is not valid. |
446 | 9.25k | if (!inputisvalid) { |
447 | 13.2k | for (auto& e : results) { |
448 | 13.2k | e.outputhash.clear(); |
449 | 13.2k | } |
450 | 4.40k | } |
451 | | |
452 | 18.5k | 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 | 442 | 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 | 784 | 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 | 448 | 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 | 772 | 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 | 578 | 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 | 762 | 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 | 996 | 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.26k | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) constLine | Count | Source | 452 | 1.30k | 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.34k | 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 | 112 | 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 | 148 | 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 | 196 | 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 | 572 | 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 | 260 | 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 | 350 | 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 | 632 | 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 | 252 | 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 | 324 | 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 | 704 | 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 | 410 | 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 | 636 | 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 | 670 | 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 | 864 | 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 | 652 | 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 | 826 | 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 | 590 | 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 | 808 | 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 | 106 | 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 | 90 | 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 | 84 | 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 | 540 | auto neq = [](const auto& a, const auto& b) { return a != b; }; |
|
453 | 9.25k | 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.25k | } else { |
474 | 9.25k | ret.implementations_agree = true; |
475 | 9.25k | } |
476 | 9.25k | return ret; |
477 | 9.25k | } 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 | 221 | const bool inputisvalid) const { | 383 | 221 | conversion_result ret{}; | 384 | | | 385 | 221 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 221 | std::vector<result<ConversionResult>> results; | 388 | 221 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 221 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 221 | outputbuffers.reserve(implementations.size()); | 394 | 884 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 663 | auto impl = implementations[i]; | 396 | 663 | const ToType canary1{42}; | 397 | 663 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 663 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 663 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 663 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 663 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 663 | return r != 0; | 404 | 663 | } else { | 405 | 663 | return r.error == simdutf::error_code::SUCCESS; | 406 | 663 | } | 407 | 663 | }(implret1); | 408 | 663 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 663 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 663 | const ToType canary2{25}; | 414 | 663 | const auto outputbuffer_first_run = outputbuffer; | 415 | 663 | std::ranges::fill(outputbuffer, canary2); | 416 | 663 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 663 | src.size(), outputbuffer.data()); | 418 | | | 419 | 663 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 663 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 381 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 381 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 381 | } | 440 | 663 | } | 441 | 663 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 663 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 221 | if (!inputisvalid) { | 447 | 270 | for (auto& e : results) { | 448 | 270 | e.outputhash.clear(); | 449 | 270 | } | 450 | 90 | } | 451 | | | 452 | 221 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 221 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 221 | } else { | 474 | 221 | ret.implementations_agree = true; | 475 | 221 | } | 476 | 221 | return ret; | 477 | 221 | } |
Conversion<(UtfEncodings)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 | 392 | const bool inputisvalid) const { | 383 | 392 | conversion_result ret{}; | 384 | | | 385 | 392 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 392 | std::vector<result<ConversionResult>> results; | 388 | 392 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 392 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 392 | 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 | 900 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 900 | 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 | 900 | } | 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 | 392 | if (!inputisvalid) { | 447 | 267 | for (auto& e : results) { | 448 | 267 | e.outputhash.clear(); | 449 | 267 | } | 450 | 89 | } | 451 | | | 452 | 392 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 392 | 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 | 392 | } else { | 474 | 392 | ret.implementations_agree = true; | 475 | 392 | } | 476 | 392 | return ret; | 477 | 392 | } |
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 | 224 | const bool inputisvalid) const { | 383 | 224 | conversion_result ret{}; | 384 | | | 385 | 224 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 224 | std::vector<result<ConversionResult>> results; | 388 | 224 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 224 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 224 | outputbuffers.reserve(implementations.size()); | 394 | 896 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 672 | auto impl = implementations[i]; | 396 | 672 | const ToType canary1{42}; | 397 | 672 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 672 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 672 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 672 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 672 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 672 | return r != 0; | 404 | 672 | } else { | 405 | 672 | return r.error == simdutf::error_code::SUCCESS; | 406 | 672 | } | 407 | 672 | }(implret1); | 408 | 672 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 672 | 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 | 672 | const ToType canary2{25}; | 414 | 672 | const auto outputbuffer_first_run = outputbuffer; | 415 | 672 | std::ranges::fill(outputbuffer, canary2); | 416 | 672 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 672 | src.size(), outputbuffer.data()); | 418 | | | 419 | 672 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 672 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 396 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 396 | 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 | 396 | } | 440 | 672 | } | 441 | 672 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 672 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 224 | if (!inputisvalid) { | 447 | 264 | for (auto& e : results) { | 448 | 264 | e.outputhash.clear(); | 449 | 264 | } | 450 | 88 | } | 451 | | | 452 | 224 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 224 | 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 | 224 | } else { | 474 | 224 | ret.implementations_agree = true; | 475 | 224 | } | 476 | 224 | return ret; | 477 | 224 | } |
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 | 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 | 909 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 909 | 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 | 909 | } | 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 | 237 | for (auto& e : results) { | 448 | 237 | e.outputhash.clear(); | 449 | 237 | } | 450 | 79 | } | 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)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 | 289 | const bool inputisvalid) const { | 383 | 289 | conversion_result ret{}; | 384 | | | 385 | 289 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 289 | std::vector<result<ConversionResult>> results; | 388 | 289 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 289 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 289 | outputbuffers.reserve(implementations.size()); | 394 | 1.15k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 867 | auto impl = implementations[i]; | 396 | 867 | const ToType canary1{42}; | 397 | 867 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 867 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 867 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 867 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 867 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 867 | return r != 0; | 404 | 867 | } else { | 405 | 867 | return r.error == simdutf::error_code::SUCCESS; | 406 | 867 | } | 407 | 867 | }(implret1); | 408 | 867 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 867 | 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 | 867 | const ToType canary2{25}; | 414 | 867 | const auto outputbuffer_first_run = outputbuffer; | 415 | 867 | std::ranges::fill(outputbuffer, canary2); | 416 | 867 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 867 | src.size(), outputbuffer.data()); | 418 | | | 419 | 867 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 867 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 372 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 372 | 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 | 372 | } | 440 | 867 | } | 441 | 867 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 867 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 289 | if (!inputisvalid) { | 447 | 486 | for (auto& e : results) { | 448 | 486 | e.outputhash.clear(); | 449 | 486 | } | 450 | 162 | } | 451 | | | 452 | 289 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 289 | 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 | 289 | } else { | 474 | 289 | ret.implementations_agree = true; | 475 | 289 | } | 476 | 289 | return ret; | 477 | 289 | } |
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 | 381 | const bool inputisvalid) const { | 383 | 381 | conversion_result ret{}; | 384 | | | 385 | 381 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 381 | std::vector<result<ConversionResult>> results; | 388 | 381 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 381 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 381 | outputbuffers.reserve(implementations.size()); | 394 | 1.52k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.14k | auto impl = implementations[i]; | 396 | 1.14k | const ToType canary1{42}; | 397 | 1.14k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.14k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.14k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.14k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.14k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.14k | return r != 0; | 404 | 1.14k | } else { | 405 | 1.14k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.14k | } | 407 | 1.14k | }(implret1); | 408 | 1.14k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.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 | 1.14k | const ToType canary2{25}; | 414 | 1.14k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.14k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.14k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.14k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.14k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.14k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 585 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 585 | 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 | 585 | } | 440 | 1.14k | } | 441 | 1.14k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.14k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 381 | if (!inputisvalid) { | 447 | 546 | for (auto& e : results) { | 448 | 546 | e.outputhash.clear(); | 449 | 546 | } | 450 | 182 | } | 451 | | | 452 | 381 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 381 | 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 | 381 | } else { | 474 | 381 | ret.implementations_agree = true; | 475 | 381 | } | 476 | 381 | return ret; | 477 | 381 | } |
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 | 498 | const bool inputisvalid) const { | 383 | 498 | conversion_result ret{}; | 384 | | | 385 | 498 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 498 | std::vector<result<ConversionResult>> results; | 388 | 498 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 498 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 498 | outputbuffers.reserve(implementations.size()); | 394 | 1.99k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.49k | auto impl = implementations[i]; | 396 | 1.49k | const ToType canary1{42}; | 397 | 1.49k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.49k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.49k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.49k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.49k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.49k | return r != 0; | 404 | 1.49k | } else { | 405 | 1.49k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.49k | } | 407 | 1.49k | }(implret1); | 408 | 1.49k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.49k | 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.49k | const ToType canary2{25}; | 414 | 1.49k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.49k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.49k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.49k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.49k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.49k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 612 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 612 | 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 | 612 | } | 440 | 1.49k | } | 441 | 1.49k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.49k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 498 | if (!inputisvalid) { | 447 | 873 | for (auto& e : results) { | 448 | 873 | e.outputhash.clear(); | 449 | 873 | } | 450 | 291 | } | 451 | | | 452 | 498 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 498 | 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 | 498 | } else { | 474 | 498 | ret.implementations_agree = true; | 475 | 498 | } | 476 | 498 | return ret; | 477 | 498 | } |
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 | 631 | const bool inputisvalid) const { | 383 | 631 | conversion_result ret{}; | 384 | | | 385 | 631 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 631 | std::vector<result<ConversionResult>> results; | 388 | 631 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 631 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 631 | outputbuffers.reserve(implementations.size()); | 394 | 2.52k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.89k | auto impl = implementations[i]; | 396 | 1.89k | const ToType canary1{42}; | 397 | 1.89k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.89k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.89k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.89k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.89k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.89k | return r != 0; | 404 | 1.89k | } else { | 405 | 1.89k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.89k | } | 407 | 1.89k | }(implret1); | 408 | 1.89k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.89k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.89k | const ToType canary2{25}; | 414 | 1.89k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.89k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.89k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.89k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.89k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.89k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.10k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.10k | 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.10k | } | 440 | 1.89k | } | 441 | 1.89k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.89k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 631 | if (!inputisvalid) { | 447 | 786 | for (auto& e : results) { | 448 | 786 | e.outputhash.clear(); | 449 | 786 | } | 450 | 262 | } | 451 | | | 452 | 631 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 631 | 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 | 631 | } else { | 474 | 631 | ret.implementations_agree = true; | 475 | 631 | } | 476 | 631 | return ret; | 477 | 631 | } |
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 | 652 | const bool inputisvalid) const { | 383 | 652 | conversion_result ret{}; | 384 | | | 385 | 652 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 652 | std::vector<result<ConversionResult>> results; | 388 | 652 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 652 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 652 | outputbuffers.reserve(implementations.size()); | 394 | 2.60k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.95k | auto impl = implementations[i]; | 396 | 1.95k | const ToType canary1{42}; | 397 | 1.95k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.95k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.95k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.95k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.95k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.95k | return r != 0; | 404 | 1.95k | } else { | 405 | 1.95k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.95k | } | 407 | 1.95k | }(implret1); | 408 | 1.95k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.95k | 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.95k | const ToType canary2{25}; | 414 | 1.95k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.95k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.95k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.95k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.95k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.95k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 963 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 963 | 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 | 963 | } | 440 | 1.95k | } | 441 | 1.95k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.95k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 652 | if (!inputisvalid) { | 447 | 987 | for (auto& e : results) { | 448 | 987 | e.outputhash.clear(); | 449 | 987 | } | 450 | 329 | } | 451 | | | 452 | 652 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 652 | 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 | 652 | } else { | 474 | 652 | ret.implementations_agree = true; | 475 | 652 | } | 476 | 652 | return ret; | 477 | 652 | } |
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 | 672 | const bool inputisvalid) const { | 383 | 672 | conversion_result ret{}; | 384 | | | 385 | 672 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 672 | std::vector<result<ConversionResult>> results; | 388 | 672 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 672 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 672 | outputbuffers.reserve(implementations.size()); | 394 | 2.68k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 2.01k | auto impl = implementations[i]; | 396 | 2.01k | const ToType canary1{42}; | 397 | 2.01k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 2.01k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 2.01k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 2.01k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 2.01k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 2.01k | return r != 0; | 404 | 2.01k | } else { | 405 | 2.01k | return r.error == simdutf::error_code::SUCCESS; | 406 | 2.01k | } | 407 | 2.01k | }(implret1); | 408 | 2.01k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 2.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 | 2.01k | const ToType canary2{25}; | 414 | 2.01k | const auto outputbuffer_first_run = outputbuffer; | 415 | 2.01k | std::ranges::fill(outputbuffer, canary2); | 416 | 2.01k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 2.01k | src.size(), outputbuffer.data()); | 418 | | | 419 | 2.01k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 2.01k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 1.16k | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 1.16k | 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.16k | } | 440 | 2.01k | } | 441 | 2.01k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 2.01k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 672 | if (!inputisvalid) { | 447 | 846 | for (auto& e : results) { | 448 | 846 | e.outputhash.clear(); | 449 | 846 | } | 450 | 282 | } | 451 | | | 452 | 672 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 672 | 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 | 672 | } else { | 474 | 672 | ret.implementations_agree = true; | 475 | 672 | } | 476 | 672 | return ret; | 477 | 672 | } |
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 | 56 | const bool inputisvalid) const { | 383 | 56 | conversion_result ret{}; | 384 | | | 385 | 56 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 56 | std::vector<result<ConversionResult>> results; | 388 | 56 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 56 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 56 | outputbuffers.reserve(implementations.size()); | 394 | 224 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 168 | auto impl = implementations[i]; | 396 | 168 | const ToType canary1{42}; | 397 | 168 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 168 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 168 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 168 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 168 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 168 | return r != 0; | 404 | 168 | } else { | 405 | 168 | return r.error == simdutf::error_code::SUCCESS; | 406 | 168 | } | 407 | 168 | }(implret1); | 408 | 168 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 168 | 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 | 168 | const ToType canary2{25}; | 414 | 168 | const auto outputbuffer_first_run = outputbuffer; | 415 | 168 | std::ranges::fill(outputbuffer, canary2); | 416 | 168 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 168 | src.size(), outputbuffer.data()); | 418 | | | 419 | 168 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 168 | 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 | 168 | } | 441 | 168 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 168 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 56 | if (!inputisvalid) { | 447 | 27 | for (auto& e : results) { | 448 | 27 | e.outputhash.clear(); | 449 | 27 | } | 450 | 9 | } | 451 | | | 452 | 56 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 56 | 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 | 56 | } else { | 474 | 56 | ret.implementations_agree = true; | 475 | 56 | } | 476 | 56 | return ret; | 477 | 56 | } |
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 | 74 | const bool inputisvalid) const { | 383 | 74 | conversion_result ret{}; | 384 | | | 385 | 74 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 74 | std::vector<result<ConversionResult>> results; | 388 | 74 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 74 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 74 | outputbuffers.reserve(implementations.size()); | 394 | 296 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 222 | auto impl = implementations[i]; | 396 | 222 | const ToType canary1{42}; | 397 | 222 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 222 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 222 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 222 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 222 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 222 | return r != 0; | 404 | 222 | } else { | 405 | 222 | return r.error == simdutf::error_code::SUCCESS; | 406 | 222 | } | 407 | 222 | }(implret1); | 408 | 222 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 222 | 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 | 222 | const ToType canary2{25}; | 414 | 222 | const auto outputbuffer_first_run = outputbuffer; | 415 | 222 | std::ranges::fill(outputbuffer, canary2); | 416 | 222 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 222 | src.size(), outputbuffer.data()); | 418 | | | 419 | 222 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 222 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 60 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 60 | 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 | 60 | } | 440 | 222 | } | 441 | 222 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 222 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 74 | if (!inputisvalid) { | 447 | 75 | for (auto& e : results) { | 448 | 75 | e.outputhash.clear(); | 449 | 75 | } | 450 | 25 | } | 451 | | | 452 | 74 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 74 | 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 | 74 | } else { | 474 | 74 | ret.implementations_agree = true; | 475 | 74 | } | 476 | 74 | return ret; | 477 | 74 | } |
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 | 98 | const bool inputisvalid) const { | 383 | 98 | conversion_result ret{}; | 384 | | | 385 | 98 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 98 | std::vector<result<ConversionResult>> results; | 388 | 98 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 98 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 98 | outputbuffers.reserve(implementations.size()); | 394 | 392 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 294 | auto impl = implementations[i]; | 396 | 294 | const ToType canary1{42}; | 397 | 294 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 294 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 294 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 294 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 294 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 294 | return r != 0; | 404 | 294 | } else { | 405 | 294 | return r.error == simdutf::error_code::SUCCESS; | 406 | 294 | } | 407 | 294 | }(implret1); | 408 | 294 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 294 | 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 | 294 | const ToType canary2{25}; | 414 | 294 | const auto outputbuffer_first_run = outputbuffer; | 415 | 294 | std::ranges::fill(outputbuffer, canary2); | 416 | 294 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 294 | src.size(), outputbuffer.data()); | 418 | | | 419 | 294 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 294 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 54 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 54 | 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 | 54 | } | 440 | 294 | } | 441 | 294 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 294 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 98 | if (!inputisvalid) { | 447 | 225 | for (auto& e : results) { | 448 | 225 | e.outputhash.clear(); | 449 | 225 | } | 450 | 75 | } | 451 | | | 452 | 98 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 98 | 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 | 98 | } else { | 474 | 98 | ret.implementations_agree = true; | 475 | 98 | } | 476 | 98 | return ret; | 477 | 98 | } |
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 | 286 | const bool inputisvalid) const { | 383 | 286 | conversion_result ret{}; | 384 | | | 385 | 286 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 286 | std::vector<result<ConversionResult>> results; | 388 | 286 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 286 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 286 | outputbuffers.reserve(implementations.size()); | 394 | 1.14k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 858 | auto impl = implementations[i]; | 396 | 858 | const ToType canary1{42}; | 397 | 858 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 858 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 858 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 858 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 858 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 858 | return r != 0; | 404 | 858 | } else { | 405 | 858 | return r.error == simdutf::error_code::SUCCESS; | 406 | 858 | } | 407 | 858 | }(implret1); | 408 | 858 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 858 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 858 | const ToType canary2{25}; | 414 | 858 | const auto outputbuffer_first_run = outputbuffer; | 415 | 858 | std::ranges::fill(outputbuffer, canary2); | 416 | 858 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 858 | src.size(), outputbuffer.data()); | 418 | | | 419 | 858 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 858 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 216 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 216 | 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 | 216 | } | 440 | 858 | } | 441 | 858 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 858 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 286 | if (!inputisvalid) { | 447 | 618 | for (auto& e : results) { | 448 | 618 | e.outputhash.clear(); | 449 | 618 | } | 450 | 206 | } | 451 | | | 452 | 286 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 286 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 286 | } else { | 474 | 286 | ret.implementations_agree = true; | 475 | 286 | } | 476 | 286 | return ret; | 477 | 286 | } |
Conversion<(UtfEncodings)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 | 130 | const bool inputisvalid) const { | 383 | 130 | conversion_result ret{}; | 384 | | | 385 | 130 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 130 | std::vector<result<ConversionResult>> results; | 388 | 130 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 130 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 130 | outputbuffers.reserve(implementations.size()); | 394 | 520 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 390 | auto impl = implementations[i]; | 396 | 390 | const ToType canary1{42}; | 397 | 390 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 390 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 390 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 390 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 390 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 390 | return r != 0; | 404 | 390 | } else { | 405 | 390 | return r.error == simdutf::error_code::SUCCESS; | 406 | 390 | } | 407 | 390 | }(implret1); | 408 | 390 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 390 | 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 | 390 | const ToType canary2{25}; | 414 | 390 | const auto outputbuffer_first_run = outputbuffer; | 415 | 390 | std::ranges::fill(outputbuffer, canary2); | 416 | 390 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 390 | src.size(), outputbuffer.data()); | 418 | | | 419 | 390 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 390 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 111 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 111 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 111 | } | 440 | 390 | } | 441 | 390 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 390 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 130 | if (!inputisvalid) { | 447 | 96 | for (auto& e : results) { | 448 | 96 | e.outputhash.clear(); | 449 | 96 | } | 450 | 32 | } | 451 | | | 452 | 130 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 130 | 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 | 130 | } else { | 474 | 130 | ret.implementations_agree = true; | 475 | 130 | } | 476 | 130 | return ret; | 477 | 130 | } |
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 | 175 | const bool inputisvalid) const { | 383 | 175 | conversion_result ret{}; | 384 | | | 385 | 175 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 175 | std::vector<result<ConversionResult>> results; | 388 | 175 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 175 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 175 | outputbuffers.reserve(implementations.size()); | 394 | 700 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 525 | auto impl = implementations[i]; | 396 | 525 | const ToType canary1{42}; | 397 | 525 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 525 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 525 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 525 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 525 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 525 | return r != 0; | 404 | 525 | } else { | 405 | 525 | return r.error == simdutf::error_code::SUCCESS; | 406 | 525 | } | 407 | 525 | }(implret1); | 408 | 525 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 525 | 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 | 525 | const ToType canary2{25}; | 414 | 525 | const auto outputbuffer_first_run = outputbuffer; | 415 | 525 | std::ranges::fill(outputbuffer, canary2); | 416 | 525 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 525 | src.size(), outputbuffer.data()); | 418 | | | 419 | 525 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 525 | 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 | 525 | } | 441 | 525 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 525 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 175 | if (!inputisvalid) { | 447 | 255 | for (auto& e : results) { | 448 | 255 | e.outputhash.clear(); | 449 | 255 | } | 450 | 85 | } | 451 | | | 452 | 175 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 175 | 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 | 175 | } else { | 474 | 175 | ret.implementations_agree = true; | 475 | 175 | } | 476 | 175 | return ret; | 477 | 175 | } |
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 | 316 | const bool inputisvalid) const { | 383 | 316 | conversion_result ret{}; | 384 | | | 385 | 316 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 316 | std::vector<result<ConversionResult>> results; | 388 | 316 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 316 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 316 | outputbuffers.reserve(implementations.size()); | 394 | 1.26k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 948 | auto impl = implementations[i]; | 396 | 948 | const ToType canary1{42}; | 397 | 948 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 948 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 948 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 948 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 948 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 948 | return r != 0; | 404 | 948 | } else { | 405 | 948 | return r.error == simdutf::error_code::SUCCESS; | 406 | 948 | } | 407 | 948 | }(implret1); | 408 | 948 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 948 | 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 | 948 | const ToType canary2{25}; | 414 | 948 | const auto outputbuffer_first_run = outputbuffer; | 415 | 948 | std::ranges::fill(outputbuffer, canary2); | 416 | 948 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 948 | src.size(), outputbuffer.data()); | 418 | | | 419 | 948 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 948 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 579 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 579 | 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 | 579 | } | 440 | 948 | } | 441 | 948 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 948 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 316 | if (!inputisvalid) { | 447 | 369 | for (auto& e : results) { | 448 | 369 | e.outputhash.clear(); | 449 | 369 | } | 450 | 123 | } | 451 | | | 452 | 316 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 316 | 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 | 316 | } else { | 474 | 316 | ret.implementations_agree = true; | 475 | 316 | } | 476 | 316 | return ret; | 477 | 316 | } |
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 | 126 | const bool inputisvalid) const { | 383 | 126 | conversion_result ret{}; | 384 | | | 385 | 126 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 126 | std::vector<result<ConversionResult>> results; | 388 | 126 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 126 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 126 | outputbuffers.reserve(implementations.size()); | 394 | 504 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 378 | auto impl = implementations[i]; | 396 | 378 | const ToType canary1{42}; | 397 | 378 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 378 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 378 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 378 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 378 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 378 | return r != 0; | 404 | 378 | } else { | 405 | 378 | return r.error == simdutf::error_code::SUCCESS; | 406 | 378 | } | 407 | 378 | }(implret1); | 408 | 378 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 378 | 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 | 378 | const ToType canary2{25}; | 414 | 378 | const auto outputbuffer_first_run = outputbuffer; | 415 | 378 | std::ranges::fill(outputbuffer, canary2); | 416 | 378 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 378 | src.size(), outputbuffer.data()); | 418 | | | 419 | 378 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 378 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 123 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 123 | 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 | 123 | } | 440 | 378 | } | 441 | 378 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 378 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 126 | if (!inputisvalid) { | 447 | 42 | for (auto& e : results) { | 448 | 42 | e.outputhash.clear(); | 449 | 42 | } | 450 | 14 | } | 451 | | | 452 | 126 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 126 | 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 | 126 | } else { | 474 | 126 | ret.implementations_agree = true; | 475 | 126 | } | 476 | 126 | return ret; | 477 | 126 | } |
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 | 162 | const bool inputisvalid) const { | 383 | 162 | conversion_result ret{}; | 384 | | | 385 | 162 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 162 | std::vector<result<ConversionResult>> results; | 388 | 162 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 162 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 162 | outputbuffers.reserve(implementations.size()); | 394 | 648 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 486 | auto impl = implementations[i]; | 396 | 486 | const ToType canary1{42}; | 397 | 486 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 486 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 486 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 486 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 486 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 486 | return r != 0; | 404 | 486 | } else { | 405 | 486 | return r.error == simdutf::error_code::SUCCESS; | 406 | 486 | } | 407 | 486 | }(implret1); | 408 | 486 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 486 | 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 | 486 | const ToType canary2{25}; | 414 | 486 | const auto outputbuffer_first_run = outputbuffer; | 415 | 486 | std::ranges::fill(outputbuffer, canary2); | 416 | 486 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 486 | src.size(), outputbuffer.data()); | 418 | | | 419 | 486 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 486 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 237 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 237 | 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 | 237 | } | 440 | 486 | } | 441 | 486 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 486 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 162 | if (!inputisvalid) { | 447 | 249 | for (auto& e : results) { | 448 | 249 | e.outputhash.clear(); | 449 | 249 | } | 450 | 83 | } | 451 | | | 452 | 162 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 162 | 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 | 162 | } else { | 474 | 162 | ret.implementations_agree = true; | 475 | 162 | } | 476 | 162 | return ret; | 477 | 162 | } |
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 | 352 | const bool inputisvalid) const { | 383 | 352 | conversion_result ret{}; | 384 | | | 385 | 352 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 352 | std::vector<result<ConversionResult>> results; | 388 | 352 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 352 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 352 | outputbuffers.reserve(implementations.size()); | 394 | 1.40k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.05k | auto impl = implementations[i]; | 396 | 1.05k | const ToType canary1{42}; | 397 | 1.05k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.05k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.05k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.05k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.05k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.05k | return r != 0; | 404 | 1.05k | } else { | 405 | 1.05k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.05k | } | 407 | 1.05k | }(implret1); | 408 | 1.05k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.05k | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 1.05k | const ToType canary2{25}; | 414 | 1.05k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.05k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.05k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.05k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.05k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.05k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 702 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 702 | 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 | 702 | } | 440 | 1.05k | } | 441 | 1.05k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.05k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 352 | if (!inputisvalid) { | 447 | 354 | for (auto& e : results) { | 448 | 354 | e.outputhash.clear(); | 449 | 354 | } | 450 | 118 | } | 451 | | | 452 | 352 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 352 | 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 | 352 | } else { | 474 | 352 | ret.implementations_agree = true; | 475 | 352 | } | 476 | 352 | return ret; | 477 | 352 | } |
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 | 205 | const bool inputisvalid) const { | 383 | 205 | conversion_result ret{}; | 384 | | | 385 | 205 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 205 | std::vector<result<ConversionResult>> results; | 388 | 205 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 205 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 205 | outputbuffers.reserve(implementations.size()); | 394 | 820 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 615 | auto impl = implementations[i]; | 396 | 615 | const ToType canary1{42}; | 397 | 615 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 615 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 615 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 615 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 615 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 615 | return r != 0; | 404 | 615 | } else { | 405 | 615 | return r.error == simdutf::error_code::SUCCESS; | 406 | 615 | } | 407 | 615 | }(implret1); | 408 | 615 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 615 | 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 | 615 | const ToType canary2{25}; | 414 | 615 | const auto outputbuffer_first_run = outputbuffer; | 415 | 615 | std::ranges::fill(outputbuffer, canary2); | 416 | 615 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 615 | src.size(), outputbuffer.data()); | 418 | | | 419 | 615 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 615 | 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 | 615 | } | 441 | 615 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 615 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 205 | if (!inputisvalid) { | 447 | 510 | for (auto& e : results) { | 448 | 510 | e.outputhash.clear(); | 449 | 510 | } | 450 | 170 | } | 451 | | | 452 | 205 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 205 | 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 | 205 | } else { | 474 | 205 | ret.implementations_agree = true; | 475 | 205 | } | 476 | 205 | return ret; | 477 | 205 | } |
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 | 318 | const bool inputisvalid) const { | 383 | 318 | conversion_result ret{}; | 384 | | | 385 | 318 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 318 | std::vector<result<ConversionResult>> results; | 388 | 318 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 318 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 318 | outputbuffers.reserve(implementations.size()); | 394 | 1.27k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 954 | auto impl = implementations[i]; | 396 | 954 | const ToType canary1{42}; | 397 | 954 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 954 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 954 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 954 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 954 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 954 | return r != 0; | 404 | 954 | } else { | 405 | 954 | return r.error == simdutf::error_code::SUCCESS; | 406 | 954 | } | 407 | 954 | }(implret1); | 408 | 954 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 954 | if constexpr (use_canary_in_output) { | 410 | | // optionally convert again, this time with the buffer filled with | 411 | | // a different value. if the output differs, it means some of the buffer | 412 | | // was not written to by the conversion function. | 413 | 954 | const ToType canary2{25}; | 414 | 954 | const auto outputbuffer_first_run = outputbuffer; | 415 | 954 | std::ranges::fill(outputbuffer, canary2); | 416 | 954 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 954 | src.size(), outputbuffer.data()); | 418 | | | 419 | 954 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 954 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 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 | 954 | } | 441 | 954 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 954 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 318 | if (!inputisvalid) { | 447 | 690 | for (auto& e : results) { | 448 | 690 | e.outputhash.clear(); | 449 | 690 | } | 450 | 230 | } | 451 | | | 452 | 318 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 318 | if (std::ranges::adjacent_find(results, neq) != results.end()) { | 454 | 0 | std::cerr << "begin errormessage for do_conversion\n"; | 455 | 0 | std::cerr << "in fuzz case for " << name << " invoked with " << src.size() | 456 | 0 | << " elements:\n"; | 457 | 0 | std::cerr << "input data is valid ? " << inputisvalid << '\n'; | 458 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 459 | 0 | std::cerr << "got return " << std::dec << results[i] | 460 | 0 | << " from implementation " << implementations[i]->name() | 461 | 0 | << " using outlen=" << outlength.at(i) << '\n'; | 462 | 0 | } | 463 | 0 | for (std::size_t i = 0; i < results.size(); ++i) { | 464 | 0 | std::cerr << "implementation " << implementations[i]->name() | 465 | 0 | << " out: "; | 466 | 0 | for (const auto e : outputbuffers.at(i)) { | 467 | 0 | std::cerr << +e << ", "; | 468 | 0 | } | 469 | 0 | std::cerr << '\n'; | 470 | 0 | } | 471 | 0 | std::cerr << "end errormessage\n"; | 472 | 0 | ret.implementations_agree = false; | 473 | 318 | } else { | 474 | 318 | ret.implementations_agree = true; | 475 | 318 | } | 476 | 318 | return ret; | 477 | 318 | } |
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 | 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 | 300 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 300 | if (hash1 != hash2) { | 427 | 0 | std::cerr << "different output the second time!\n"; | 428 | 0 | std::cerr << "implementation " << impl->name() << " " << name | 429 | 0 | << '\n'; | 430 | 0 | std::cerr << "input is valid=" << inputisvalid << '\n'; | 431 | 0 | std::cerr << "output length=" << outputbuffer.size() << '\n'; | 432 | 0 | std::cerr << "conversion was a success? " << success << '\n'; | 433 | 0 | for (std::size_t j = 0; j < outputbuffer.size(); ++j) { | 434 | 0 | std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j] | 435 | 0 | << '\t' << +outputbuffer[j] << '\n'; | 436 | 0 | } | 437 | 0 | std::abort(); | 438 | 0 | } | 439 | 300 | } | 440 | 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 | 705 | for (auto& e : results) { | 448 | 705 | e.outputhash.clear(); | 449 | 705 | } | 450 | 235 | } | 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)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 | 432 | const bool inputisvalid) const { | 383 | 432 | conversion_result ret{}; | 384 | | | 385 | 432 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 432 | std::vector<result<ConversionResult>> results; | 388 | 432 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 432 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 432 | 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 | 336 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 336 | 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 | 336 | } | 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 | 432 | if (!inputisvalid) { | 447 | 960 | for (auto& e : results) { | 448 | 960 | e.outputhash.clear(); | 449 | 960 | } | 450 | 320 | } | 451 | | | 452 | 432 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 432 | 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 | 432 | } else { | 474 | 432 | ret.implementations_agree = true; | 475 | 432 | } | 476 | 432 | return ret; | 477 | 432 | } |
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 | 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 | 390 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 390 | 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 | 390 | } | 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 | 564 | for (auto& e : results) { | 448 | 564 | e.outputhash.clear(); | 449 | 564 | } | 450 | 188 | } | 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)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 | 413 | const bool inputisvalid) const { | 383 | 413 | conversion_result ret{}; | 384 | | | 385 | 413 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 413 | std::vector<result<ConversionResult>> results; | 388 | 413 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 413 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 413 | outputbuffers.reserve(implementations.size()); | 394 | 1.65k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 1.23k | auto impl = implementations[i]; | 396 | 1.23k | const ToType canary1{42}; | 397 | 1.23k | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 1.23k | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 1.23k | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 1.23k | const auto success = [](const ConversionResult& r) -> bool { | 402 | 1.23k | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 1.23k | return r != 0; | 404 | 1.23k | } else { | 405 | 1.23k | return r.error == simdutf::error_code::SUCCESS; | 406 | 1.23k | } | 407 | 1.23k | }(implret1); | 408 | 1.23k | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 1.23k | 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.23k | const ToType canary2{25}; | 414 | 1.23k | const auto outputbuffer_first_run = outputbuffer; | 415 | 1.23k | std::ranges::fill(outputbuffer, canary2); | 416 | 1.23k | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 1.23k | src.size(), outputbuffer.data()); | 418 | | | 419 | 1.23k | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 1.23k | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 531 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 531 | 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 | 531 | } | 440 | 1.23k | } | 441 | 1.23k | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 1.23k | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 413 | if (!inputisvalid) { | 447 | 708 | for (auto& e : results) { | 448 | 708 | e.outputhash.clear(); | 449 | 708 | } | 450 | 236 | } | 451 | | | 452 | 413 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 413 | 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 | 413 | } else { | 474 | 413 | ret.implementations_agree = true; | 475 | 413 | } | 476 | 413 | return ret; | 477 | 413 | } |
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 | 295 | const bool inputisvalid) const { | 383 | 295 | conversion_result ret{}; | 384 | | | 385 | 295 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 295 | std::vector<result<ConversionResult>> results; | 388 | 295 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 295 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 295 | outputbuffers.reserve(implementations.size()); | 394 | 1.18k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 885 | auto impl = implementations[i]; | 396 | 885 | const ToType canary1{42}; | 397 | 885 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 885 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 885 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 885 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 885 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 885 | return r != 0; | 404 | 885 | } else { | 405 | 885 | return r.error == simdutf::error_code::SUCCESS; | 406 | 885 | } | 407 | 885 | }(implret1); | 408 | 885 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 885 | 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 | 885 | const ToType canary2{25}; | 414 | 885 | const auto outputbuffer_first_run = outputbuffer; | 415 | 885 | std::ranges::fill(outputbuffer, canary2); | 416 | 885 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 885 | src.size(), outputbuffer.data()); | 418 | | | 419 | 885 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 885 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 369 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 369 | 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 | 369 | } | 440 | 885 | } | 441 | 885 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 885 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 295 | if (!inputisvalid) { | 447 | 516 | for (auto& e : results) { | 448 | 516 | e.outputhash.clear(); | 449 | 516 | } | 450 | 172 | } | 451 | | | 452 | 295 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 295 | 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 | 295 | } else { | 474 | 295 | ret.implementations_agree = true; | 475 | 295 | } | 476 | 295 | return ret; | 477 | 295 | } |
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 | 404 | const bool inputisvalid) const { | 383 | 404 | conversion_result ret{}; | 384 | | | 385 | 404 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 404 | std::vector<result<ConversionResult>> results; | 388 | 404 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 404 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 404 | outputbuffers.reserve(implementations.size()); | 394 | 1.61k | 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 | 519 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 519 | 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 | 519 | } | 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 | 404 | if (!inputisvalid) { | 447 | 693 | for (auto& e : results) { | 448 | 693 | e.outputhash.clear(); | 449 | 693 | } | 450 | 231 | } | 451 | | | 452 | 404 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 404 | 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 | 404 | } else { | 474 | 404 | ret.implementations_agree = true; | 475 | 404 | } | 476 | 404 | return ret; | 477 | 404 | } |
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 | 53 | const bool inputisvalid) const { | 383 | 53 | conversion_result ret{}; | 384 | | | 385 | 53 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 53 | std::vector<result<ConversionResult>> results; | 388 | 53 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 53 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 53 | outputbuffers.reserve(implementations.size()); | 394 | 212 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 159 | auto impl = implementations[i]; | 396 | 159 | const ToType canary1{42}; | 397 | 159 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 159 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 159 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 159 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 159 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 159 | return r != 0; | 404 | 159 | } else { | 405 | 159 | return r.error == simdutf::error_code::SUCCESS; | 406 | 159 | } | 407 | 159 | }(implret1); | 408 | 159 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 159 | 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 | 159 | const ToType canary2{25}; | 414 | 159 | const auto outputbuffer_first_run = outputbuffer; | 415 | 159 | std::ranges::fill(outputbuffer, canary2); | 416 | 159 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 159 | src.size(), outputbuffer.data()); | 418 | | | 419 | 159 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 159 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 153 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 153 | 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 | 153 | } | 440 | 159 | } | 441 | 159 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 159 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 53 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 53 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 53 | 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 | 53 | } else { | 474 | 53 | ret.implementations_agree = true; | 475 | 53 | } | 476 | 53 | return ret; | 477 | 53 | } |
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 | 45 | const bool inputisvalid) const { | 383 | 45 | conversion_result ret{}; | 384 | | | 385 | 45 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 45 | std::vector<result<ConversionResult>> results; | 388 | 45 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 45 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 45 | outputbuffers.reserve(implementations.size()); | 394 | 180 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 135 | auto impl = implementations[i]; | 396 | 135 | const ToType canary1{42}; | 397 | 135 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 135 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 135 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 135 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 135 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 135 | return r != 0; | 404 | 135 | } else { | 405 | 135 | return r.error == simdutf::error_code::SUCCESS; | 406 | 135 | } | 407 | 135 | }(implret1); | 408 | 135 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 135 | 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 | 135 | const ToType canary2{25}; | 414 | 135 | const auto outputbuffer_first_run = outputbuffer; | 415 | 135 | std::ranges::fill(outputbuffer, canary2); | 416 | 135 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 135 | src.size(), outputbuffer.data()); | 418 | | | 419 | 135 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 135 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 129 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 129 | 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 | 129 | } | 440 | 135 | } | 441 | 135 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 135 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 45 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 45 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 45 | 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 | 45 | } else { | 474 | 45 | ret.implementations_agree = true; | 475 | 45 | } | 476 | 45 | return ret; | 477 | 45 | } |
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 | 42 | const bool inputisvalid) const { | 383 | 42 | conversion_result ret{}; | 384 | | | 385 | 42 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 42 | std::vector<result<ConversionResult>> results; | 388 | 42 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 42 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 42 | outputbuffers.reserve(implementations.size()); | 394 | 168 | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 126 | auto impl = implementations[i]; | 396 | 126 | const ToType canary1{42}; | 397 | 126 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 126 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 126 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 126 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 126 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 126 | return r != 0; | 404 | 126 | } else { | 405 | 126 | return r.error == simdutf::error_code::SUCCESS; | 406 | 126 | } | 407 | 126 | }(implret1); | 408 | 126 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 126 | 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 | 126 | const ToType canary2{25}; | 414 | 126 | const auto outputbuffer_first_run = outputbuffer; | 415 | 126 | std::ranges::fill(outputbuffer, canary2); | 416 | 126 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 126 | src.size(), outputbuffer.data()); | 418 | | | 419 | 126 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 126 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 120 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 120 | 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 | 120 | } | 440 | 126 | } | 441 | 126 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 126 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 42 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 42 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 42 | 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 | 42 | } else { | 474 | 42 | ret.implementations_agree = true; | 475 | 42 | } | 476 | 42 | return ret; | 477 | 42 | } |
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 | 270 | const bool inputisvalid) const { | 383 | 270 | conversion_result ret{}; | 384 | | | 385 | 270 | const auto implementations = get_supported_implementations(); | 386 | | | 387 | 270 | std::vector<result<ConversionResult>> results; | 388 | 270 | results.reserve(implementations.size()); | 389 | | | 390 | | // put the output in a separate allocation to make access violations easier | 391 | | // to catch | 392 | 270 | std::vector<std::vector<ToType>> outputbuffers; | 393 | 270 | outputbuffers.reserve(implementations.size()); | 394 | 1.08k | for (std::size_t i = 0; i < implementations.size(); ++i) { | 395 | 810 | auto impl = implementations[i]; | 396 | 810 | const ToType canary1{42}; | 397 | 810 | auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1); | 398 | 810 | const auto implret1 = std::invoke(conversion, impl, src.data(), | 399 | 810 | src.size(), outputbuffer.data()); | 400 | | // was the conversion successful? | 401 | 810 | const auto success = [](const ConversionResult& r) -> bool { | 402 | 810 | if constexpr (std::is_same_v<ConversionResult, std::size_t>) { | 403 | 810 | return r != 0; | 404 | 810 | } else { | 405 | 810 | return r.error == simdutf::error_code::SUCCESS; | 406 | 810 | } | 407 | 810 | }(implret1); | 408 | 810 | const auto hash1 = FNV1A_hash::as_str(outputbuffer); | 409 | 810 | 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 | 810 | const ToType canary2{25}; | 414 | 810 | const auto outputbuffer_first_run = outputbuffer; | 415 | 810 | std::ranges::fill(outputbuffer, canary2); | 416 | 810 | const auto implret2 = std::invoke(conversion, impl, src.data(), | 417 | 810 | src.size(), outputbuffer.data()); | 418 | | | 419 | 810 | if (implret1 != implret2) { | 420 | 0 | std::cerr << "different return value the second time!\n"; | 421 | 0 | std::abort(); | 422 | 0 | } | 423 | 810 | if (inputisvalid && success) { | 424 | | // only care about the output if the input is valid | 425 | 804 | const auto hash2 = FNV1A_hash::as_str(outputbuffer); | 426 | 804 | 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 | 804 | } | 440 | 810 | } | 441 | 810 | results.emplace_back(implret1, success ? hash1 : ""); | 442 | 810 | } | 443 | | | 444 | | // do not require implementations to give the same output if | 445 | | // the input is not valid. | 446 | 270 | if (!inputisvalid) { | 447 | 0 | for (auto& e : results) { | 448 | 0 | e.outputhash.clear(); | 449 | 0 | } | 450 | 0 | } | 451 | | | 452 | 270 | auto neq = [](const auto& a, const auto& b) { return a != b; }; | 453 | 270 | 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 | 270 | } else { | 474 | 270 | ret.implementations_agree = true; | 475 | 270 | } | 476 | 270 | return ret; | 477 | 270 | } |
|
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.34k | +[](std::span<const char> chardata) { \ |
555 | 9.34k | const auto c = \ |
556 | 9.34k | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ |
557 | 9.34k | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ |
558 | 9.34k | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ |
559 | 9.34k | &I::lenfunc, &I::conversionfunc, \ |
560 | 9.34k | std::string{NAMEOF(&I::lenfunc)}, \ |
561 | 9.34k | std::string{NAMEOF(&I::conversionfunc)}}; \ |
562 | 9.34k | c.fuzz(chardata); \ |
563 | 9.34k | } \ conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 104 | +[](std::span<const char> chardata) { \ | 555 | 104 | const auto c = \ | 556 | 104 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 104 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 104 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 104 | &I::lenfunc, &I::conversionfunc, \ | 560 | 104 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 104 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 104 | c.fuzz(chardata); \ | 563 | 104 | } \ |
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 222 | +[](std::span<const char> chardata) { \ | 555 | 222 | const auto c = \ | 556 | 222 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 222 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 222 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 222 | &I::lenfunc, &I::conversionfunc, \ | 560 | 222 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 222 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 222 | c.fuzz(chardata); \ | 563 | 222 | } \ |
conversion.cpp:populate_functions()::$_2::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()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 191 | +[](std::span<const char> chardata) { \ | 555 | 191 | const auto c = \ | 556 | 191 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 191 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 191 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 191 | &I::lenfunc, &I::conversionfunc, \ | 560 | 191 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 191 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 191 | c.fuzz(chardata); \ | 563 | 191 | } \ |
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 69 | +[](std::span<const char> chardata) { \ | 555 | 69 | const auto c = \ | 556 | 69 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 69 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 69 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 69 | &I::lenfunc, &I::conversionfunc, \ | 560 | 69 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 69 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 69 | c.fuzz(chardata); \ | 563 | 69 | } \ |
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 122 | +[](std::span<const char> chardata) { \ | 555 | 122 | const auto c = \ | 556 | 122 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 122 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 122 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 122 | &I::lenfunc, &I::conversionfunc, \ | 560 | 122 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 122 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 122 | c.fuzz(chardata); \ | 563 | 122 | } \ |
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 109 | +[](std::span<const char> chardata) { \ | 555 | 109 | const auto c = \ | 556 | 109 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 109 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 109 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 109 | &I::lenfunc, &I::conversionfunc, \ | 560 | 109 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 109 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 109 | c.fuzz(chardata); \ | 563 | 109 | } \ |
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 282 | +[](std::span<const char> chardata) { \ | 555 | 282 | const auto c = \ | 556 | 282 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 282 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 282 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 282 | &I::lenfunc, &I::conversionfunc, \ | 560 | 282 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 282 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 282 | c.fuzz(chardata); \ | 563 | 282 | } \ |
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 186 | +[](std::span<const char> chardata) { \ | 555 | 186 | const auto c = \ | 556 | 186 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 186 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 186 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 186 | &I::lenfunc, &I::conversionfunc, \ | 560 | 186 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 186 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 186 | c.fuzz(chardata); \ | 563 | 186 | } \ |
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 275 | +[](std::span<const char> chardata) { \ | 555 | 275 | const auto c = \ | 556 | 275 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 275 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 275 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 275 | &I::lenfunc, &I::conversionfunc, \ | 560 | 275 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 275 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 275 | c.fuzz(chardata); \ | 563 | 275 | } \ |
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 56 | +[](std::span<const char> chardata) { \ | 555 | 56 | const auto c = \ | 556 | 56 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 56 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 56 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 56 | &I::lenfunc, &I::conversionfunc, \ | 560 | 56 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 56 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 56 | c.fuzz(chardata); \ | 563 | 56 | } \ |
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 139 | +[](std::span<const char> chardata) { \ | 555 | 139 | const auto c = \ | 556 | 139 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 139 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 139 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 139 | &I::lenfunc, &I::conversionfunc, \ | 560 | 139 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 139 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 139 | c.fuzz(chardata); \ | 563 | 139 | } \ |
conversion.cpp:populate_functions()::$_12::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()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 74 | +[](std::span<const char> chardata) { \ | 555 | 74 | const auto c = \ | 556 | 74 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 74 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 74 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 74 | &I::lenfunc, &I::conversionfunc, \ | 560 | 74 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 74 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 74 | c.fuzz(chardata); \ | 563 | 74 | } \ |
conversion.cpp:populate_functions()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 165 | +[](std::span<const char> chardata) { \ | 555 | 165 | const auto c = \ | 556 | 165 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 165 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 165 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 165 | &I::lenfunc, &I::conversionfunc, \ | 560 | 165 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 165 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 165 | c.fuzz(chardata); \ | 563 | 165 | } \ |
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 207 | +[](std::span<const char> chardata) { \ | 555 | 207 | const auto c = \ | 556 | 207 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 207 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 207 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 207 | &I::lenfunc, &I::conversionfunc, \ | 560 | 207 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 207 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 207 | c.fuzz(chardata); \ | 563 | 207 | } \ |
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 98 | +[](std::span<const char> chardata) { \ | 555 | 98 | const auto c = \ | 556 | 98 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 98 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 98 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 98 | &I::lenfunc, &I::conversionfunc, \ | 560 | 98 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 98 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 98 | c.fuzz(chardata); \ | 563 | 98 | } \ |
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 222 | +[](std::span<const char> chardata) { \ | 555 | 222 | const auto c = \ | 556 | 222 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 222 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 222 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 222 | &I::lenfunc, &I::conversionfunc, \ | 560 | 222 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 222 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 222 | c.fuzz(chardata); \ | 563 | 222 | } \ |
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 262 | +[](std::span<const char> chardata) { \ | 555 | 262 | const auto c = \ | 556 | 262 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 262 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 262 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 262 | &I::lenfunc, &I::conversionfunc, \ | 560 | 262 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 262 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 262 | c.fuzz(chardata); \ | 563 | 262 | } \ |
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 393 | +[](std::span<const char> chardata) { \ | 555 | 393 | const auto c = \ | 556 | 393 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 393 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 393 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 393 | &I::lenfunc, &I::conversionfunc, \ | 560 | 393 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 393 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 393 | c.fuzz(chardata); \ | 563 | 393 | } \ |
conversion.cpp:populate_functions()::$_20::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 286 | +[](std::span<const char> chardata) { \ | 555 | 286 | const auto c = \ | 556 | 286 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 286 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 286 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 286 | &I::lenfunc, &I::conversionfunc, \ | 560 | 286 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 286 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 286 | c.fuzz(chardata); \ | 563 | 286 | } \ |
conversion.cpp:populate_functions()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 359 | +[](std::span<const char> chardata) { \ | 555 | 359 | const auto c = \ | 556 | 359 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 359 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 359 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 359 | &I::lenfunc, &I::conversionfunc, \ | 560 | 359 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 359 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 359 | c.fuzz(chardata); \ | 563 | 359 | } \ |
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 471 | +[](std::span<const char> chardata) { \ | 555 | 471 | const auto c = \ | 556 | 471 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 471 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 471 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 471 | &I::lenfunc, &I::conversionfunc, \ | 560 | 471 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 471 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 471 | c.fuzz(chardata); \ | 563 | 471 | } \ |
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 402 | +[](std::span<const char> chardata) { \ | 555 | 402 | const auto c = \ | 556 | 402 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 402 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 402 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 402 | &I::lenfunc, &I::conversionfunc, \ | 560 | 402 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 402 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 402 | c.fuzz(chardata); \ | 563 | 402 | } \ |
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 130 | +[](std::span<const char> chardata) { \ | 555 | 130 | const auto c = \ | 556 | 130 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 130 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 130 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 130 | &I::lenfunc, &I::conversionfunc, \ | 560 | 130 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 130 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 130 | c.fuzz(chardata); \ | 563 | 130 | } \ |
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 175 | +[](std::span<const char> chardata) { \ | 555 | 175 | const auto c = \ | 556 | 175 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 175 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 175 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 175 | &I::lenfunc, &I::conversionfunc, \ | 560 | 175 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 175 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 175 | c.fuzz(chardata); \ | 563 | 175 | } \ |
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 316 | +[](std::span<const char> chardata) { \ | 555 | 316 | const auto c = \ | 556 | 316 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 316 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 316 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 316 | &I::lenfunc, &I::conversionfunc, \ | 560 | 316 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 316 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 316 | c.fuzz(chardata); \ | 563 | 316 | } \ |
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 126 | +[](std::span<const char> chardata) { \ | 555 | 126 | const auto c = \ | 556 | 126 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 126 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 126 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 126 | &I::lenfunc, &I::conversionfunc, \ | 560 | 126 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 126 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 126 | c.fuzz(chardata); \ | 563 | 126 | } \ |
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 162 | +[](std::span<const char> chardata) { \ | 555 | 162 | const auto c = \ | 556 | 162 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 162 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 162 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 162 | &I::lenfunc, &I::conversionfunc, \ | 560 | 162 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 162 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 162 | c.fuzz(chardata); \ | 563 | 162 | } \ |
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 352 | +[](std::span<const char> chardata) { \ | 555 | 352 | const auto c = \ | 556 | 352 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 352 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 352 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 352 | &I::lenfunc, &I::conversionfunc, \ | 560 | 352 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 352 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 352 | c.fuzz(chardata); \ | 563 | 352 | } \ |
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 205 | +[](std::span<const char> chardata) { \ | 555 | 205 | const auto c = \ | 556 | 205 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 205 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 205 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 205 | &I::lenfunc, &I::conversionfunc, \ | 560 | 205 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 205 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 205 | c.fuzz(chardata); \ | 563 | 205 | } \ |
conversion.cpp:populate_functions()::$_31::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 318 | +[](std::span<const char> chardata) { \ | 555 | 318 | const auto c = \ | 556 | 318 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 318 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 318 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 318 | &I::lenfunc, &I::conversionfunc, \ | 560 | 318 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 318 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 318 | c.fuzz(chardata); \ | 563 | 318 | } \ |
conversion.cpp:populate_functions()::$_32::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()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 432 | +[](std::span<const char> chardata) { \ | 555 | 432 | const auto c = \ | 556 | 432 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 432 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 432 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 432 | &I::lenfunc, &I::conversionfunc, \ | 560 | 432 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 432 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 432 | c.fuzz(chardata); \ | 563 | 432 | } \ |
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 326 | +[](std::span<const char> chardata) { \ | 555 | 326 | const auto c = \ | 556 | 326 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 326 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 326 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 326 | &I::lenfunc, &I::conversionfunc, \ | 560 | 326 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 326 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 326 | c.fuzz(chardata); \ | 563 | 326 | } \ |
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 413 | +[](std::span<const char> chardata) { \ | 555 | 413 | const auto c = \ | 556 | 413 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 413 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 413 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 413 | &I::lenfunc, &I::conversionfunc, \ | 560 | 413 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 413 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 413 | c.fuzz(chardata); \ | 563 | 413 | } \ |
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 295 | +[](std::span<const char> chardata) { \ | 555 | 295 | const auto c = \ | 556 | 295 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 295 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 295 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 295 | &I::lenfunc, &I::conversionfunc, \ | 560 | 295 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 295 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 295 | c.fuzz(chardata); \ | 563 | 295 | } \ |
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 404 | +[](std::span<const char> chardata) { \ | 555 | 404 | const auto c = \ | 556 | 404 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 404 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 404 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 404 | &I::lenfunc, &I::conversionfunc, \ | 560 | 404 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 404 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 404 | c.fuzz(chardata); \ | 563 | 404 | } \ |
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 53 | +[](std::span<const char> chardata) { \ | 555 | 53 | const auto c = \ | 556 | 53 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 53 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 53 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 53 | &I::lenfunc, &I::conversionfunc, \ | 560 | 53 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 53 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 53 | c.fuzz(chardata); \ | 563 | 53 | } \ |
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 45 | +[](std::span<const char> chardata) { \ | 555 | 45 | const auto c = \ | 556 | 45 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 45 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 45 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 45 | &I::lenfunc, &I::conversionfunc, \ | 560 | 45 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 45 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 45 | c.fuzz(chardata); \ | 563 | 45 | } \ |
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 42 | +[](std::span<const char> chardata) { \ | 555 | 42 | const auto c = \ | 556 | 42 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 42 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 42 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 42 | &I::lenfunc, &I::conversionfunc, \ | 560 | 42 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 42 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 42 | c.fuzz(chardata); \ | 563 | 42 | } \ |
conversion.cpp:populate_functions()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const Line | Count | Source | 554 | 270 | +[](std::span<const char> chardata) { \ | 555 | 270 | const auto c = \ | 556 | 270 | Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc), \ | 557 | 270 | ENCODING_TO_CONVERSION_NAME(&I::conversionfunc), \ | 558 | 270 | decltype(&I::lenfunc), decltype(&I::conversionfunc)>{ \ | 559 | 270 | &I::lenfunc, &I::conversionfunc, \ | 560 | 270 | std::string{NAMEOF(&I::lenfunc)}, \ | 561 | 270 | std::string{NAMEOF(&I::conversionfunc)}}; \ | 562 | 270 | c.fuzz(chardata); \ | 563 | 270 | } \ |
|
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.34k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
640 | 9.34k | static const auto fptrs = populate_functions(); |
641 | 9.34k | 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.34k | if (size < 4) { |
647 | 3 | return 0; |
648 | 3 | } |
649 | | |
650 | 9.34k | constexpr auto actionmask = std::bit_ceil(Ncases) - 1; |
651 | 9.34k | const auto action = data[0] & actionmask; |
652 | 9.34k | data += 4; |
653 | 9.34k | size -= 4; |
654 | | |
655 | 9.34k | if (action >= Ncases) { |
656 | 1 | return 0; |
657 | 1 | } |
658 | | |
659 | 9.34k | if constexpr (use_separate_allocation) { |
660 | | // this is better at excercising null input and catch buffer underflows |
661 | 9.34k | const std::vector<char> separate{data, data + size}; |
662 | 9.34k | 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.34k | return 0; |
669 | 9.34k | } |