Coverage Report

Created: 2026-02-14 06:56

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
8.87k
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
8.87k
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
8.87k
                        chardata.size() / sizeof(FromType)};
179
180
8.87k
    static const bool do_print_testcase =
181
8.87k
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
8.87k
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
8.87k
    do {
189
      // step 0 - is the input valid?
190
8.87k
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
8.87k
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
5.93k
                    From == UtfEncodings::UTF8) {
198
5.93k
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
5.93k
      }
201
202
      // step 2 - what is the required size of the output?
203
5.93k
      const auto [output_length, length_agree] =
204
8.87k
          calculate_length(from, inputisvalid);
205
8.87k
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
8.87k
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
86
        return;
211
86
      }
212
213
      // step 3 - run the conversion
214
8.78k
      const auto [written, outputs_agree] =
215
8.78k
          do_conversion(from, output_length, inputisvalid);
216
8.78k
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
8.78k
      return;
221
8.78k
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
8.87k
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
226
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
226
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
226
                        chardata.size() / sizeof(FromType)};
179
180
226
    static const bool do_print_testcase =
181
226
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
226
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
226
    do {
189
      // step 0 - is the input valid?
190
226
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
226
      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
226
                    From == UtfEncodings::UTF8) {
198
226
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
226
      }
201
202
      // step 2 - what is the required size of the output?
203
226
      const auto [output_length, length_agree] =
204
226
          calculate_length(from, inputisvalid);
205
226
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
226
      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
204
      const auto [written, outputs_agree] =
215
204
          do_conversion(from, output_length, inputisvalid);
216
204
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
204
      return;
221
204
    } 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
226
  }
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
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
9
        return;
211
9
      }
212
213
      // step 3 - run the conversion
214
343
      const auto [written, outputs_agree] =
215
343
          do_conversion(from, output_length, inputisvalid);
216
343
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
343
      return;
221
343
    } 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)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
230
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
230
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
230
                        chardata.size() / sizeof(FromType)};
179
180
230
    static const bool do_print_testcase =
181
230
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
230
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
230
    do {
189
      // step 0 - is the input valid?
190
230
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
230
      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
230
                    From == UtfEncodings::UTF8) {
198
230
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
230
      }
201
202
      // step 2 - what is the required size of the output?
203
230
      const auto [output_length, length_agree] =
204
230
          calculate_length(from, inputisvalid);
205
230
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
230
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
7
        return;
211
7
      }
212
213
      // step 3 - run the conversion
214
223
      const auto [written, outputs_agree] =
215
223
          do_conversion(from, output_length, inputisvalid);
216
223
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
223
      return;
221
223
    } 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
230
  }
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
442
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
442
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
442
                        chardata.size() / sizeof(FromType)};
179
180
442
    static const bool do_print_testcase =
181
442
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
442
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
442
    do {
189
      // step 0 - is the input valid?
190
442
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
442
      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
442
                    From == UtfEncodings::UTF8) {
198
442
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
442
      }
201
202
      // step 2 - what is the required size of the output?
203
442
      const auto [output_length, length_agree] =
204
442
          calculate_length(from, inputisvalid);
205
442
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
442
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
14
        return;
211
14
      }
212
213
      // step 3 - run the conversion
214
428
      const auto [written, outputs_agree] =
215
428
          do_conversion(from, output_length, inputisvalid);
216
428
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
428
      return;
221
428
    } 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
442
  }
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
306
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
306
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
306
                        chardata.size() / sizeof(FromType)};
179
180
306
    static const bool do_print_testcase =
181
306
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
306
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
306
    do {
189
      // step 0 - is the input valid?
190
306
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
306
      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
306
      const auto [output_length, length_agree] =
204
306
          calculate_length(from, inputisvalid);
205
306
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
306
      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
301
      const auto [written, outputs_agree] =
215
301
          do_conversion(from, output_length, inputisvalid);
216
301
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
301
      return;
221
301
    } 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
306
  }
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
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
                    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
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
3
        return;
211
3
      }
212
213
      // step 3 - run the conversion
214
395
      const auto [written, outputs_agree] =
215
395
          do_conversion(from, output_length, inputisvalid);
216
395
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
395
      return;
221
395
    } 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)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
469
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
469
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
469
                        chardata.size() / sizeof(FromType)};
179
180
469
    static const bool do_print_testcase =
181
469
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
469
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
469
    do {
189
      // step 0 - is the input valid?
190
469
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
469
      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
469
      const auto [output_length, length_agree] =
204
469
          calculate_length(from, inputisvalid);
205
469
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
469
      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
467
      const auto [written, outputs_agree] =
215
467
          do_conversion(from, output_length, inputisvalid);
216
467
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
467
      return;
221
467
    } 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
469
  }
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
613
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
613
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
613
                        chardata.size() / sizeof(FromType)};
179
180
613
    static const bool do_print_testcase =
181
613
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
613
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
613
    do {
189
      // step 0 - is the input valid?
190
613
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
613
      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
613
                    From == UtfEncodings::UTF8) {
198
613
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
613
      }
201
202
      // step 2 - what is the required size of the output?
203
613
      const auto [output_length, length_agree] =
204
613
          calculate_length(from, inputisvalid);
205
613
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
613
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
9
        return;
211
9
      }
212
213
      // step 3 - run the conversion
214
604
      const auto [written, outputs_agree] =
215
604
          do_conversion(from, output_length, inputisvalid);
216
604
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
604
      return;
221
604
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
613
  }
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
577
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
577
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
577
                        chardata.size() / sizeof(FromType)};
179
180
577
    static const bool do_print_testcase =
181
577
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
577
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
577
    do {
189
      // step 0 - is the input valid?
190
577
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
577
      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
577
                    From == UtfEncodings::UTF8) {
198
577
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
577
      }
201
202
      // step 2 - what is the required size of the output?
203
577
      const auto [output_length, length_agree] =
204
577
          calculate_length(from, inputisvalid);
205
577
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
577
      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
573
      const auto [written, outputs_agree] =
215
573
          do_conversion(from, output_length, inputisvalid);
216
573
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
573
      return;
221
573
    } 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
577
  }
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
567
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
567
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
567
                        chardata.size() / sizeof(FromType)};
179
180
567
    static const bool do_print_testcase =
181
567
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
567
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
567
    do {
189
      // step 0 - is the input valid?
190
567
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
567
      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
567
                    From == UtfEncodings::UTF8) {
198
567
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
567
      }
201
202
      // step 2 - what is the required size of the output?
203
567
      const auto [output_length, length_agree] =
204
567
          calculate_length(from, inputisvalid);
205
567
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
567
      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
556
      const auto [written, outputs_agree] =
215
556
          do_conversion(from, output_length, inputisvalid);
216
556
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
556
      return;
221
556
    } 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
567
  }
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
57
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
57
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
57
                        chardata.size() / sizeof(FromType)};
179
180
57
    static const bool do_print_testcase =
181
57
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
57
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
57
    do {
189
      // step 0 - is the input valid?
190
57
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
57
      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
57
                    From == UtfEncodings::UTF8) {
198
57
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
57
      }
201
202
      // step 2 - what is the required size of the output?
203
57
      const auto [output_length, length_agree] =
204
57
          calculate_length(from, inputisvalid);
205
57
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
57
      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
57
      const auto [written, outputs_agree] =
215
57
          do_conversion(from, output_length, inputisvalid);
216
57
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
57
      return;
221
57
    } 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
57
  }
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
73
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
73
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
73
                        chardata.size() / sizeof(FromType)};
179
180
73
    static const bool do_print_testcase =
181
73
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
73
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
73
    do {
189
      // step 0 - is the input valid?
190
73
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
73
      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
73
                    From == UtfEncodings::UTF8) {
198
73
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
73
      }
201
202
      // step 2 - what is the required size of the output?
203
73
      const auto [output_length, length_agree] =
204
73
          calculate_length(from, inputisvalid);
205
73
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
73
      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
73
      const auto [written, outputs_agree] =
215
73
          do_conversion(from, output_length, inputisvalid);
216
73
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
73
      return;
221
73
    } 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
73
  }
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
87
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
87
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
87
                        chardata.size() / sizeof(FromType)};
179
180
87
    static const bool do_print_testcase =
181
87
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
87
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
87
    do {
189
      // step 0 - is the input valid?
190
87
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
87
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    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
87
      const auto [output_length, length_agree] =
204
87
          calculate_length(from, inputisvalid);
205
87
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
87
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
87
      const auto [written, outputs_agree] =
215
87
          do_conversion(from, output_length, inputisvalid);
216
87
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
87
      return;
221
87
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
87
  }
Conversion<(UtfEncodings)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
275
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
275
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
275
                        chardata.size() / sizeof(FromType)};
179
180
275
    static const bool do_print_testcase =
181
275
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
275
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
275
    do {
189
      // step 0 - is the input valid?
190
275
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
275
      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
275
                    From == UtfEncodings::UTF8) {
198
275
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
275
      }
201
202
      // step 2 - what is the required size of the output?
203
275
      const auto [output_length, length_agree] =
204
275
          calculate_length(from, inputisvalid);
205
275
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
275
      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
275
      const auto [written, outputs_agree] =
215
275
          do_conversion(from, output_length, inputisvalid);
216
275
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
275
      return;
221
275
    } 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
275
  }
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
127
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
127
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
127
                        chardata.size() / sizeof(FromType)};
179
180
127
    static const bool do_print_testcase =
181
127
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
127
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
127
    do {
189
      // step 0 - is the input valid?
190
127
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
127
      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
127
                    From == UtfEncodings::UTF8) {
198
127
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
127
      }
201
202
      // step 2 - what is the required size of the output?
203
127
      const auto [output_length, length_agree] =
204
127
          calculate_length(from, inputisvalid);
205
127
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
127
      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
127
      const auto [written, outputs_agree] =
215
127
          do_conversion(from, output_length, inputisvalid);
216
127
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
127
      return;
221
127
    } 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
127
  }
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
179
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
179
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
179
                        chardata.size() / sizeof(FromType)};
179
180
179
    static const bool do_print_testcase =
181
179
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
179
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
179
    do {
189
      // step 0 - is the input valid?
190
179
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
179
      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
179
                    From == UtfEncodings::UTF8) {
198
179
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
179
      }
201
202
      // step 2 - what is the required size of the output?
203
179
      const auto [output_length, length_agree] =
204
179
          calculate_length(from, inputisvalid);
205
179
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
179
      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
179
      const auto [written, outputs_agree] =
215
179
          do_conversion(from, output_length, inputisvalid);
216
179
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
179
      return;
221
179
    } 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
179
  }
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
347
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
347
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
347
                        chardata.size() / sizeof(FromType)};
179
180
347
    static const bool do_print_testcase =
181
347
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
347
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
347
    do {
189
      // step 0 - is the input valid?
190
347
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
347
      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
347
                    From == UtfEncodings::UTF8) {
198
347
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
347
      }
201
202
      // step 2 - what is the required size of the output?
203
347
      const auto [output_length, length_agree] =
204
347
          calculate_length(from, inputisvalid);
205
347
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
347
      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
347
      const auto [written, outputs_agree] =
215
347
          do_conversion(from, output_length, inputisvalid);
216
347
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
347
      return;
221
347
    } 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
347
  }
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
134
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
134
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
134
                        chardata.size() / sizeof(FromType)};
179
180
134
    static const bool do_print_testcase =
181
134
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
134
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
134
    do {
189
      // step 0 - is the input valid?
190
134
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
134
      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
134
                    From == UtfEncodings::UTF8) {
198
134
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
134
      }
201
202
      // step 2 - what is the required size of the output?
203
134
      const auto [output_length, length_agree] =
204
134
          calculate_length(from, inputisvalid);
205
134
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
134
      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
134
      const auto [written, outputs_agree] =
215
134
          do_conversion(from, output_length, inputisvalid);
216
134
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
134
      return;
221
134
    } 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
134
  }
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
168
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
168
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
168
                        chardata.size() / sizeof(FromType)};
179
180
168
    static const bool do_print_testcase =
181
168
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
168
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
168
    do {
189
      // step 0 - is the input valid?
190
168
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
168
      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
168
                    From == UtfEncodings::UTF8) {
198
168
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
168
      }
201
202
      // step 2 - what is the required size of the output?
203
168
      const auto [output_length, length_agree] =
204
168
          calculate_length(from, inputisvalid);
205
168
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
168
      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
168
      const auto [written, outputs_agree] =
215
168
          do_conversion(from, output_length, inputisvalid);
216
168
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
168
      return;
221
168
    } 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
168
  }
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
309
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
309
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
309
                        chardata.size() / sizeof(FromType)};
179
180
309
    static const bool do_print_testcase =
181
309
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
309
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
309
    do {
189
      // step 0 - is the input valid?
190
309
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
309
      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
309
                    From == UtfEncodings::UTF8) {
198
309
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
309
      }
201
202
      // step 2 - what is the required size of the output?
203
309
      const auto [output_length, length_agree] =
204
309
          calculate_length(from, inputisvalid);
205
309
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
309
      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
309
      const auto [written, outputs_agree] =
215
309
          do_conversion(from, output_length, inputisvalid);
216
309
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
309
      return;
221
309
    } 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
309
  }
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
213
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
213
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
213
                        chardata.size() / sizeof(FromType)};
179
180
213
    static const bool do_print_testcase =
181
213
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
213
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
213
    do {
189
      // step 0 - is the input valid?
190
213
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
213
      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
213
      const auto [output_length, length_agree] =
204
213
          calculate_length(from, inputisvalid);
205
213
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
213
      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
213
      const auto [written, outputs_agree] =
215
213
          do_conversion(from, output_length, inputisvalid);
216
213
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
213
      return;
221
213
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
213
  }
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
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)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
353
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
353
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
353
                        chardata.size() / sizeof(FromType)};
179
180
353
    static const bool do_print_testcase =
181
353
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
353
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
353
    do {
189
      // step 0 - is the input valid?
190
353
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
353
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    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
353
      const auto [output_length, length_agree] =
204
353
          calculate_length(from, inputisvalid);
205
353
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
353
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
353
      const auto [written, outputs_agree] =
215
353
          do_conversion(from, output_length, inputisvalid);
216
353
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
353
      return;
221
353
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
353
  }
Conversion<(UtfEncodings)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
361
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
361
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
361
                        chardata.size() / sizeof(FromType)};
179
180
361
    static const bool do_print_testcase =
181
361
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
361
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
361
    do {
189
      // step 0 - is the input valid?
190
361
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
361
      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
361
      const auto [output_length, length_agree] =
204
361
          calculate_length(from, inputisvalid);
205
361
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
361
      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
361
      const auto [written, outputs_agree] =
215
361
          do_conversion(from, output_length, inputisvalid);
216
361
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
361
      return;
221
361
    } 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
361
  }
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
239
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
239
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
239
                        chardata.size() / sizeof(FromType)};
179
180
239
    static const bool do_print_testcase =
181
239
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
239
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
239
    do {
189
      // step 0 - is the input valid?
190
239
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
239
      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
239
                    From == UtfEncodings::UTF8) {
198
239
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
239
      }
201
202
      // step 2 - what is the required size of the output?
203
239
      const auto [output_length, length_agree] =
204
239
          calculate_length(from, inputisvalid);
205
239
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
239
      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
239
      const auto [written, outputs_agree] =
215
239
          do_conversion(from, output_length, inputisvalid);
216
239
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
239
      return;
221
239
    } 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
239
  }
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
373
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
373
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
373
                        chardata.size() / sizeof(FromType)};
179
180
373
    static const bool do_print_testcase =
181
373
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
373
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
373
    do {
189
      // step 0 - is the input valid?
190
373
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
373
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
373
                    From == UtfEncodings::UTF8) {
198
373
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
373
      }
201
202
      // step 2 - what is the required size of the output?
203
373
      const auto [output_length, length_agree] =
204
373
          calculate_length(from, inputisvalid);
205
373
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
373
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
373
      const auto [written, outputs_agree] =
215
373
          do_conversion(from, output_length, inputisvalid);
216
373
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
373
      return;
221
373
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
373
  }
Conversion<(UtfEncodings)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
299
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
299
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
299
                        chardata.size() / sizeof(FromType)};
179
180
299
    static const bool do_print_testcase =
181
299
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
299
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
299
    do {
189
      // step 0 - is the input valid?
190
299
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
299
      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
299
                    From == UtfEncodings::UTF8) {
198
299
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
299
      }
201
202
      // step 2 - what is the required size of the output?
203
299
      const auto [output_length, length_agree] =
204
299
          calculate_length(from, inputisvalid);
205
299
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
299
      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
299
      const auto [written, outputs_agree] =
215
299
          do_conversion(from, output_length, inputisvalid);
216
299
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
299
      return;
221
299
    } 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
299
  }
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
348
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
348
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
348
                        chardata.size() / sizeof(FromType)};
179
180
348
    static const bool do_print_testcase =
181
348
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
348
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
348
    do {
189
      // step 0 - is the input valid?
190
348
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
348
      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
348
                    From == UtfEncodings::UTF8) {
198
348
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
348
      }
201
202
      // step 2 - what is the required size of the output?
203
348
      const auto [output_length, length_agree] =
204
348
          calculate_length(from, inputisvalid);
205
348
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
348
      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
348
      const auto [written, outputs_agree] =
215
348
          do_conversion(from, output_length, inputisvalid);
216
348
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
348
      return;
221
348
    } 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
348
  }
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
50
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
50
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
50
                        chardata.size() / sizeof(FromType)};
179
180
50
    static const bool do_print_testcase =
181
50
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
50
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
50
    do {
189
      // step 0 - is the input valid?
190
50
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
50
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    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
50
      const auto [output_length, length_agree] =
204
50
          calculate_length(from, inputisvalid);
205
50
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
50
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
50
      const auto [written, outputs_agree] =
215
50
          do_conversion(from, output_length, inputisvalid);
216
50
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
50
      return;
221
50
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
50
  }
Conversion<(UtfEncodings)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
50
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
50
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
50
                        chardata.size() / sizeof(FromType)};
179
180
50
    static const bool do_print_testcase =
181
50
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
50
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
50
    do {
189
      // step 0 - is the input valid?
190
50
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
50
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    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
50
      const auto [output_length, length_agree] =
204
50
          calculate_length(from, inputisvalid);
205
50
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
50
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
50
      const auto [written, outputs_agree] =
215
50
          do_conversion(from, output_length, inputisvalid);
216
50
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
50
      return;
221
50
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
50
  }
Conversion<(UtfEncodings)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
36
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
36
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
36
                        chardata.size() / sizeof(FromType)};
179
180
36
    static const bool do_print_testcase =
181
36
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
36
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
36
    do {
189
      // step 0 - is the input valid?
190
36
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
36
      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
36
      const auto [output_length, length_agree] =
204
36
          calculate_length(from, inputisvalid);
205
36
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
36
      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
36
      const auto [written, outputs_agree] =
215
36
          do_conversion(from, output_length, inputisvalid);
216
36
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
36
      return;
221
36
    } 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
36
  }
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
278
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
278
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
278
                        chardata.size() / sizeof(FromType)};
179
180
278
    static const bool do_print_testcase =
181
278
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
278
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
278
    do {
189
      // step 0 - is the input valid?
190
278
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
278
      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
278
      const auto [output_length, length_agree] =
204
278
          calculate_length(from, inputisvalid);
205
278
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
278
      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
278
      const auto [written, outputs_agree] =
215
278
          do_conversion(from, output_length, inputisvalid);
216
278
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
278
      return;
221
278
    } 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
278
  }
227
228
  template <typename Dummy = void>
229
    requires(From != UtfEncodings::LATIN1)
230
8.45k
  validation_result verify_valid_input(FromSpan src) const {
231
8.45k
    validation_result ret{};
232
233
8.45k
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
8.45k
    const auto implementations = get_supported_implementations();
235
8.45k
    std::vector<simdutf::result> results;
236
8.45k
    results.reserve(implementations.size());
237
238
25.3k
    for (auto impl : implementations) {
239
25.3k
      results.push_back(
240
25.3k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
25.3k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
25.3k
      const bool validation2 =
245
25.3k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
25.3k
                      src.data(), src.size());
247
25.3k
      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
25.3k
    }
258
259
16.9k
    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
452
    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
704
    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
460
    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
884
    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
612
    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
796
    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
938
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
1.22k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
1.15k
    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.13k
    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
114
    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
146
    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
174
    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
550
    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
254
    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
358
    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
694
    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
268
    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
336
    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
618
    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
426
    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
670
    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
706
    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
722
    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
478
    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
746
    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
598
    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
696
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
8.45k
    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.45k
    } else {
273
8.45k
      ret.implementations_agree = true;
274
8.45k
    }
275
16.7k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
16.7k
      return r.error == simdutf::SUCCESS;
277
16.7k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
474
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
474
      return r.error == simdutf::SUCCESS;
277
474
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
900
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
900
      return r.error == simdutf::SUCCESS;
277
900
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
486
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
486
      return r.error == simdutf::SUCCESS;
277
486
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.10k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.10k
      return r.error == simdutf::SUCCESS;
277
1.10k
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
570
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
570
      return r.error == simdutf::SUCCESS;
277
570
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
826
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
826
      return r.error == simdutf::SUCCESS;
277
826
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
785
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
785
      return r.error == simdutf::SUCCESS;
277
785
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.28k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.28k
      return r.error == simdutf::SUCCESS;
277
1.28k
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.19k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.19k
      return r.error == simdutf::SUCCESS;
277
1.19k
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.19k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.19k
      return r.error == simdutf::SUCCESS;
277
1.19k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
155
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
155
      return r.error == simdutf::SUCCESS;
277
155
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
173
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
173
      return r.error == simdutf::SUCCESS;
277
173
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
139
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
139
      return r.error == simdutf::SUCCESS;
277
139
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
453
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
453
      return r.error == simdutf::SUCCESS;
277
453
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
311
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
311
      return r.error == simdutf::SUCCESS;
277
311
    });
_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
745
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
745
      return r.error == simdutf::SUCCESS;
277
745
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
346
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
346
      return r.error == simdutf::SUCCESS;
277
346
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
322
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
322
      return r.error == simdutf::SUCCESS;
277
322
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
691
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
691
      return r.error == simdutf::SUCCESS;
277
691
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
269
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
269
      return r.error == simdutf::SUCCESS;
277
269
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
503
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
503
      return r.error == simdutf::SUCCESS;
277
503
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
529
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
529
      return r.error == simdutf::SUCCESS;
277
529
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
543
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
543
      return r.error == simdutf::SUCCESS;
277
543
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
455
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
455
      return r.error == simdutf::SUCCESS;
277
455
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
709
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
709
      return r.error == simdutf::SUCCESS;
277
709
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
543
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
543
      return r.error == simdutf::SUCCESS;
277
543
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
682
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
682
      return r.error == simdutf::SUCCESS;
277
682
    });
278
8.45k
    return ret;
279
8.45k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
226
  validation_result verify_valid_input(FromSpan src) const {
231
226
    validation_result ret{};
232
233
226
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
226
    const auto implementations = get_supported_implementations();
235
226
    std::vector<simdutf::result> results;
236
226
    results.reserve(implementations.size());
237
238
678
    for (auto impl : implementations) {
239
678
      results.push_back(
240
678
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
678
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
678
      const bool validation2 =
245
678
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
678
                      src.data(), src.size());
247
678
      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
678
    }
258
259
226
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
226
    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
226
    } else {
273
226
      ret.implementations_agree = true;
274
226
    }
275
226
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
226
      return r.error == simdutf::SUCCESS;
277
226
    });
278
226
    return ret;
279
226
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_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
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
230
  validation_result verify_valid_input(FromSpan src) const {
231
230
    validation_result ret{};
232
233
230
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
230
    const auto implementations = get_supported_implementations();
235
230
    std::vector<simdutf::result> results;
236
230
    results.reserve(implementations.size());
237
238
690
    for (auto impl : implementations) {
239
690
      results.push_back(
240
690
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
690
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
690
      const bool validation2 =
245
690
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
690
                      src.data(), src.size());
247
690
      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
690
    }
258
259
230
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
230
    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
230
    } else {
273
230
      ret.implementations_agree = true;
274
230
    }
275
230
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
230
      return r.error == simdutf::SUCCESS;
277
230
    });
278
230
    return ret;
279
230
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
442
  validation_result verify_valid_input(FromSpan src) const {
231
442
    validation_result ret{};
232
233
442
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
442
    const auto implementations = get_supported_implementations();
235
442
    std::vector<simdutf::result> results;
236
442
    results.reserve(implementations.size());
237
238
1.32k
    for (auto impl : implementations) {
239
1.32k
      results.push_back(
240
1.32k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.32k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.32k
      const bool validation2 =
245
1.32k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.32k
                      src.data(), src.size());
247
1.32k
      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.32k
    }
258
259
442
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
442
    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
442
    } else {
273
442
      ret.implementations_agree = true;
274
442
    }
275
442
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
442
      return r.error == simdutf::SUCCESS;
277
442
    });
278
442
    return ret;
279
442
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
306
  validation_result verify_valid_input(FromSpan src) const {
231
306
    validation_result ret{};
232
233
306
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
306
    const auto implementations = get_supported_implementations();
235
306
    std::vector<simdutf::result> results;
236
306
    results.reserve(implementations.size());
237
238
918
    for (auto impl : implementations) {
239
918
      results.push_back(
240
918
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
918
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
918
      const bool validation2 =
245
918
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
918
                      src.data(), src.size());
247
918
      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
918
    }
258
259
306
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
306
    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
306
    } else {
273
306
      ret.implementations_agree = true;
274
306
    }
275
306
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
306
      return r.error == simdutf::SUCCESS;
277
306
    });
278
306
    return ret;
279
306
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_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_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
469
  validation_result verify_valid_input(FromSpan src) const {
231
469
    validation_result ret{};
232
233
469
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
469
    const auto implementations = get_supported_implementations();
235
469
    std::vector<simdutf::result> results;
236
469
    results.reserve(implementations.size());
237
238
1.40k
    for (auto impl : implementations) {
239
1.40k
      results.push_back(
240
1.40k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.40k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.40k
      const bool validation2 =
245
1.40k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.40k
                      src.data(), src.size());
247
1.40k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.40k
    }
258
259
469
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
469
    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
469
    } else {
273
469
      ret.implementations_agree = true;
274
469
    }
275
469
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
469
      return r.error == simdutf::SUCCESS;
277
469
    });
278
469
    return ret;
279
469
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
613
  validation_result verify_valid_input(FromSpan src) const {
231
613
    validation_result ret{};
232
233
613
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
613
    const auto implementations = get_supported_implementations();
235
613
    std::vector<simdutf::result> results;
236
613
    results.reserve(implementations.size());
237
238
1.83k
    for (auto impl : implementations) {
239
1.83k
      results.push_back(
240
1.83k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.83k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.83k
      const bool validation2 =
245
1.83k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.83k
                      src.data(), src.size());
247
1.83k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.83k
    }
258
259
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
613
    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
613
    } else {
273
613
      ret.implementations_agree = true;
274
613
    }
275
613
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
613
      return r.error == simdutf::SUCCESS;
277
613
    });
278
613
    return ret;
279
613
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
577
  validation_result verify_valid_input(FromSpan src) const {
231
577
    validation_result ret{};
232
233
577
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
577
    const auto implementations = get_supported_implementations();
235
577
    std::vector<simdutf::result> results;
236
577
    results.reserve(implementations.size());
237
238
1.73k
    for (auto impl : implementations) {
239
1.73k
      results.push_back(
240
1.73k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.73k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.73k
      const bool validation2 =
245
1.73k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.73k
                      src.data(), src.size());
247
1.73k
      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.73k
    }
258
259
577
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
577
    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
577
    } else {
273
577
      ret.implementations_agree = true;
274
577
    }
275
577
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
577
      return r.error == simdutf::SUCCESS;
277
577
    });
278
577
    return ret;
279
577
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
567
  validation_result verify_valid_input(FromSpan src) const {
231
567
    validation_result ret{};
232
233
567
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
567
    const auto implementations = get_supported_implementations();
235
567
    std::vector<simdutf::result> results;
236
567
    results.reserve(implementations.size());
237
238
1.70k
    for (auto impl : implementations) {
239
1.70k
      results.push_back(
240
1.70k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.70k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.70k
      const bool validation2 =
245
1.70k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.70k
                      src.data(), src.size());
247
1.70k
      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.70k
    }
258
259
567
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
567
    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
567
    } else {
273
567
      ret.implementations_agree = true;
274
567
    }
275
567
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
567
      return r.error == simdutf::SUCCESS;
277
567
    });
278
567
    return ret;
279
567
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
57
  validation_result verify_valid_input(FromSpan src) const {
231
57
    validation_result ret{};
232
233
57
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
57
    const auto implementations = get_supported_implementations();
235
57
    std::vector<simdutf::result> results;
236
57
    results.reserve(implementations.size());
237
238
171
    for (auto impl : implementations) {
239
171
      results.push_back(
240
171
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
171
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
171
      const bool validation2 =
245
171
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
171
                      src.data(), src.size());
247
171
      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
171
    }
258
259
57
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
57
    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
57
    } else {
273
57
      ret.implementations_agree = true;
274
57
    }
275
57
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
57
      return r.error == simdutf::SUCCESS;
277
57
    });
278
57
    return ret;
279
57
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
73
  validation_result verify_valid_input(FromSpan src) const {
231
73
    validation_result ret{};
232
233
73
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
73
    const auto implementations = get_supported_implementations();
235
73
    std::vector<simdutf::result> results;
236
73
    results.reserve(implementations.size());
237
238
219
    for (auto impl : implementations) {
239
219
      results.push_back(
240
219
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
219
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
219
      const bool validation2 =
245
219
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
219
                      src.data(), src.size());
247
219
      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
219
    }
258
259
73
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
73
    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
73
    } else {
273
73
      ret.implementations_agree = true;
274
73
    }
275
73
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
73
      return r.error == simdutf::SUCCESS;
277
73
    });
278
73
    return ret;
279
73
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
87
  validation_result verify_valid_input(FromSpan src) const {
231
87
    validation_result ret{};
232
233
87
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
87
    const auto implementations = get_supported_implementations();
235
87
    std::vector<simdutf::result> results;
236
87
    results.reserve(implementations.size());
237
238
261
    for (auto impl : implementations) {
239
261
      results.push_back(
240
261
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
261
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
261
      const bool validation2 =
245
261
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
261
                      src.data(), src.size());
247
261
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
261
    }
258
259
87
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
87
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
87
    } else {
273
87
      ret.implementations_agree = true;
274
87
    }
275
87
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
87
      return r.error == simdutf::SUCCESS;
277
87
    });
278
87
    return ret;
279
87
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
275
  validation_result verify_valid_input(FromSpan src) const {
231
275
    validation_result ret{};
232
233
275
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
275
    const auto implementations = get_supported_implementations();
235
275
    std::vector<simdutf::result> results;
236
275
    results.reserve(implementations.size());
237
238
825
    for (auto impl : implementations) {
239
825
      results.push_back(
240
825
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
825
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
825
      const bool validation2 =
245
825
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
825
                      src.data(), src.size());
247
825
      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
825
    }
258
259
275
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
275
    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
275
    } else {
273
275
      ret.implementations_agree = true;
274
275
    }
275
275
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
275
      return r.error == simdutf::SUCCESS;
277
275
    });
278
275
    return ret;
279
275
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
127
  validation_result verify_valid_input(FromSpan src) const {
231
127
    validation_result ret{};
232
233
127
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
127
    const auto implementations = get_supported_implementations();
235
127
    std::vector<simdutf::result> results;
236
127
    results.reserve(implementations.size());
237
238
381
    for (auto impl : implementations) {
239
381
      results.push_back(
240
381
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
381
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
381
      const bool validation2 =
245
381
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
381
                      src.data(), src.size());
247
381
      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
381
    }
258
259
127
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
127
    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
127
    } else {
273
127
      ret.implementations_agree = true;
274
127
    }
275
127
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
127
      return r.error == simdutf::SUCCESS;
277
127
    });
278
127
    return ret;
279
127
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
179
  validation_result verify_valid_input(FromSpan src) const {
231
179
    validation_result ret{};
232
233
179
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
179
    const auto implementations = get_supported_implementations();
235
179
    std::vector<simdutf::result> results;
236
179
    results.reserve(implementations.size());
237
238
537
    for (auto impl : implementations) {
239
537
      results.push_back(
240
537
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
537
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
537
      const bool validation2 =
245
537
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
537
                      src.data(), src.size());
247
537
      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
537
    }
258
259
179
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
179
    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
179
    } else {
273
179
      ret.implementations_agree = true;
274
179
    }
275
179
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
179
      return r.error == simdutf::SUCCESS;
277
179
    });
278
179
    return ret;
279
179
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
347
  validation_result verify_valid_input(FromSpan src) const {
231
347
    validation_result ret{};
232
233
347
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
347
    const auto implementations = get_supported_implementations();
235
347
    std::vector<simdutf::result> results;
236
347
    results.reserve(implementations.size());
237
238
1.04k
    for (auto impl : implementations) {
239
1.04k
      results.push_back(
240
1.04k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.04k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.04k
      const bool validation2 =
245
1.04k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.04k
                      src.data(), src.size());
247
1.04k
      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.04k
    }
258
259
347
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
347
    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
347
    } else {
273
347
      ret.implementations_agree = true;
274
347
    }
275
347
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
347
      return r.error == simdutf::SUCCESS;
277
347
    });
278
347
    return ret;
279
347
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
134
  validation_result verify_valid_input(FromSpan src) const {
231
134
    validation_result ret{};
232
233
134
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
134
    const auto implementations = get_supported_implementations();
235
134
    std::vector<simdutf::result> results;
236
134
    results.reserve(implementations.size());
237
238
402
    for (auto impl : implementations) {
239
402
      results.push_back(
240
402
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
402
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
402
      const bool validation2 =
245
402
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
402
                      src.data(), src.size());
247
402
      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
402
    }
258
259
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
134
    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
134
    } else {
273
134
      ret.implementations_agree = true;
274
134
    }
275
134
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
134
      return r.error == simdutf::SUCCESS;
277
134
    });
278
134
    return ret;
279
134
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
168
  validation_result verify_valid_input(FromSpan src) const {
231
168
    validation_result ret{};
232
233
168
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
168
    const auto implementations = get_supported_implementations();
235
168
    std::vector<simdutf::result> results;
236
168
    results.reserve(implementations.size());
237
238
504
    for (auto impl : implementations) {
239
504
      results.push_back(
240
504
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
504
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
504
      const bool validation2 =
245
504
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
504
                      src.data(), src.size());
247
504
      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
504
    }
258
259
168
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
168
    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
168
    } else {
273
168
      ret.implementations_agree = true;
274
168
    }
275
168
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
168
      return r.error == simdutf::SUCCESS;
277
168
    });
278
168
    return ret;
279
168
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
309
  validation_result verify_valid_input(FromSpan src) const {
231
309
    validation_result ret{};
232
233
309
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
309
    const auto implementations = get_supported_implementations();
235
309
    std::vector<simdutf::result> results;
236
309
    results.reserve(implementations.size());
237
238
927
    for (auto impl : implementations) {
239
927
      results.push_back(
240
927
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
927
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
927
      const bool validation2 =
245
927
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
927
                      src.data(), src.size());
247
927
      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
927
    }
258
259
309
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
309
    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
309
    } else {
273
309
      ret.implementations_agree = true;
274
309
    }
275
309
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
309
      return r.error == simdutf::SUCCESS;
277
309
    });
278
309
    return ret;
279
309
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
213
  validation_result verify_valid_input(FromSpan src) const {
231
213
    validation_result ret{};
232
233
213
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
213
    const auto implementations = get_supported_implementations();
235
213
    std::vector<simdutf::result> results;
236
213
    results.reserve(implementations.size());
237
238
639
    for (auto impl : implementations) {
239
639
      results.push_back(
240
639
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
639
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
639
      const bool validation2 =
245
639
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
639
                      src.data(), src.size());
247
639
      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
639
    }
258
259
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
213
    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
213
    } else {
273
213
      ret.implementations_agree = true;
274
213
    }
275
213
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
213
      return r.error == simdutf::SUCCESS;
277
213
    });
278
213
    return ret;
279
213
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_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_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
353
  validation_result verify_valid_input(FromSpan src) const {
231
353
    validation_result ret{};
232
233
353
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
353
    const auto implementations = get_supported_implementations();
235
353
    std::vector<simdutf::result> results;
236
353
    results.reserve(implementations.size());
237
238
1.05k
    for (auto impl : implementations) {
239
1.05k
      results.push_back(
240
1.05k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.05k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.05k
      const bool validation2 =
245
1.05k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.05k
                      src.data(), src.size());
247
1.05k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.05k
    }
258
259
353
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
353
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
353
    } else {
273
353
      ret.implementations_agree = true;
274
353
    }
275
353
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
353
      return r.error == simdutf::SUCCESS;
277
353
    });
278
353
    return ret;
279
353
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
361
  validation_result verify_valid_input(FromSpan src) const {
231
361
    validation_result ret{};
232
233
361
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
361
    const auto implementations = get_supported_implementations();
235
361
    std::vector<simdutf::result> results;
236
361
    results.reserve(implementations.size());
237
238
1.08k
    for (auto impl : implementations) {
239
1.08k
      results.push_back(
240
1.08k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.08k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.08k
      const bool validation2 =
245
1.08k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.08k
                      src.data(), src.size());
247
1.08k
      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.08k
    }
258
259
361
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
361
    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
361
    } else {
273
361
      ret.implementations_agree = true;
274
361
    }
275
361
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
361
      return r.error == simdutf::SUCCESS;
277
361
    });
278
361
    return ret;
279
361
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
239
  validation_result verify_valid_input(FromSpan src) const {
231
239
    validation_result ret{};
232
233
239
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
239
    const auto implementations = get_supported_implementations();
235
239
    std::vector<simdutf::result> results;
236
239
    results.reserve(implementations.size());
237
238
717
    for (auto impl : implementations) {
239
717
      results.push_back(
240
717
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
717
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
717
      const bool validation2 =
245
717
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
717
                      src.data(), src.size());
247
717
      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
717
    }
258
259
239
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
239
    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
239
    } else {
273
239
      ret.implementations_agree = true;
274
239
    }
275
239
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
239
      return r.error == simdutf::SUCCESS;
277
239
    });
278
239
    return ret;
279
239
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
373
  validation_result verify_valid_input(FromSpan src) const {
231
373
    validation_result ret{};
232
233
373
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
373
    const auto implementations = get_supported_implementations();
235
373
    std::vector<simdutf::result> results;
236
373
    results.reserve(implementations.size());
237
238
1.11k
    for (auto impl : implementations) {
239
1.11k
      results.push_back(
240
1.11k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.11k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.11k
      const bool validation2 =
245
1.11k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.11k
                      src.data(), src.size());
247
1.11k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.11k
    }
258
259
373
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
373
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
373
    } else {
273
373
      ret.implementations_agree = true;
274
373
    }
275
373
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
373
      return r.error == simdutf::SUCCESS;
277
373
    });
278
373
    return ret;
279
373
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
299
  validation_result verify_valid_input(FromSpan src) const {
231
299
    validation_result ret{};
232
233
299
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
299
    const auto implementations = get_supported_implementations();
235
299
    std::vector<simdutf::result> results;
236
299
    results.reserve(implementations.size());
237
238
897
    for (auto impl : implementations) {
239
897
      results.push_back(
240
897
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
897
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
897
      const bool validation2 =
245
897
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
897
                      src.data(), src.size());
247
897
      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
897
    }
258
259
299
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
299
    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
299
    } else {
273
299
      ret.implementations_agree = true;
274
299
    }
275
299
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
299
      return r.error == simdutf::SUCCESS;
277
299
    });
278
299
    return ret;
279
299
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
348
  validation_result verify_valid_input(FromSpan src) const {
231
348
    validation_result ret{};
232
233
348
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
348
    const auto implementations = get_supported_implementations();
235
348
    std::vector<simdutf::result> results;
236
348
    results.reserve(implementations.size());
237
238
1.04k
    for (auto impl : implementations) {
239
1.04k
      results.push_back(
240
1.04k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.04k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.04k
      const bool validation2 =
245
1.04k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.04k
                      src.data(), src.size());
247
1.04k
      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.04k
    }
258
259
348
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
348
    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
348
    } else {
273
348
      ret.implementations_agree = true;
274
348
    }
275
348
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
348
      return r.error == simdutf::SUCCESS;
277
348
    });
278
348
    return ret;
279
348
  }
280
281
  template <typename Dummy = void>
282
    requires(From == UtfEncodings::LATIN1)
283
414
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
414
    return validation_result{.valid = true, .implementations_agree = true};
287
414
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
50
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
50
    return validation_result{.valid = true, .implementations_agree = true};
287
50
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
50
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
50
    return validation_result{.valid = true, .implementations_agree = true};
287
50
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
36
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
36
    return validation_result{.valid = true, .implementations_agree = true};
287
36
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
283
278
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
278
    return validation_result{.valid = true, .implementations_agree = true};
287
278
  }
288
289
5.93k
  bool count_the_input(FromSpan src) const {
290
5.93k
    const auto implementations = get_supported_implementations();
291
5.93k
    std::vector<std::size_t> results;
292
5.93k
    results.reserve(implementations.size());
293
294
17.8k
    for (auto impl : implementations) {
295
17.8k
      std::size_t ret;
296
17.8k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
3.86k
        ret = impl->count_utf16be(src.data(), src.size());
298
4.06k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
4.06k
        ret = impl->count_utf16le(src.data(), src.size());
300
9.87k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
9.87k
        ret = impl->count_utf8(src.data(), src.size());
302
9.87k
      }
303
17.8k
      results.push_back(ret);
304
17.8k
    }
305
11.8k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
452
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
704
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
460
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
884
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.22k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.15k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.13k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
114
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
146
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
550
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
254
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
694
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
268
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
336
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
618
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
478
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
746
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
598
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
696
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
5.93k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
5.93k
    return true;
321
5.93k
  }
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
226
  bool count_the_input(FromSpan src) const {
290
226
    const auto implementations = get_supported_implementations();
291
226
    std::vector<std::size_t> results;
292
226
    results.reserve(implementations.size());
293
294
678
    for (auto impl : implementations) {
295
678
      std::size_t ret;
296
678
      if constexpr (From == UtfEncodings::UTF16BE) {
297
678
        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
678
      results.push_back(ret);
304
678
    }
305
226
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
226
    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
226
    return true;
321
226
  }
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
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
1.05k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.05k
        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.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)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
230
  bool count_the_input(FromSpan src) const {
290
230
    const auto implementations = get_supported_implementations();
291
230
    std::vector<std::size_t> results;
292
230
    results.reserve(implementations.size());
293
294
690
    for (auto impl : implementations) {
295
690
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
690
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
690
        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
690
      results.push_back(ret);
304
690
    }
305
230
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
230
    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
230
    return true;
321
230
  }
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
442
  bool count_the_input(FromSpan src) const {
290
442
    const auto implementations = get_supported_implementations();
291
442
    std::vector<std::size_t> results;
292
442
    results.reserve(implementations.size());
293
294
1.32k
    for (auto impl : implementations) {
295
1.32k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
1.32k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
1.32k
        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.32k
      results.push_back(ret);
304
1.32k
    }
305
442
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
442
    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
442
    return true;
321
442
  }
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
613
  bool count_the_input(FromSpan src) const {
290
613
    const auto implementations = get_supported_implementations();
291
613
    std::vector<std::size_t> results;
292
613
    results.reserve(implementations.size());
293
294
1.83k
    for (auto impl : implementations) {
295
1.83k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.83k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.83k
        ret = impl->count_utf8(src.data(), src.size());
302
1.83k
      }
303
1.83k
      results.push_back(ret);
304
1.83k
    }
305
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
613
    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
613
    return true;
321
613
  }
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
577
  bool count_the_input(FromSpan src) const {
290
577
    const auto implementations = get_supported_implementations();
291
577
    std::vector<std::size_t> results;
292
577
    results.reserve(implementations.size());
293
294
1.73k
    for (auto impl : implementations) {
295
1.73k
      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.73k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.73k
        ret = impl->count_utf8(src.data(), src.size());
302
1.73k
      }
303
1.73k
      results.push_back(ret);
304
1.73k
    }
305
577
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
577
    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
577
    return true;
321
577
  }
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
567
  bool count_the_input(FromSpan src) const {
290
567
    const auto implementations = get_supported_implementations();
291
567
    std::vector<std::size_t> results;
292
567
    results.reserve(implementations.size());
293
294
1.70k
    for (auto impl : implementations) {
295
1.70k
      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.70k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.70k
        ret = impl->count_utf8(src.data(), src.size());
302
1.70k
      }
303
1.70k
      results.push_back(ret);
304
1.70k
    }
305
567
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
567
    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
567
    return true;
321
567
  }
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
57
  bool count_the_input(FromSpan src) const {
290
57
    const auto implementations = get_supported_implementations();
291
57
    std::vector<std::size_t> results;
292
57
    results.reserve(implementations.size());
293
294
171
    for (auto impl : implementations) {
295
171
      std::size_t ret;
296
171
      if constexpr (From == UtfEncodings::UTF16BE) {
297
171
        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
171
      results.push_back(ret);
304
171
    }
305
57
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
57
    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
57
    return true;
321
57
  }
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
73
  bool count_the_input(FromSpan src) const {
290
73
    const auto implementations = get_supported_implementations();
291
73
    std::vector<std::size_t> results;
292
73
    results.reserve(implementations.size());
293
294
219
    for (auto impl : implementations) {
295
219
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
219
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
219
        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
219
      results.push_back(ret);
304
219
    }
305
73
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
73
    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
73
    return true;
321
73
  }
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
275
  bool count_the_input(FromSpan src) const {
290
275
    const auto implementations = get_supported_implementations();
291
275
    std::vector<std::size_t> results;
292
275
    results.reserve(implementations.size());
293
294
825
    for (auto impl : implementations) {
295
825
      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
825
      } else if constexpr (From == UtfEncodings::UTF8) {
301
825
        ret = impl->count_utf8(src.data(), src.size());
302
825
      }
303
825
      results.push_back(ret);
304
825
    }
305
275
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
275
    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
275
    return true;
321
275
  }
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
127
  bool count_the_input(FromSpan src) const {
290
127
    const auto implementations = get_supported_implementations();
291
127
    std::vector<std::size_t> results;
292
127
    results.reserve(implementations.size());
293
294
381
    for (auto impl : implementations) {
295
381
      std::size_t ret;
296
381
      if constexpr (From == UtfEncodings::UTF16BE) {
297
381
        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
381
      results.push_back(ret);
304
381
    }
305
127
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
127
    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
127
    return true;
321
127
  }
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
179
  bool count_the_input(FromSpan src) const {
290
179
    const auto implementations = get_supported_implementations();
291
179
    std::vector<std::size_t> results;
292
179
    results.reserve(implementations.size());
293
294
537
    for (auto impl : implementations) {
295
537
      std::size_t ret;
296
537
      if constexpr (From == UtfEncodings::UTF16BE) {
297
537
        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
537
      results.push_back(ret);
304
537
    }
305
179
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
179
    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
179
    return true;
321
179
  }
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
347
  bool count_the_input(FromSpan src) const {
290
347
    const auto implementations = get_supported_implementations();
291
347
    std::vector<std::size_t> results;
292
347
    results.reserve(implementations.size());
293
294
1.04k
    for (auto impl : implementations) {
295
1.04k
      std::size_t ret;
296
1.04k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.04k
        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.04k
      results.push_back(ret);
304
1.04k
    }
305
347
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
347
    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
347
    return true;
321
347
  }
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
134
  bool count_the_input(FromSpan src) const {
290
134
    const auto implementations = get_supported_implementations();
291
134
    std::vector<std::size_t> results;
292
134
    results.reserve(implementations.size());
293
294
402
    for (auto impl : implementations) {
295
402
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
402
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
402
        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
402
      results.push_back(ret);
304
402
    }
305
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
134
    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
134
    return true;
321
134
  }
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
168
  bool count_the_input(FromSpan src) const {
290
168
    const auto implementations = get_supported_implementations();
291
168
    std::vector<std::size_t> results;
292
168
    results.reserve(implementations.size());
293
294
504
    for (auto impl : implementations) {
295
504
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
504
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
504
        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
504
      results.push_back(ret);
304
504
    }
305
168
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
168
    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
168
    return true;
321
168
  }
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
309
  bool count_the_input(FromSpan src) const {
290
309
    const auto implementations = get_supported_implementations();
291
309
    std::vector<std::size_t> results;
292
309
    results.reserve(implementations.size());
293
294
927
    for (auto impl : implementations) {
295
927
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
927
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
927
        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
927
      results.push_back(ret);
304
927
    }
305
309
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
309
    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
309
    return true;
321
309
  }
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
239
  bool count_the_input(FromSpan src) const {
290
239
    const auto implementations = get_supported_implementations();
291
239
    std::vector<std::size_t> results;
292
239
    results.reserve(implementations.size());
293
294
717
    for (auto impl : implementations) {
295
717
      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
717
      } else if constexpr (From == UtfEncodings::UTF8) {
301
717
        ret = impl->count_utf8(src.data(), src.size());
302
717
      }
303
717
      results.push_back(ret);
304
717
    }
305
239
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
239
    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
239
    return true;
321
239
  }
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
373
  bool count_the_input(FromSpan src) const {
290
373
    const auto implementations = get_supported_implementations();
291
373
    std::vector<std::size_t> results;
292
373
    results.reserve(implementations.size());
293
294
1.11k
    for (auto impl : implementations) {
295
1.11k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.11k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.11k
        ret = impl->count_utf8(src.data(), src.size());
302
1.11k
      }
303
1.11k
      results.push_back(ret);
304
1.11k
    }
305
373
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
373
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
373
    return true;
321
373
  }
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
299
  bool count_the_input(FromSpan src) const {
290
299
    const auto implementations = get_supported_implementations();
291
299
    std::vector<std::size_t> results;
292
299
    results.reserve(implementations.size());
293
294
897
    for (auto impl : implementations) {
295
897
      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
897
      } else if constexpr (From == UtfEncodings::UTF8) {
301
897
        ret = impl->count_utf8(src.data(), src.size());
302
897
      }
303
897
      results.push_back(ret);
304
897
    }
305
299
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
299
    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
299
    return true;
321
299
  }
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
348
  bool count_the_input(FromSpan src) const {
290
348
    const auto implementations = get_supported_implementations();
291
348
    std::vector<std::size_t> results;
292
348
    results.reserve(implementations.size());
293
294
1.04k
    for (auto impl : implementations) {
295
1.04k
      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.04k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.04k
        ret = impl->count_utf8(src.data(), src.size());
302
1.04k
      }
303
1.04k
      results.push_back(ret);
304
1.04k
    }
305
348
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
348
    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
348
    return true;
321
348
  }
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
24.1k
                                FromSpan src) const {
331
24.1k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
24.1k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
678
                                FromSpan src) const {
331
678
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
678
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_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
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
690
                                FromSpan src) const {
331
690
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
690
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.32k
                                FromSpan src) const {
331
1.32k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.32k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
918
                                FromSpan src) const {
331
918
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
918
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_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_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.40k
                                FromSpan src) const {
331
1.40k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.40k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.83k
                                FromSpan src) const {
331
1.83k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.83k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.73k
                                FromSpan src) const {
331
1.73k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.73k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.70k
                                FromSpan src) const {
331
1.70k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.70k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
825
                                FromSpan src) const {
331
825
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
825
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
537
                                FromSpan src) const {
331
537
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
537
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.04k
                                FromSpan src) const {
331
1.04k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.04k
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
504
                                FromSpan src) const {
331
504
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
504
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
927
                                FromSpan src) const {
331
927
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
927
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_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_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.05k
                                FromSpan src) const {
331
1.05k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.05k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.08k
                                FromSpan src) const {
331
1.08k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.08k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
717
                                FromSpan src) const {
331
717
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
717
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.11k
                                FromSpan src) const {
331
1.11k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.11k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
897
                                FromSpan src) const {
331
897
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
897
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.04k
                                FromSpan src) const {
331
1.04k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.04k
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
834
                                FromSpan src) const {
331
834
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
834
  }
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
171
                                FromSpan src) const {
339
171
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
171
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
219
                                FromSpan src) const {
339
219
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
219
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
261
                                FromSpan src) const {
339
261
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
261
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
381
                                FromSpan src) const {
339
381
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
381
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
402
                                FromSpan src) const {
339
402
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
402
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
639
                                FromSpan src) const {
339
639
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
639
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
150
                                FromSpan src) const {
339
150
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
150
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
150
                                FromSpan src) const {
339
150
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
150
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
108
                                FromSpan src) const {
339
108
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
108
  }
341
342
8.87k
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
8.87k
    length_result ret{};
344
345
8.87k
    const auto implementations = get_supported_implementations();
346
8.87k
    std::vector<std::size_t> results;
347
8.87k
    results.reserve(implementations.size());
348
349
26.6k
    for (auto impl : implementations) {
350
26.6k
      const auto len = invoke_lengthcalc(impl, src);
351
26.6k
      results.push_back(len);
352
26.6k
      ret.length.push_back(len);
353
26.6k
    }
354
355
17.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>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
452
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
704
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
460
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
884
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
612
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
796
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
938
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.22k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.15k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.13k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
114
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
146
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
174
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
550
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
254
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
694
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
268
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
336
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
618
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
426
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
670
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
706
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
722
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
478
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
746
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
598
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
696
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
72
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
556
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
8.87k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
8.87k
    } else {
375
8.87k
      ret.implementations_agree = true;
376
8.87k
    }
377
8.87k
    return ret;
378
8.87k
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
226
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
226
    length_result ret{};
344
345
226
    const auto implementations = get_supported_implementations();
346
226
    std::vector<std::size_t> results;
347
226
    results.reserve(implementations.size());
348
349
678
    for (auto impl : implementations) {
350
678
      const auto len = invoke_lengthcalc(impl, src);
351
678
      results.push_back(len);
352
678
      ret.length.push_back(len);
353
678
    }
354
355
226
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
226
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
226
    } else {
375
226
      ret.implementations_agree = true;
376
226
    }
377
226
    return ret;
378
226
  }
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
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
            << "implementations 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)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
230
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
230
    length_result ret{};
344
345
230
    const auto implementations = get_supported_implementations();
346
230
    std::vector<std::size_t> results;
347
230
    results.reserve(implementations.size());
348
349
690
    for (auto impl : implementations) {
350
690
      const auto len = invoke_lengthcalc(impl, src);
351
690
      results.push_back(len);
352
690
      ret.length.push_back(len);
353
690
    }
354
355
230
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
230
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
230
    } else {
375
230
      ret.implementations_agree = true;
376
230
    }
377
230
    return ret;
378
230
  }
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
442
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
442
    length_result ret{};
344
345
442
    const auto implementations = get_supported_implementations();
346
442
    std::vector<std::size_t> results;
347
442
    results.reserve(implementations.size());
348
349
1.32k
    for (auto impl : implementations) {
350
1.32k
      const auto len = invoke_lengthcalc(impl, src);
351
1.32k
      results.push_back(len);
352
1.32k
      ret.length.push_back(len);
353
1.32k
    }
354
355
442
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
442
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
442
    } else {
375
442
      ret.implementations_agree = true;
376
442
    }
377
442
    return ret;
378
442
  }
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
306
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
306
    length_result ret{};
344
345
306
    const auto implementations = get_supported_implementations();
346
306
    std::vector<std::size_t> results;
347
306
    results.reserve(implementations.size());
348
349
918
    for (auto impl : implementations) {
350
918
      const auto len = invoke_lengthcalc(impl, src);
351
918
      results.push_back(len);
352
918
      ret.length.push_back(len);
353
918
    }
354
355
306
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
306
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
306
    } else {
375
306
      ret.implementations_agree = true;
376
306
    }
377
306
    return ret;
378
306
  }
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
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
            << "implementations 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)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
469
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
469
    length_result ret{};
344
345
469
    const auto implementations = get_supported_implementations();
346
469
    std::vector<std::size_t> results;
347
469
    results.reserve(implementations.size());
348
349
1.40k
    for (auto impl : implementations) {
350
1.40k
      const auto len = invoke_lengthcalc(impl, src);
351
1.40k
      results.push_back(len);
352
1.40k
      ret.length.push_back(len);
353
1.40k
    }
354
355
469
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
469
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
469
    } else {
375
469
      ret.implementations_agree = true;
376
469
    }
377
469
    return ret;
378
469
  }
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
613
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
613
    length_result ret{};
344
345
613
    const auto implementations = get_supported_implementations();
346
613
    std::vector<std::size_t> results;
347
613
    results.reserve(implementations.size());
348
349
1.83k
    for (auto impl : implementations) {
350
1.83k
      const auto len = invoke_lengthcalc(impl, src);
351
1.83k
      results.push_back(len);
352
1.83k
      ret.length.push_back(len);
353
1.83k
    }
354
355
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
613
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
613
    } else {
375
613
      ret.implementations_agree = true;
376
613
    }
377
613
    return ret;
378
613
  }
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
577
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
577
    length_result ret{};
344
345
577
    const auto implementations = get_supported_implementations();
346
577
    std::vector<std::size_t> results;
347
577
    results.reserve(implementations.size());
348
349
1.73k
    for (auto impl : implementations) {
350
1.73k
      const auto len = invoke_lengthcalc(impl, src);
351
1.73k
      results.push_back(len);
352
1.73k
      ret.length.push_back(len);
353
1.73k
    }
354
355
577
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
577
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
577
    } else {
375
577
      ret.implementations_agree = true;
376
577
    }
377
577
    return ret;
378
577
  }
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
567
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
567
    length_result ret{};
344
345
567
    const auto implementations = get_supported_implementations();
346
567
    std::vector<std::size_t> results;
347
567
    results.reserve(implementations.size());
348
349
1.70k
    for (auto impl : implementations) {
350
1.70k
      const auto len = invoke_lengthcalc(impl, src);
351
1.70k
      results.push_back(len);
352
1.70k
      ret.length.push_back(len);
353
1.70k
    }
354
355
567
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
567
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
567
    } else {
375
567
      ret.implementations_agree = true;
376
567
    }
377
567
    return ret;
378
567
  }
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
57
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
57
    length_result ret{};
344
345
57
    const auto implementations = get_supported_implementations();
346
57
    std::vector<std::size_t> results;
347
57
    results.reserve(implementations.size());
348
349
171
    for (auto impl : implementations) {
350
171
      const auto len = invoke_lengthcalc(impl, src);
351
171
      results.push_back(len);
352
171
      ret.length.push_back(len);
353
171
    }
354
355
57
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
57
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
57
    } else {
375
57
      ret.implementations_agree = true;
376
57
    }
377
57
    return ret;
378
57
  }
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
73
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
73
    length_result ret{};
344
345
73
    const auto implementations = get_supported_implementations();
346
73
    std::vector<std::size_t> results;
347
73
    results.reserve(implementations.size());
348
349
219
    for (auto impl : implementations) {
350
219
      const auto len = invoke_lengthcalc(impl, src);
351
219
      results.push_back(len);
352
219
      ret.length.push_back(len);
353
219
    }
354
355
73
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
73
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
73
    } else {
375
73
      ret.implementations_agree = true;
376
73
    }
377
73
    return ret;
378
73
  }
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
87
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
87
    length_result ret{};
344
345
87
    const auto implementations = get_supported_implementations();
346
87
    std::vector<std::size_t> results;
347
87
    results.reserve(implementations.size());
348
349
261
    for (auto impl : implementations) {
350
261
      const auto len = invoke_lengthcalc(impl, src);
351
261
      results.push_back(len);
352
261
      ret.length.push_back(len);
353
261
    }
354
355
87
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
87
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
87
    } else {
375
87
      ret.implementations_agree = true;
376
87
    }
377
87
    return ret;
378
87
  }
Conversion<(UtfEncodings)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
275
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
275
    length_result ret{};
344
345
275
    const auto implementations = get_supported_implementations();
346
275
    std::vector<std::size_t> results;
347
275
    results.reserve(implementations.size());
348
349
825
    for (auto impl : implementations) {
350
825
      const auto len = invoke_lengthcalc(impl, src);
351
825
      results.push_back(len);
352
825
      ret.length.push_back(len);
353
825
    }
354
355
275
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
275
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
275
    } else {
375
275
      ret.implementations_agree = true;
376
275
    }
377
275
    return ret;
378
275
  }
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
127
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
127
    length_result ret{};
344
345
127
    const auto implementations = get_supported_implementations();
346
127
    std::vector<std::size_t> results;
347
127
    results.reserve(implementations.size());
348
349
381
    for (auto impl : implementations) {
350
381
      const auto len = invoke_lengthcalc(impl, src);
351
381
      results.push_back(len);
352
381
      ret.length.push_back(len);
353
381
    }
354
355
127
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
127
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
127
    } else {
375
127
      ret.implementations_agree = true;
376
127
    }
377
127
    return ret;
378
127
  }
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
179
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
179
    length_result ret{};
344
345
179
    const auto implementations = get_supported_implementations();
346
179
    std::vector<std::size_t> results;
347
179
    results.reserve(implementations.size());
348
349
537
    for (auto impl : implementations) {
350
537
      const auto len = invoke_lengthcalc(impl, src);
351
537
      results.push_back(len);
352
537
      ret.length.push_back(len);
353
537
    }
354
355
179
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
179
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
179
    } else {
375
179
      ret.implementations_agree = true;
376
179
    }
377
179
    return ret;
378
179
  }
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
347
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
347
    length_result ret{};
344
345
347
    const auto implementations = get_supported_implementations();
346
347
    std::vector<std::size_t> results;
347
347
    results.reserve(implementations.size());
348
349
1.04k
    for (auto impl : implementations) {
350
1.04k
      const auto len = invoke_lengthcalc(impl, src);
351
1.04k
      results.push_back(len);
352
1.04k
      ret.length.push_back(len);
353
1.04k
    }
354
355
347
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
347
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
347
    } else {
375
347
      ret.implementations_agree = true;
376
347
    }
377
347
    return ret;
378
347
  }
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
134
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
134
    length_result ret{};
344
345
134
    const auto implementations = get_supported_implementations();
346
134
    std::vector<std::size_t> results;
347
134
    results.reserve(implementations.size());
348
349
402
    for (auto impl : implementations) {
350
402
      const auto len = invoke_lengthcalc(impl, src);
351
402
      results.push_back(len);
352
402
      ret.length.push_back(len);
353
402
    }
354
355
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
134
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
134
    } else {
375
134
      ret.implementations_agree = true;
376
134
    }
377
134
    return ret;
378
134
  }
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
168
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
168
    length_result ret{};
344
345
168
    const auto implementations = get_supported_implementations();
346
168
    std::vector<std::size_t> results;
347
168
    results.reserve(implementations.size());
348
349
504
    for (auto impl : implementations) {
350
504
      const auto len = invoke_lengthcalc(impl, src);
351
504
      results.push_back(len);
352
504
      ret.length.push_back(len);
353
504
    }
354
355
168
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
168
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
168
    } else {
375
168
      ret.implementations_agree = true;
376
168
    }
377
168
    return ret;
378
168
  }
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
309
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
309
    length_result ret{};
344
345
309
    const auto implementations = get_supported_implementations();
346
309
    std::vector<std::size_t> results;
347
309
    results.reserve(implementations.size());
348
349
927
    for (auto impl : implementations) {
350
927
      const auto len = invoke_lengthcalc(impl, src);
351
927
      results.push_back(len);
352
927
      ret.length.push_back(len);
353
927
    }
354
355
309
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
309
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
309
    } else {
375
309
      ret.implementations_agree = true;
376
309
    }
377
309
    return ret;
378
309
  }
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
213
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
213
    length_result ret{};
344
345
213
    const auto implementations = get_supported_implementations();
346
213
    std::vector<std::size_t> results;
347
213
    results.reserve(implementations.size());
348
349
639
    for (auto impl : implementations) {
350
639
      const auto len = invoke_lengthcalc(impl, src);
351
639
      results.push_back(len);
352
639
      ret.length.push_back(len);
353
639
    }
354
355
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
213
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
213
    } else {
375
213
      ret.implementations_agree = true;
376
213
    }
377
213
    return ret;
378
213
  }
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
335
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
335
    length_result ret{};
344
345
335
    const auto implementations = get_supported_implementations();
346
335
    std::vector<std::size_t> results;
347
335
    results.reserve(implementations.size());
348
349
1.00k
    for (auto impl : implementations) {
350
1.00k
      const auto len = invoke_lengthcalc(impl, src);
351
1.00k
      results.push_back(len);
352
1.00k
      ret.length.push_back(len);
353
1.00k
    }
354
355
335
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
335
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
335
    } else {
375
335
      ret.implementations_agree = true;
376
335
    }
377
335
    return ret;
378
335
  }
Conversion<(UtfEncodings)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
353
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
353
    length_result ret{};
344
345
353
    const auto implementations = get_supported_implementations();
346
353
    std::vector<std::size_t> results;
347
353
    results.reserve(implementations.size());
348
349
1.05k
    for (auto impl : implementations) {
350
1.05k
      const auto len = invoke_lengthcalc(impl, src);
351
1.05k
      results.push_back(len);
352
1.05k
      ret.length.push_back(len);
353
1.05k
    }
354
355
353
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
353
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
353
    } else {
375
353
      ret.implementations_agree = true;
376
353
    }
377
353
    return ret;
378
353
  }
Conversion<(UtfEncodings)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
361
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
361
    length_result ret{};
344
345
361
    const auto implementations = get_supported_implementations();
346
361
    std::vector<std::size_t> results;
347
361
    results.reserve(implementations.size());
348
349
1.08k
    for (auto impl : implementations) {
350
1.08k
      const auto len = invoke_lengthcalc(impl, src);
351
1.08k
      results.push_back(len);
352
1.08k
      ret.length.push_back(len);
353
1.08k
    }
354
355
361
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
361
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
361
    } else {
375
361
      ret.implementations_agree = true;
376
361
    }
377
361
    return ret;
378
361
  }
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
239
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
239
    length_result ret{};
344
345
239
    const auto implementations = get_supported_implementations();
346
239
    std::vector<std::size_t> results;
347
239
    results.reserve(implementations.size());
348
349
717
    for (auto impl : implementations) {
350
717
      const auto len = invoke_lengthcalc(impl, src);
351
717
      results.push_back(len);
352
717
      ret.length.push_back(len);
353
717
    }
354
355
239
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
239
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
239
    } else {
375
239
      ret.implementations_agree = true;
376
239
    }
377
239
    return ret;
378
239
  }
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
373
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
373
    length_result ret{};
344
345
373
    const auto implementations = get_supported_implementations();
346
373
    std::vector<std::size_t> results;
347
373
    results.reserve(implementations.size());
348
349
1.11k
    for (auto impl : implementations) {
350
1.11k
      const auto len = invoke_lengthcalc(impl, src);
351
1.11k
      results.push_back(len);
352
1.11k
      ret.length.push_back(len);
353
1.11k
    }
354
355
373
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
373
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
373
    } else {
375
373
      ret.implementations_agree = true;
376
373
    }
377
373
    return ret;
378
373
  }
Conversion<(UtfEncodings)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
299
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
299
    length_result ret{};
344
345
299
    const auto implementations = get_supported_implementations();
346
299
    std::vector<std::size_t> results;
347
299
    results.reserve(implementations.size());
348
349
897
    for (auto impl : implementations) {
350
897
      const auto len = invoke_lengthcalc(impl, src);
351
897
      results.push_back(len);
352
897
      ret.length.push_back(len);
353
897
    }
354
355
299
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
299
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
299
    } else {
375
299
      ret.implementations_agree = true;
376
299
    }
377
299
    return ret;
378
299
  }
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
348
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
348
    length_result ret{};
344
345
348
    const auto implementations = get_supported_implementations();
346
348
    std::vector<std::size_t> results;
347
348
    results.reserve(implementations.size());
348
349
1.04k
    for (auto impl : implementations) {
350
1.04k
      const auto len = invoke_lengthcalc(impl, src);
351
1.04k
      results.push_back(len);
352
1.04k
      ret.length.push_back(len);
353
1.04k
    }
354
355
348
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
348
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
348
    } else {
375
348
      ret.implementations_agree = true;
376
348
    }
377
348
    return ret;
378
348
  }
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
50
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
50
    length_result ret{};
344
345
50
    const auto implementations = get_supported_implementations();
346
50
    std::vector<std::size_t> results;
347
50
    results.reserve(implementations.size());
348
349
150
    for (auto impl : implementations) {
350
150
      const auto len = invoke_lengthcalc(impl, src);
351
150
      results.push_back(len);
352
150
      ret.length.push_back(len);
353
150
    }
354
355
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
50
    } else {
375
50
      ret.implementations_agree = true;
376
50
    }
377
50
    return ret;
378
50
  }
Conversion<(UtfEncodings)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
50
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
50
    length_result ret{};
344
345
50
    const auto implementations = get_supported_implementations();
346
50
    std::vector<std::size_t> results;
347
50
    results.reserve(implementations.size());
348
349
150
    for (auto impl : implementations) {
350
150
      const auto len = invoke_lengthcalc(impl, src);
351
150
      results.push_back(len);
352
150
      ret.length.push_back(len);
353
150
    }
354
355
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
50
    } else {
375
50
      ret.implementations_agree = true;
376
50
    }
377
50
    return ret;
378
50
  }
Conversion<(UtfEncodings)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
36
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
36
    length_result ret{};
344
345
36
    const auto implementations = get_supported_implementations();
346
36
    std::vector<std::size_t> results;
347
36
    results.reserve(implementations.size());
348
349
108
    for (auto impl : implementations) {
350
108
      const auto len = invoke_lengthcalc(impl, src);
351
108
      results.push_back(len);
352
108
      ret.length.push_back(len);
353
108
    }
354
355
36
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
36
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
36
    } else {
375
36
      ret.implementations_agree = true;
376
36
    }
377
36
    return ret;
378
36
  }
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
278
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
278
    length_result ret{};
344
345
278
    const auto implementations = get_supported_implementations();
346
278
    std::vector<std::size_t> results;
347
278
    results.reserve(implementations.size());
348
349
834
    for (auto impl : implementations) {
350
834
      const auto len = invoke_lengthcalc(impl, src);
351
834
      results.push_back(len);
352
834
      ret.length.push_back(len);
353
834
    }
354
355
278
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
278
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
278
    } else {
375
278
      ret.implementations_agree = true;
376
278
    }
377
278
    return ret;
378
278
  }
379
380
  conversion_result do_conversion(FromSpan src,
381
                                  const std::vector<std::size_t>& outlength,
382
8.78k
                                  const bool inputisvalid) const {
383
8.78k
    conversion_result ret{};
384
385
8.78k
    const auto implementations = get_supported_implementations();
386
387
8.78k
    std::vector<result<ConversionResult>> results;
388
8.78k
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
8.78k
    std::vector<std::vector<ToType>> outputbuffers;
393
8.78k
    outputbuffers.reserve(implementations.size());
394
35.1k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
26.3k
      auto impl = implementations[i];
396
26.3k
      const ToType canary1{42};
397
26.3k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
26.3k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
26.3k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
26.3k
      const auto success = [](const ConversionResult& r) -> bool {
402
26.3k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
15.0k
          return r != 0;
404
15.0k
        } else {
405
11.3k
          return r.error == simdutf::error_code::SUCCESS;
406
11.3k
        }
407
26.3k
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
612
      const auto success = [](const ConversionResult& r) -> bool {
402
612
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
612
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
612
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.02k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.02k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.02k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.02k
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
669
      const auto success = [](const ConversionResult& r) -> bool {
402
669
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
669
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
669
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.28k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.28k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.28k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.28k
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
903
      const auto success = [](const ConversionResult& r) -> bool {
402
903
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
903
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
903
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.18k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.18k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.18k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.18k
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.40k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.40k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.40k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.40k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.81k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.81k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.81k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.81k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.71k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.71k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.71k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.71k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.66k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.66k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.66k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.66k
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
171
      const auto success = [](const ConversionResult& r) -> bool {
402
171
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
171
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
171
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
219
      const auto success = [](const ConversionResult& r) -> bool {
402
219
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
219
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
219
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
261
      const auto success = [](const ConversionResult& r) -> bool {
402
261
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
261
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
261
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
825
      const auto success = [](const ConversionResult& r) -> bool {
402
825
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
825
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
825
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
381
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
381
        } else {
405
381
          return r.error == simdutf::error_code::SUCCESS;
406
381
        }
407
381
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
537
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
537
        } else {
405
537
          return r.error == simdutf::error_code::SUCCESS;
406
537
        }
407
537
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
1.04k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.04k
        } else {
405
1.04k
          return r.error == simdutf::error_code::SUCCESS;
406
1.04k
        }
407
1.04k
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
402
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
402
        } else {
405
402
          return r.error == simdutf::error_code::SUCCESS;
406
402
        }
407
402
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
504
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
504
        } else {
405
504
          return r.error == simdutf::error_code::SUCCESS;
406
504
        }
407
504
      }(implret1);
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
927
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
927
        } else {
405
927
          return r.error == simdutf::error_code::SUCCESS;
406
927
        }
407
927
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
639
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
639
        } else {
405
639
          return r.error == simdutf::error_code::SUCCESS;
406
639
        }
407
639
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
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)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
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)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
1.08k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.08k
        } else {
405
1.08k
          return r.error == simdutf::error_code::SUCCESS;
406
1.08k
        }
407
1.08k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
717
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
717
        } else {
405
717
          return r.error == simdutf::error_code::SUCCESS;
406
717
        }
407
717
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
1.11k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.11k
        } else {
405
1.11k
          return r.error == simdutf::error_code::SUCCESS;
406
1.11k
        }
407
1.11k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
897
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
897
        } else {
405
897
          return r.error == simdutf::error_code::SUCCESS;
406
897
        }
407
897
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
1.04k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.04k
        } else {
405
1.04k
          return r.error == simdutf::error_code::SUCCESS;
406
1.04k
        }
407
1.04k
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
150
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
150
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
108
      const auto success = [](const ConversionResult& r) -> bool {
402
108
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
108
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
108
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
834
      const auto success = [](const ConversionResult& r) -> bool {
402
834
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
834
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
834
      }(implret1);
408
26.3k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
26.3k
      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
26.3k
        const ToType canary2{25};
414
26.3k
        const auto outputbuffer_first_run = outputbuffer;
415
26.3k
        std::ranges::fill(outputbuffer, canary2);
416
26.3k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
26.3k
                                          src.size(), outputbuffer.data());
418
419
26.3k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
26.3k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
13.0k
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
13.0k
          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.0k
        }
440
26.3k
      }
441
26.3k
      results.emplace_back(implret1, success ? hash1 : "");
442
26.3k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
8.78k
    if (!inputisvalid) {
447
12.6k
      for (auto& e : results) {
448
12.6k
        e.outputhash.clear();
449
12.6k
      }
450
4.22k
    }
451
452
17.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&) const
Line
Count
Source
452
408
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
686
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
446
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
856
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
602
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
790
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
934
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
1.20k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
1.14k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
1.11k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
114
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
146
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
174
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
550
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
254
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
694
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
268
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
336
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
618
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
426
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
670
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
706
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
722
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
478
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
746
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
598
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
696
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
72
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
556
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
8.78k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
8.78k
    } else {
474
8.78k
      ret.implementations_agree = true;
475
8.78k
    }
476
8.78k
    return ret;
477
8.78k
  }
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
204
                                  const bool inputisvalid) const {
383
204
    conversion_result ret{};
384
385
204
    const auto implementations = get_supported_implementations();
386
387
204
    std::vector<result<ConversionResult>> results;
388
204
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
204
    std::vector<std::vector<ToType>> outputbuffers;
393
204
    outputbuffers.reserve(implementations.size());
394
816
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
612
      auto impl = implementations[i];
396
612
      const ToType canary1{42};
397
612
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
612
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
612
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
612
      const auto success = [](const ConversionResult& r) -> bool {
402
612
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
612
          return r != 0;
404
612
        } else {
405
612
          return r.error == simdutf::error_code::SUCCESS;
406
612
        }
407
612
      }(implret1);
408
612
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
612
      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
612
        const ToType canary2{25};
414
612
        const auto outputbuffer_first_run = outputbuffer;
415
612
        std::ranges::fill(outputbuffer, canary2);
416
612
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
612
                                          src.size(), outputbuffer.data());
418
419
612
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
612
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
360
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
360
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
360
        }
440
612
      }
441
612
      results.emplace_back(implret1, success ? hash1 : "");
442
612
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
204
    if (!inputisvalid) {
447
240
      for (auto& e : results) {
448
240
        e.outputhash.clear();
449
240
      }
450
80
    }
451
452
204
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
204
    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
204
    } else {
474
204
      ret.implementations_agree = true;
475
204
    }
476
204
    return ret;
477
204
  }
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
343
                                  const bool inputisvalid) const {
383
343
    conversion_result ret{};
384
385
343
    const auto implementations = get_supported_implementations();
386
387
343
    std::vector<result<ConversionResult>> results;
388
343
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
343
    std::vector<std::vector<ToType>> outputbuffers;
393
343
    outputbuffers.reserve(implementations.size());
394
1.37k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.02k
      auto impl = implementations[i];
396
1.02k
      const ToType canary1{42};
397
1.02k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.02k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.02k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.02k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.02k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.02k
          return r != 0;
404
1.02k
        } else {
405
1.02k
          return r.error == simdutf::error_code::SUCCESS;
406
1.02k
        }
407
1.02k
      }(implret1);
408
1.02k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.02k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.02k
        const ToType canary2{25};
414
1.02k
        const auto outputbuffer_first_run = outputbuffer;
415
1.02k
        std::ranges::fill(outputbuffer, canary2);
416
1.02k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.02k
                                          src.size(), outputbuffer.data());
418
419
1.02k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.02k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
810
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
810
          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
810
        }
440
1.02k
      }
441
1.02k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.02k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
343
    if (!inputisvalid) {
447
207
      for (auto& e : results) {
448
207
        e.outputhash.clear();
449
207
      }
450
69
    }
451
452
343
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
343
    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
343
    } else {
474
343
      ret.implementations_agree = true;
475
343
    }
476
343
    return ret;
477
343
  }
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
223
                                  const bool inputisvalid) const {
383
223
    conversion_result ret{};
384
385
223
    const auto implementations = get_supported_implementations();
386
387
223
    std::vector<result<ConversionResult>> results;
388
223
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
223
    std::vector<std::vector<ToType>> outputbuffers;
393
223
    outputbuffers.reserve(implementations.size());
394
892
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
669
      auto impl = implementations[i];
396
669
      const ToType canary1{42};
397
669
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
669
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
669
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
669
      const auto success = [](const ConversionResult& r) -> bool {
402
669
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
669
          return r != 0;
404
669
        } else {
405
669
          return r.error == simdutf::error_code::SUCCESS;
406
669
        }
407
669
      }(implret1);
408
669
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
669
      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
669
        const ToType canary2{25};
414
669
        const auto outputbuffer_first_run = outputbuffer;
415
669
        std::ranges::fill(outputbuffer, canary2);
416
669
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
669
                                          src.size(), outputbuffer.data());
418
419
669
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
669
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
375
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
375
          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
375
        }
440
669
      }
441
669
      results.emplace_back(implret1, success ? hash1 : "");
442
669
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
223
    if (!inputisvalid) {
447
285
      for (auto& e : results) {
448
285
        e.outputhash.clear();
449
285
      }
450
95
    }
451
452
223
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
223
    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
223
    } else {
474
223
      ret.implementations_agree = true;
475
223
    }
476
223
    return ret;
477
223
  }
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
428
                                  const bool inputisvalid) const {
383
428
    conversion_result ret{};
384
385
428
    const auto implementations = get_supported_implementations();
386
387
428
    std::vector<result<ConversionResult>> results;
388
428
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
428
    std::vector<std::vector<ToType>> outputbuffers;
393
428
    outputbuffers.reserve(implementations.size());
394
1.71k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.28k
      auto impl = implementations[i];
396
1.28k
      const ToType canary1{42};
397
1.28k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.28k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.28k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.28k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.28k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.28k
          return r != 0;
404
1.28k
        } else {
405
1.28k
          return r.error == simdutf::error_code::SUCCESS;
406
1.28k
        }
407
1.28k
      }(implret1);
408
1.28k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.28k
      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.28k
        const ToType canary2{25};
414
1.28k
        const auto outputbuffer_first_run = outputbuffer;
415
1.28k
        std::ranges::fill(outputbuffer, canary2);
416
1.28k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.28k
                                          src.size(), outputbuffer.data());
418
419
1.28k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.28k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
984
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
984
          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
984
        }
440
1.28k
      }
441
1.28k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.28k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
428
    if (!inputisvalid) {
447
288
      for (auto& e : results) {
448
288
        e.outputhash.clear();
449
288
      }
450
96
    }
451
452
428
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
428
    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
428
    } else {
474
428
      ret.implementations_agree = true;
475
428
    }
476
428
    return ret;
477
428
  }
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
301
                                  const bool inputisvalid) const {
383
301
    conversion_result ret{};
384
385
301
    const auto implementations = get_supported_implementations();
386
387
301
    std::vector<result<ConversionResult>> results;
388
301
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
301
    std::vector<std::vector<ToType>> outputbuffers;
393
301
    outputbuffers.reserve(implementations.size());
394
1.20k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
903
      auto impl = implementations[i];
396
903
      const ToType canary1{42};
397
903
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
903
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
903
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
903
      const auto success = [](const ConversionResult& r) -> bool {
402
903
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
903
          return r != 0;
404
903
        } else {
405
903
          return r.error == simdutf::error_code::SUCCESS;
406
903
        }
407
903
      }(implret1);
408
903
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
903
      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
903
        const ToType canary2{25};
414
903
        const auto outputbuffer_first_run = outputbuffer;
415
903
        std::ranges::fill(outputbuffer, canary2);
416
903
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
903
                                          src.size(), outputbuffer.data());
418
419
903
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
903
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
387
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
387
          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
387
        }
440
903
      }
441
903
      results.emplace_back(implret1, success ? hash1 : "");
442
903
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
301
    if (!inputisvalid) {
447
507
      for (auto& e : results) {
448
507
        e.outputhash.clear();
449
507
      }
450
169
    }
451
452
301
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
301
    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
301
    } else {
474
301
      ret.implementations_agree = true;
475
301
    }
476
301
    return ret;
477
301
  }
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
395
                                  const bool inputisvalid) const {
383
395
    conversion_result ret{};
384
385
395
    const auto implementations = get_supported_implementations();
386
387
395
    std::vector<result<ConversionResult>> results;
388
395
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
395
    std::vector<std::vector<ToType>> outputbuffers;
393
395
    outputbuffers.reserve(implementations.size());
394
1.58k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.18k
      auto impl = implementations[i];
396
1.18k
      const ToType canary1{42};
397
1.18k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.18k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.18k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.18k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.18k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.18k
          return r != 0;
404
1.18k
        } else {
405
1.18k
          return r.error == simdutf::error_code::SUCCESS;
406
1.18k
        }
407
1.18k
      }(implret1);
408
1.18k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.18k
      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.18k
        const ToType canary2{25};
414
1.18k
        const auto outputbuffer_first_run = outputbuffer;
415
1.18k
        std::ranges::fill(outputbuffer, canary2);
416
1.18k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.18k
                                          src.size(), outputbuffer.data());
418
419
1.18k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.18k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
630
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
630
          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
630
        }
440
1.18k
      }
441
1.18k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.18k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
395
    if (!inputisvalid) {
447
543
      for (auto& e : results) {
448
543
        e.outputhash.clear();
449
543
      }
450
181
    }
451
452
395
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
395
    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
395
    } else {
474
395
      ret.implementations_agree = true;
475
395
    }
476
395
    return ret;
477
395
  }
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
467
                                  const bool inputisvalid) const {
383
467
    conversion_result ret{};
384
385
467
    const auto implementations = get_supported_implementations();
386
387
467
    std::vector<result<ConversionResult>> results;
388
467
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
467
    std::vector<std::vector<ToType>> outputbuffers;
393
467
    outputbuffers.reserve(implementations.size());
394
1.86k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.40k
      auto impl = implementations[i];
396
1.40k
      const ToType canary1{42};
397
1.40k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.40k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.40k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.40k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.40k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.40k
          return r != 0;
404
1.40k
        } else {
405
1.40k
          return r.error == simdutf::error_code::SUCCESS;
406
1.40k
        }
407
1.40k
      }(implret1);
408
1.40k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.40k
      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.40k
        const ToType canary2{25};
414
1.40k
        const auto outputbuffer_first_run = outputbuffer;
415
1.40k
        std::ranges::fill(outputbuffer, canary2);
416
1.40k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.40k
                                          src.size(), outputbuffer.data());
418
419
1.40k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.40k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
465
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
465
          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
465
        }
440
1.40k
      }
441
1.40k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.40k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
467
    if (!inputisvalid) {
447
927
      for (auto& e : results) {
448
927
        e.outputhash.clear();
449
927
      }
450
309
    }
451
452
467
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
467
    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
467
    } else {
474
467
      ret.implementations_agree = true;
475
467
    }
476
467
    return ret;
477
467
  }
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
604
                                  const bool inputisvalid) const {
383
604
    conversion_result ret{};
384
385
604
    const auto implementations = get_supported_implementations();
386
387
604
    std::vector<result<ConversionResult>> results;
388
604
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
604
    std::vector<std::vector<ToType>> outputbuffers;
393
604
    outputbuffers.reserve(implementations.size());
394
2.41k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.81k
      auto impl = implementations[i];
396
1.81k
      const ToType canary1{42};
397
1.81k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.81k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.81k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.81k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.81k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.81k
          return r != 0;
404
1.81k
        } else {
405
1.81k
          return r.error == simdutf::error_code::SUCCESS;
406
1.81k
        }
407
1.81k
      }(implret1);
408
1.81k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.81k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.81k
        const ToType canary2{25};
414
1.81k
        const auto outputbuffer_first_run = outputbuffer;
415
1.81k
        std::ranges::fill(outputbuffer, canary2);
416
1.81k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.81k
                                          src.size(), outputbuffer.data());
418
419
1.81k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.81k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
1.00k
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
1.00k
          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.00k
        }
440
1.81k
      }
441
1.81k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.81k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
604
    if (!inputisvalid) {
447
798
      for (auto& e : results) {
448
798
        e.outputhash.clear();
449
798
      }
450
266
    }
451
452
604
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
604
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
604
    } else {
474
604
      ret.implementations_agree = true;
475
604
    }
476
604
    return ret;
477
604
  }
Conversion<(UtfEncodings)2, (UtfEncodings)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
573
                                  const bool inputisvalid) const {
383
573
    conversion_result ret{};
384
385
573
    const auto implementations = get_supported_implementations();
386
387
573
    std::vector<result<ConversionResult>> results;
388
573
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
573
    std::vector<std::vector<ToType>> outputbuffers;
393
573
    outputbuffers.reserve(implementations.size());
394
2.29k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.71k
      auto impl = implementations[i];
396
1.71k
      const ToType canary1{42};
397
1.71k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.71k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.71k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.71k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.71k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.71k
          return r != 0;
404
1.71k
        } else {
405
1.71k
          return r.error == simdutf::error_code::SUCCESS;
406
1.71k
        }
407
1.71k
      }(implret1);
408
1.71k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.71k
      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.71k
        const ToType canary2{25};
414
1.71k
        const auto outputbuffer_first_run = outputbuffer;
415
1.71k
        std::ranges::fill(outputbuffer, canary2);
416
1.71k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.71k
                                          src.size(), outputbuffer.data());
418
419
1.71k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.71k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
924
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
924
          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
924
        }
440
1.71k
      }
441
1.71k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.71k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
573
    if (!inputisvalid) {
447
789
      for (auto& e : results) {
448
789
        e.outputhash.clear();
449
789
      }
450
263
    }
451
452
573
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
573
    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
573
    } else {
474
573
      ret.implementations_agree = true;
475
573
    }
476
573
    return ret;
477
573
  }
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
556
                                  const bool inputisvalid) const {
383
556
    conversion_result ret{};
384
385
556
    const auto implementations = get_supported_implementations();
386
387
556
    std::vector<result<ConversionResult>> results;
388
556
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
556
    std::vector<std::vector<ToType>> outputbuffers;
393
556
    outputbuffers.reserve(implementations.size());
394
2.22k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.66k
      auto impl = implementations[i];
396
1.66k
      const ToType canary1{42};
397
1.66k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.66k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.66k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.66k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.66k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.66k
          return r != 0;
404
1.66k
        } else {
405
1.66k
          return r.error == simdutf::error_code::SUCCESS;
406
1.66k
        }
407
1.66k
      }(implret1);
408
1.66k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.66k
      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.66k
        const ToType canary2{25};
414
1.66k
        const auto outputbuffer_first_run = outputbuffer;
415
1.66k
        std::ranges::fill(outputbuffer, canary2);
416
1.66k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.66k
                                          src.size(), outputbuffer.data());
418
419
1.66k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.66k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
942
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
942
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
942
        }
440
1.66k
      }
441
1.66k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.66k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
556
    if (!inputisvalid) {
447
720
      for (auto& e : results) {
448
720
        e.outputhash.clear();
449
720
      }
450
240
    }
451
452
556
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
556
    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
556
    } else {
474
556
      ret.implementations_agree = true;
475
556
    }
476
556
    return ret;
477
556
  }
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
57
                                  const bool inputisvalid) const {
383
57
    conversion_result ret{};
384
385
57
    const auto implementations = get_supported_implementations();
386
387
57
    std::vector<result<ConversionResult>> results;
388
57
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
57
    std::vector<std::vector<ToType>> outputbuffers;
393
57
    outputbuffers.reserve(implementations.size());
394
228
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
171
      auto impl = implementations[i];
396
171
      const ToType canary1{42};
397
171
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
171
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
171
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
171
      const auto success = [](const ConversionResult& r) -> bool {
402
171
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
171
          return r != 0;
404
171
        } else {
405
171
          return r.error == simdutf::error_code::SUCCESS;
406
171
        }
407
171
      }(implret1);
408
171
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
171
      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
171
        const ToType canary2{25};
414
171
        const auto outputbuffer_first_run = outputbuffer;
415
171
        std::ranges::fill(outputbuffer, canary2);
416
171
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
171
                                          src.size(), outputbuffer.data());
418
419
171
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
171
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
57
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
57
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
57
        }
440
171
      }
441
171
      results.emplace_back(implret1, success ? hash1 : "");
442
171
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
57
    if (!inputisvalid) {
447
24
      for (auto& e : results) {
448
24
        e.outputhash.clear();
449
24
      }
450
8
    }
451
452
57
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
57
    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
57
    } else {
474
57
      ret.implementations_agree = true;
475
57
    }
476
57
    return ret;
477
57
  }
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
73
                                  const bool inputisvalid) const {
383
73
    conversion_result ret{};
384
385
73
    const auto implementations = get_supported_implementations();
386
387
73
    std::vector<result<ConversionResult>> results;
388
73
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
73
    std::vector<std::vector<ToType>> outputbuffers;
393
73
    outputbuffers.reserve(implementations.size());
394
292
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
219
      auto impl = implementations[i];
396
219
      const ToType canary1{42};
397
219
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
219
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
219
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
219
      const auto success = [](const ConversionResult& r) -> bool {
402
219
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
219
          return r != 0;
404
219
        } else {
405
219
          return r.error == simdutf::error_code::SUCCESS;
406
219
        }
407
219
      }(implret1);
408
219
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
219
      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
219
        const ToType canary2{25};
414
219
        const auto outputbuffer_first_run = outputbuffer;
415
219
        std::ranges::fill(outputbuffer, canary2);
416
219
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
219
                                          src.size(), outputbuffer.data());
418
419
219
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
219
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
99
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
99
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
99
        }
440
219
      }
441
219
      results.emplace_back(implret1, success ? hash1 : "");
442
219
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
73
    if (!inputisvalid) {
447
69
      for (auto& e : results) {
448
69
        e.outputhash.clear();
449
69
      }
450
23
    }
451
452
73
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
73
    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
73
    } else {
474
73
      ret.implementations_agree = true;
475
73
    }
476
73
    return ret;
477
73
  }
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
87
                                  const bool inputisvalid) const {
383
87
    conversion_result ret{};
384
385
87
    const auto implementations = get_supported_implementations();
386
387
87
    std::vector<result<ConversionResult>> results;
388
87
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
87
    std::vector<std::vector<ToType>> outputbuffers;
393
87
    outputbuffers.reserve(implementations.size());
394
348
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
261
      auto impl = implementations[i];
396
261
      const ToType canary1{42};
397
261
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
261
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
261
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
261
      const auto success = [](const ConversionResult& r) -> bool {
402
261
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
261
          return r != 0;
404
261
        } else {
405
261
          return r.error == simdutf::error_code::SUCCESS;
406
261
        }
407
261
      }(implret1);
408
261
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
261
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
261
        const ToType canary2{25};
414
261
        const auto outputbuffer_first_run = outputbuffer;
415
261
        std::ranges::fill(outputbuffer, canary2);
416
261
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
261
                                          src.size(), outputbuffer.data());
418
419
261
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
261
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
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
261
      }
441
261
      results.emplace_back(implret1, success ? hash1 : "");
442
261
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
87
    if (!inputisvalid) {
447
183
      for (auto& e : results) {
448
183
        e.outputhash.clear();
449
183
      }
450
61
    }
451
452
87
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
87
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
87
    } else {
474
87
      ret.implementations_agree = true;
475
87
    }
476
87
    return ret;
477
87
  }
Conversion<(UtfEncodings)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
275
                                  const bool inputisvalid) const {
383
275
    conversion_result ret{};
384
385
275
    const auto implementations = get_supported_implementations();
386
387
275
    std::vector<result<ConversionResult>> results;
388
275
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
275
    std::vector<std::vector<ToType>> outputbuffers;
393
275
    outputbuffers.reserve(implementations.size());
394
1.10k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
825
      auto impl = implementations[i];
396
825
      const ToType canary1{42};
397
825
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
825
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
825
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
825
      const auto success = [](const ConversionResult& r) -> bool {
402
825
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
825
          return r != 0;
404
825
        } else {
405
825
          return r.error == simdutf::error_code::SUCCESS;
406
825
        }
407
825
      }(implret1);
408
825
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
825
      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
825
        const ToType canary2{25};
414
825
        const auto outputbuffer_first_run = outputbuffer;
415
825
        std::ranges::fill(outputbuffer, canary2);
416
825
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
825
                                          src.size(), outputbuffer.data());
418
419
825
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
825
        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
825
      }
441
825
      results.emplace_back(implret1, success ? hash1 : "");
442
825
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
275
    if (!inputisvalid) {
447
558
      for (auto& e : results) {
448
558
        e.outputhash.clear();
449
558
      }
450
186
    }
451
452
275
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
275
    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
275
    } else {
474
275
      ret.implementations_agree = true;
475
275
    }
476
275
    return ret;
477
275
  }
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
127
                                  const bool inputisvalid) const {
383
127
    conversion_result ret{};
384
385
127
    const auto implementations = get_supported_implementations();
386
387
127
    std::vector<result<ConversionResult>> results;
388
127
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
127
    std::vector<std::vector<ToType>> outputbuffers;
393
127
    outputbuffers.reserve(implementations.size());
394
508
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
381
      auto impl = implementations[i];
396
381
      const ToType canary1{42};
397
381
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
381
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
381
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
381
      const auto success = [](const ConversionResult& r) -> bool {
402
381
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
381
          return r != 0;
404
381
        } else {
405
381
          return r.error == simdutf::error_code::SUCCESS;
406
381
        }
407
381
      }(implret1);
408
381
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
381
      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
381
        const ToType canary2{25};
414
381
        const auto outputbuffer_first_run = outputbuffer;
415
381
        std::ranges::fill(outputbuffer, canary2);
416
381
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
381
                                          src.size(), outputbuffer.data());
418
419
381
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
381
        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
381
      }
441
381
      results.emplace_back(implret1, success ? hash1 : "");
442
381
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
127
    if (!inputisvalid) {
447
105
      for (auto& e : results) {
448
105
        e.outputhash.clear();
449
105
      }
450
35
    }
451
452
127
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
127
    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
127
    } else {
474
127
      ret.implementations_agree = true;
475
127
    }
476
127
    return ret;
477
127
  }
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
179
                                  const bool inputisvalid) const {
383
179
    conversion_result ret{};
384
385
179
    const auto implementations = get_supported_implementations();
386
387
179
    std::vector<result<ConversionResult>> results;
388
179
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
179
    std::vector<std::vector<ToType>> outputbuffers;
393
179
    outputbuffers.reserve(implementations.size());
394
716
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
537
      auto impl = implementations[i];
396
537
      const ToType canary1{42};
397
537
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
537
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
537
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
537
      const auto success = [](const ConversionResult& r) -> bool {
402
537
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
537
          return r != 0;
404
537
        } else {
405
537
          return r.error == simdutf::error_code::SUCCESS;
406
537
        }
407
537
      }(implret1);
408
537
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
537
      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
537
        const ToType canary2{25};
414
537
        const auto outputbuffer_first_run = outputbuffer;
415
537
        std::ranges::fill(outputbuffer, canary2);
416
537
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
537
                                          src.size(), outputbuffer.data());
418
419
537
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
537
        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
537
      }
441
537
      results.emplace_back(implret1, success ? hash1 : "");
442
537
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
179
    if (!inputisvalid) {
447
273
      for (auto& e : results) {
448
273
        e.outputhash.clear();
449
273
      }
450
91
    }
451
452
179
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
179
    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
179
    } else {
474
179
      ret.implementations_agree = true;
475
179
    }
476
179
    return ret;
477
179
  }
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
347
                                  const bool inputisvalid) const {
383
347
    conversion_result ret{};
384
385
347
    const auto implementations = get_supported_implementations();
386
387
347
    std::vector<result<ConversionResult>> results;
388
347
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
347
    std::vector<std::vector<ToType>> outputbuffers;
393
347
    outputbuffers.reserve(implementations.size());
394
1.38k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.04k
      auto impl = implementations[i];
396
1.04k
      const ToType canary1{42};
397
1.04k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.04k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.04k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.04k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.04k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.04k
          return r != 0;
404
1.04k
        } else {
405
1.04k
          return r.error == simdutf::error_code::SUCCESS;
406
1.04k
        }
407
1.04k
      }(implret1);
408
1.04k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.04k
      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.04k
        const ToType canary2{25};
414
1.04k
        const auto outputbuffer_first_run = outputbuffer;
415
1.04k
        std::ranges::fill(outputbuffer, canary2);
416
1.04k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.04k
                                          src.size(), outputbuffer.data());
418
419
1.04k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.04k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
597
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
597
          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
597
        }
440
1.04k
      }
441
1.04k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.04k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
347
    if (!inputisvalid) {
447
444
      for (auto& e : results) {
448
444
        e.outputhash.clear();
449
444
      }
450
148
    }
451
452
347
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
347
    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
347
    } else {
474
347
      ret.implementations_agree = true;
475
347
    }
476
347
    return ret;
477
347
  }
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
134
                                  const bool inputisvalid) const {
383
134
    conversion_result ret{};
384
385
134
    const auto implementations = get_supported_implementations();
386
387
134
    std::vector<result<ConversionResult>> results;
388
134
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
134
    std::vector<std::vector<ToType>> outputbuffers;
393
134
    outputbuffers.reserve(implementations.size());
394
536
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
402
      auto impl = implementations[i];
396
402
      const ToType canary1{42};
397
402
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
402
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
402
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
402
      const auto success = [](const ConversionResult& r) -> bool {
402
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
402
          return r != 0;
404
402
        } else {
405
402
          return r.error == simdutf::error_code::SUCCESS;
406
402
        }
407
402
      }(implret1);
408
402
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
402
      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
402
        const ToType canary2{25};
414
402
        const auto outputbuffer_first_run = outputbuffer;
415
402
        std::ranges::fill(outputbuffer, canary2);
416
402
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
402
                                          src.size(), outputbuffer.data());
418
419
402
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
402
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
132
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
132
          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
132
        }
440
402
      }
441
402
      results.emplace_back(implret1, success ? hash1 : "");
442
402
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
134
    if (!inputisvalid) {
447
84
      for (auto& e : results) {
448
84
        e.outputhash.clear();
449
84
      }
450
28
    }
451
452
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
134
    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
134
    } else {
474
134
      ret.implementations_agree = true;
475
134
    }
476
134
    return ret;
477
134
  }
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
168
                                  const bool inputisvalid) const {
383
168
    conversion_result ret{};
384
385
168
    const auto implementations = get_supported_implementations();
386
387
168
    std::vector<result<ConversionResult>> results;
388
168
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
168
    std::vector<std::vector<ToType>> outputbuffers;
393
168
    outputbuffers.reserve(implementations.size());
394
672
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
504
      auto impl = implementations[i];
396
504
      const ToType canary1{42};
397
504
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
504
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
504
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
504
      const auto success = [](const ConversionResult& r) -> bool {
402
504
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
504
          return r != 0;
404
504
        } else {
405
504
          return r.error == simdutf::error_code::SUCCESS;
406
504
        }
407
504
      }(implret1);
408
504
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
504
      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
504
        const ToType canary2{25};
414
504
        const auto outputbuffer_first_run = outputbuffer;
415
504
        std::ranges::fill(outputbuffer, canary2);
416
504
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
504
                                          src.size(), outputbuffer.data());
418
419
504
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
504
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
231
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
231
          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
231
        }
440
504
      }
441
504
      results.emplace_back(implret1, success ? hash1 : "");
442
504
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
168
    if (!inputisvalid) {
447
273
      for (auto& e : results) {
448
273
        e.outputhash.clear();
449
273
      }
450
91
    }
451
452
168
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
168
    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
168
    } else {
474
168
      ret.implementations_agree = true;
475
168
    }
476
168
    return ret;
477
168
  }
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
309
                                  const bool inputisvalid) const {
383
309
    conversion_result ret{};
384
385
309
    const auto implementations = get_supported_implementations();
386
387
309
    std::vector<result<ConversionResult>> results;
388
309
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
309
    std::vector<std::vector<ToType>> outputbuffers;
393
309
    outputbuffers.reserve(implementations.size());
394
1.23k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
927
      auto impl = implementations[i];
396
927
      const ToType canary1{42};
397
927
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
927
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
927
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
927
      const auto success = [](const ConversionResult& r) -> bool {
402
927
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
927
          return r != 0;
404
927
        } else {
405
927
          return r.error == simdutf::error_code::SUCCESS;
406
927
        }
407
927
      }(implret1);
408
927
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
927
      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
927
        const ToType canary2{25};
414
927
        const auto outputbuffer_first_run = outputbuffer;
415
927
        std::ranges::fill(outputbuffer, canary2);
416
927
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
927
                                          src.size(), outputbuffer.data());
418
419
927
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
927
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
573
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
573
          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
573
        }
440
927
      }
441
927
      results.emplace_back(implret1, success ? hash1 : "");
442
927
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
309
    if (!inputisvalid) {
447
354
      for (auto& e : results) {
448
354
        e.outputhash.clear();
449
354
      }
450
118
    }
451
452
309
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
309
    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
309
    } else {
474
309
      ret.implementations_agree = true;
475
309
    }
476
309
    return ret;
477
309
  }
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
213
                                  const bool inputisvalid) const {
383
213
    conversion_result ret{};
384
385
213
    const auto implementations = get_supported_implementations();
386
387
213
    std::vector<result<ConversionResult>> results;
388
213
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
213
    std::vector<std::vector<ToType>> outputbuffers;
393
213
    outputbuffers.reserve(implementations.size());
394
852
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
639
      auto impl = implementations[i];
396
639
      const ToType canary1{42};
397
639
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
639
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
639
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
639
      const auto success = [](const ConversionResult& r) -> bool {
402
639
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
639
          return r != 0;
404
639
        } else {
405
639
          return r.error == simdutf::error_code::SUCCESS;
406
639
        }
407
639
      }(implret1);
408
639
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
639
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
639
        const ToType canary2{25};
414
639
        const auto outputbuffer_first_run = outputbuffer;
415
639
        std::ranges::fill(outputbuffer, canary2);
416
639
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
639
                                          src.size(), outputbuffer.data());
418
419
639
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
639
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
63
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
63
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
63
        }
440
639
      }
441
639
      results.emplace_back(implret1, success ? hash1 : "");
442
639
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
213
    if (!inputisvalid) {
447
555
      for (auto& e : results) {
448
555
        e.outputhash.clear();
449
555
      }
450
185
    }
451
452
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
213
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
213
    } else {
474
213
      ret.implementations_agree = true;
475
213
    }
476
213
    return ret;
477
213
  }
Conversion<(UtfEncodings)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
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
252
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
252
          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
252
        }
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
753
      for (auto& e : results) {
448
753
        e.outputhash.clear();
449
753
      }
450
251
    }
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)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
353
                                  const bool inputisvalid) const {
383
353
    conversion_result ret{};
384
385
353
    const auto implementations = get_supported_implementations();
386
387
353
    std::vector<result<ConversionResult>> results;
388
353
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
353
    std::vector<std::vector<ToType>> outputbuffers;
393
353
    outputbuffers.reserve(implementations.size());
394
1.41k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.05k
      auto impl = implementations[i];
396
1.05k
      const ToType canary1{42};
397
1.05k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.05k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.05k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.05k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.05k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.05k
          return r != 0;
404
1.05k
        } else {
405
1.05k
          return r.error == simdutf::error_code::SUCCESS;
406
1.05k
        }
407
1.05k
      }(implret1);
408
1.05k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.05k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.05k
        const ToType canary2{25};
414
1.05k
        const auto outputbuffer_first_run = outputbuffer;
415
1.05k
        std::ranges::fill(outputbuffer, canary2);
416
1.05k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.05k
                                          src.size(), outputbuffer.data());
418
419
1.05k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.05k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
264
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
264
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
264
        }
440
1.05k
      }
441
1.05k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.05k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
353
    if (!inputisvalid) {
447
795
      for (auto& e : results) {
448
795
        e.outputhash.clear();
449
795
      }
450
265
    }
451
452
353
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
353
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
353
    } else {
474
353
      ret.implementations_agree = true;
475
353
    }
476
353
    return ret;
477
353
  }
Conversion<(UtfEncodings)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
361
                                  const bool inputisvalid) const {
383
361
    conversion_result ret{};
384
385
361
    const auto implementations = get_supported_implementations();
386
387
361
    std::vector<result<ConversionResult>> results;
388
361
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
361
    std::vector<std::vector<ToType>> outputbuffers;
393
361
    outputbuffers.reserve(implementations.size());
394
1.44k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.08k
      auto impl = implementations[i];
396
1.08k
      const ToType canary1{42};
397
1.08k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.08k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.08k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.08k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.08k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.08k
          return r != 0;
404
1.08k
        } else {
405
1.08k
          return r.error == simdutf::error_code::SUCCESS;
406
1.08k
        }
407
1.08k
      }(implret1);
408
1.08k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.08k
      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.08k
        const ToType canary2{25};
414
1.08k
        const auto outputbuffer_first_run = outputbuffer;
415
1.08k
        std::ranges::fill(outputbuffer, canary2);
416
1.08k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.08k
                                          src.size(), outputbuffer.data());
418
419
1.08k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.08k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
273
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
273
          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
273
        }
440
1.08k
      }
441
1.08k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.08k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
361
    if (!inputisvalid) {
447
810
      for (auto& e : results) {
448
810
        e.outputhash.clear();
449
810
      }
450
270
    }
451
452
361
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
361
    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
361
    } else {
474
361
      ret.implementations_agree = true;
475
361
    }
476
361
    return ret;
477
361
  }
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
239
                                  const bool inputisvalid) const {
383
239
    conversion_result ret{};
384
385
239
    const auto implementations = get_supported_implementations();
386
387
239
    std::vector<result<ConversionResult>> results;
388
239
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
239
    std::vector<std::vector<ToType>> outputbuffers;
393
239
    outputbuffers.reserve(implementations.size());
394
956
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
717
      auto impl = implementations[i];
396
717
      const ToType canary1{42};
397
717
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
717
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
717
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
717
      const auto success = [](const ConversionResult& r) -> bool {
402
717
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
717
          return r != 0;
404
717
        } else {
405
717
          return r.error == simdutf::error_code::SUCCESS;
406
717
        }
407
717
      }(implret1);
408
717
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
717
      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
717
        const ToType canary2{25};
414
717
        const auto outputbuffer_first_run = outputbuffer;
415
717
        std::ranges::fill(outputbuffer, canary2);
416
717
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
717
                                          src.size(), outputbuffer.data());
418
419
717
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
717
        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
717
      }
441
717
      results.emplace_back(implret1, success ? hash1 : "");
442
717
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
239
    if (!inputisvalid) {
447
393
      for (auto& e : results) {
448
393
        e.outputhash.clear();
449
393
      }
450
131
    }
451
452
239
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
239
    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
239
    } else {
474
239
      ret.implementations_agree = true;
475
239
    }
476
239
    return ret;
477
239
  }
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
373
                                  const bool inputisvalid) const {
383
373
    conversion_result ret{};
384
385
373
    const auto implementations = get_supported_implementations();
386
387
373
    std::vector<result<ConversionResult>> results;
388
373
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
373
    std::vector<std::vector<ToType>> outputbuffers;
393
373
    outputbuffers.reserve(implementations.size());
394
1.49k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.11k
      auto impl = implementations[i];
396
1.11k
      const ToType canary1{42};
397
1.11k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.11k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.11k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.11k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.11k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.11k
          return r != 0;
404
1.11k
        } else {
405
1.11k
          return r.error == simdutf::error_code::SUCCESS;
406
1.11k
        }
407
1.11k
      }(implret1);
408
1.11k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.11k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.11k
        const ToType canary2{25};
414
1.11k
        const auto outputbuffer_first_run = outputbuffer;
415
1.11k
        std::ranges::fill(outputbuffer, canary2);
416
1.11k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.11k
                                          src.size(), outputbuffer.data());
418
419
1.11k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.11k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
504
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
504
          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
504
        }
440
1.11k
      }
441
1.11k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.11k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
373
    if (!inputisvalid) {
447
615
      for (auto& e : results) {
448
615
        e.outputhash.clear();
449
615
      }
450
205
    }
451
452
373
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
373
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
373
    } else {
474
373
      ret.implementations_agree = true;
475
373
    }
476
373
    return ret;
477
373
  }
Conversion<(UtfEncodings)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
299
                                  const bool inputisvalid) const {
383
299
    conversion_result ret{};
384
385
299
    const auto implementations = get_supported_implementations();
386
387
299
    std::vector<result<ConversionResult>> results;
388
299
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
299
    std::vector<std::vector<ToType>> outputbuffers;
393
299
    outputbuffers.reserve(implementations.size());
394
1.19k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
897
      auto impl = implementations[i];
396
897
      const ToType canary1{42};
397
897
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
897
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
897
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
897
      const auto success = [](const ConversionResult& r) -> bool {
402
897
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
897
          return r != 0;
404
897
        } else {
405
897
          return r.error == simdutf::error_code::SUCCESS;
406
897
        }
407
897
      }(implret1);
408
897
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
897
      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
897
        const ToType canary2{25};
414
897
        const auto outputbuffer_first_run = outputbuffer;
415
897
        std::ranges::fill(outputbuffer, canary2);
416
897
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
897
                                          src.size(), outputbuffer.data());
418
419
897
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
897
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
366
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
366
          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
366
        }
440
897
      }
441
897
      results.emplace_back(implret1, success ? hash1 : "");
442
897
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
299
    if (!inputisvalid) {
447
531
      for (auto& e : results) {
448
531
        e.outputhash.clear();
449
531
      }
450
177
    }
451
452
299
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
299
    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
299
    } else {
474
299
      ret.implementations_agree = true;
475
299
    }
476
299
    return ret;
477
299
  }
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
348
                                  const bool inputisvalid) const {
383
348
    conversion_result ret{};
384
385
348
    const auto implementations = get_supported_implementations();
386
387
348
    std::vector<result<ConversionResult>> results;
388
348
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
348
    std::vector<std::vector<ToType>> outputbuffers;
393
348
    outputbuffers.reserve(implementations.size());
394
1.39k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.04k
      auto impl = implementations[i];
396
1.04k
      const ToType canary1{42};
397
1.04k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.04k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.04k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.04k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.04k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.04k
          return r != 0;
404
1.04k
        } else {
405
1.04k
          return r.error == simdutf::error_code::SUCCESS;
406
1.04k
        }
407
1.04k
      }(implret1);
408
1.04k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.04k
      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.04k
        const ToType canary2{25};
414
1.04k
        const auto outputbuffer_first_run = outputbuffer;
415
1.04k
        std::ranges::fill(outputbuffer, canary2);
416
1.04k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.04k
                                          src.size(), outputbuffer.data());
418
419
1.04k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.04k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
501
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
501
          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
501
        }
440
1.04k
      }
441
1.04k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.04k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
348
    if (!inputisvalid) {
447
543
      for (auto& e : results) {
448
543
        e.outputhash.clear();
449
543
      }
450
181
    }
451
452
348
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
348
    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
348
    } else {
474
348
      ret.implementations_agree = true;
475
348
    }
476
348
    return ret;
477
348
  }
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
50
                                  const bool inputisvalid) const {
383
50
    conversion_result ret{};
384
385
50
    const auto implementations = get_supported_implementations();
386
387
50
    std::vector<result<ConversionResult>> results;
388
50
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
50
    std::vector<std::vector<ToType>> outputbuffers;
393
50
    outputbuffers.reserve(implementations.size());
394
200
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
150
      auto impl = implementations[i];
396
150
      const ToType canary1{42};
397
150
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
150
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
150
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
150
        } else {
405
150
          return r.error == simdutf::error_code::SUCCESS;
406
150
        }
407
150
      }(implret1);
408
150
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
150
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
150
        const ToType canary2{25};
414
150
        const auto outputbuffer_first_run = outputbuffer;
415
150
        std::ranges::fill(outputbuffer, canary2);
416
150
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
150
                                          src.size(), outputbuffer.data());
418
419
150
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
150
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
144
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
144
          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
144
        }
440
150
      }
441
150
      results.emplace_back(implret1, success ? hash1 : "");
442
150
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
50
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
50
    } else {
474
50
      ret.implementations_agree = true;
475
50
    }
476
50
    return ret;
477
50
  }
Conversion<(UtfEncodings)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
50
                                  const bool inputisvalid) const {
383
50
    conversion_result ret{};
384
385
50
    const auto implementations = get_supported_implementations();
386
387
50
    std::vector<result<ConversionResult>> results;
388
50
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
50
    std::vector<std::vector<ToType>> outputbuffers;
393
50
    outputbuffers.reserve(implementations.size());
394
200
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
150
      auto impl = implementations[i];
396
150
      const ToType canary1{42};
397
150
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
150
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
150
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
150
        } else {
405
150
          return r.error == simdutf::error_code::SUCCESS;
406
150
        }
407
150
      }(implret1);
408
150
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
150
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
150
        const ToType canary2{25};
414
150
        const auto outputbuffer_first_run = outputbuffer;
415
150
        std::ranges::fill(outputbuffer, canary2);
416
150
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
150
                                          src.size(), outputbuffer.data());
418
419
150
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
150
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
144
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
144
          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
144
        }
440
150
      }
441
150
      results.emplace_back(implret1, success ? hash1 : "");
442
150
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
50
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
50
    } else {
474
50
      ret.implementations_agree = true;
475
50
    }
476
50
    return ret;
477
50
  }
Conversion<(UtfEncodings)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
36
                                  const bool inputisvalid) const {
383
36
    conversion_result ret{};
384
385
36
    const auto implementations = get_supported_implementations();
386
387
36
    std::vector<result<ConversionResult>> results;
388
36
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
36
    std::vector<std::vector<ToType>> outputbuffers;
393
36
    outputbuffers.reserve(implementations.size());
394
144
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
108
      auto impl = implementations[i];
396
108
      const ToType canary1{42};
397
108
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
108
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
108
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
108
      const auto success = [](const ConversionResult& r) -> bool {
402
108
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
108
          return r != 0;
404
108
        } else {
405
108
          return r.error == simdutf::error_code::SUCCESS;
406
108
        }
407
108
      }(implret1);
408
108
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
108
      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
108
        const ToType canary2{25};
414
108
        const auto outputbuffer_first_run = outputbuffer;
415
108
        std::ranges::fill(outputbuffer, canary2);
416
108
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
108
                                          src.size(), outputbuffer.data());
418
419
108
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
108
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
102
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
102
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
102
        }
440
108
      }
441
108
      results.emplace_back(implret1, success ? hash1 : "");
442
108
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
36
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
36
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
36
    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
36
    } else {
474
36
      ret.implementations_agree = true;
475
36
    }
476
36
    return ret;
477
36
  }
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
278
                                  const bool inputisvalid) const {
383
278
    conversion_result ret{};
384
385
278
    const auto implementations = get_supported_implementations();
386
387
278
    std::vector<result<ConversionResult>> results;
388
278
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
278
    std::vector<std::vector<ToType>> outputbuffers;
393
278
    outputbuffers.reserve(implementations.size());
394
1.11k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
834
      auto impl = implementations[i];
396
834
      const ToType canary1{42};
397
834
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
834
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
834
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
834
      const auto success = [](const ConversionResult& r) -> bool {
402
834
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
834
          return r != 0;
404
834
        } else {
405
834
          return r.error == simdutf::error_code::SUCCESS;
406
834
        }
407
834
      }(implret1);
408
834
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
834
      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
834
        const ToType canary2{25};
414
834
        const auto outputbuffer_first_run = outputbuffer;
415
834
        std::ranges::fill(outputbuffer, canary2);
416
834
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
834
                                          src.size(), outputbuffer.data());
418
419
834
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
834
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
828
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
828
          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
828
        }
440
834
      }
441
834
      results.emplace_back(implret1, success ? hash1 : "");
442
834
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
278
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
278
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
278
    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
278
    } else {
474
278
      ret.implementations_agree = true;
475
278
    }
476
278
    return ret;
477
278
  }
478
479
0
  void dump_testcase(FromSpan typedspan, std::ostream& os) const {
480
0
    const auto testhash = FNV1A_hash::as_str(name, typedspan);
481
482
0
    os << "// begin testcase\n";
483
0
    os << "TEST(issue_" << name << "_" << testhash << ") {\n";
484
0
    os << " alignas(" << sizeof(FromType) << ") const unsigned char data[]={";
485
0
    const auto first = reinterpret_cast<const unsigned char*>(typedspan.data());
486
0
    const auto last = first + typedspan.size_bytes();
487
0
    for (auto it = first; it != last; ++it) {
488
0
      os << "0x" << std::hex << std::setfill('0') << std::setw(2) << (+*it)
489
0
         << (it + 1 == last ? "};\n" : ", ");
490
0
    }
491
0
    os << " constexpr std::size_t data_len_bytes=sizeof(data);\n";
492
0
    os << " constexpr std::size_t data_len=data_len_bytes/sizeof("
493
0
       << nameoftype(FromType{}) << ");\n";
494
0
    if constexpr (From != UtfEncodings::LATIN1) {
495
0
      os << "const auto validation1=implementation."
496
0
         << ValidationFunctionTrait<From>::ValidationWithErrorsName
497
0
         << "((const " << nameoftype(FromType{}) << "*) data,\n data_len);\n";
498
0
      os << "   ASSERT_EQUAL(validation1.count, 1234);\n";
499
0
      os << "   ASSERT_EQUAL(validation1.error, "
500
0
            "simdutf::error_code::SUCCESS);\n";
501
0
      os << '\n';
502
0
      os << "const bool validation2=implementation."
503
0
         << ValidationFunctionTrait<From>::ValidationName << "((const "
504
0
         << nameoftype(FromType{}) << "*) data,\n data_len);\n";
505
0
      os << "   "
506
0
            "ASSERT_EQUAL(validation1.error==simdutf::error_code::SUCCESS,"
507
0
            "validation2);\n";
508
0
      os << '\n';
509
0
      os << " if(validation1.error!= simdutf::error_code::SUCCESS) {return;}\n";
510
0
    }
511
512
0
    if (std::is_invocable_v<LengthFunction, const simdutf::implementation*,
513
0
                            const FromType*, std::size_t>) {
514
0
      os << "const auto outlen=implementation." << lengthcalcname << "((const "
515
0
         << nameoftype(FromType{}) << "*) data,\n data_len);\n";
516
0
    } else if (std::is_invocable_v<LengthFunction,
517
0
                                   const simdutf::implementation*,
518
0
                                   std::size_t>) {
519
0
      os << "const auto outlen=implementation." << lengthcalcname
520
0
         << "(data_len);\n";
521
0
    } else {
522
      // programming error
523
0
      std::abort();
524
0
    }
525
0
    os << "ASSERT_EQUAL(outlen, 1234);\n";
526
0
    os << "std::vector<" << nameoftype(ToType{}) << "> output(outlen);\n";
527
0
    os << "const auto r = implementation." << name << "((const "
528
0
       << nameoftype(FromType{}) << "*) data\n, data_len\n, output.data());\n";
529
530
0
    if constexpr (std::is_same_v<ConversionResult, simdutf::result>) {
531
0
      os << " ASSERT_EQUAL(r.error,simdutf::error_code::SUCCESS);\n";
532
0
      os << " ASSERT_EQUAL(r.count,1234);\n";
533
0
    } else {
534
0
      os << "   ASSERT_EQUAL(r, 1234);\n";
535
0
    }
536
537
    // dump the output data
538
0
    os << "const std::vector<" << nameoftype(ToType{}) << "> expected_out{};\n";
539
0
    os << " ASSERT_TRUE(output.size()==expected_out.size());\n";
540
0
    os << " for(std::size_t i=0; i<output.size(); ++i) { "
541
0
          "ASSERT_EQUAL(+output.at(i),+expected_out.at(i));};\n";
542
543
0
    os << "}\n";
544
0
    os << "// end testcase\n";
545
0
  }
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
546
};
547
548
1
const auto populate_functions() {
549
1
  using I = simdutf::implementation;
550
1
  using FuzzSignature = void (*)(std::span<const char>);
551
552
1
#define ADD(lenfunc, conversionfunc)                                           \
553
42
  FuzzSignature {                                                              \
554
8.87k
    +[](std::span<const char> chardata) {                                      \
555
8.87k
      const auto c =                                                           \
556
8.87k
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
8.87k
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
8.87k
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
8.87k
              &I::lenfunc, &I::conversionfunc,                                 \
560
8.87k
              std::string{NAMEOF(&I::lenfunc)},                                \
561
8.87k
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
8.87k
      c.fuzz(chardata);                                                        \
563
8.87k
    }                                                                          \
conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
95
    +[](std::span<const char> chardata) {                                      \
555
95
      const auto c =                                                           \
556
95
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
95
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
95
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
95
              &I::lenfunc, &I::conversionfunc,                                 \
560
95
              std::string{NAMEOF(&I::lenfunc)},                                \
561
95
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
95
      c.fuzz(chardata);                                                        \
563
95
    }                                                                          \
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
210
    +[](std::span<const char> chardata) {                                      \
555
210
      const auto c =                                                           \
556
210
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
210
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
210
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
210
              &I::lenfunc, &I::conversionfunc,                                 \
560
210
              std::string{NAMEOF(&I::lenfunc)},                                \
561
210
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
210
      c.fuzz(chardata);                                                        \
563
210
    }                                                                          \
conversion.cpp:populate_functions()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
68
    +[](std::span<const char> chardata) {                                      \
555
68
      const auto c =                                                           \
556
68
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
68
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
68
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
68
              &I::lenfunc, &I::conversionfunc,                                 \
560
68
              std::string{NAMEOF(&I::lenfunc)},                                \
561
68
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
68
      c.fuzz(chardata);                                                        \
563
68
    }                                                                          \
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
224
    +[](std::span<const char> chardata) {                                      \
555
224
      const auto c =                                                           \
556
224
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
224
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
224
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
224
              &I::lenfunc, &I::conversionfunc,                                 \
560
224
              std::string{NAMEOF(&I::lenfunc)},                                \
561
224
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
224
      c.fuzz(chardata);                                                        \
563
224
    }                                                                          \
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
71
    +[](std::span<const char> chardata) {                                      \
555
71
      const auto c =                                                           \
556
71
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
71
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
71
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
71
              &I::lenfunc, &I::conversionfunc,                                 \
560
71
              std::string{NAMEOF(&I::lenfunc)},                                \
561
71
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
71
      c.fuzz(chardata);                                                        \
563
71
    }                                                                          \
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
138
    +[](std::span<const char> chardata) {                                      \
555
138
      const auto c =                                                           \
556
138
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
138
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
138
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
138
              &I::lenfunc, &I::conversionfunc,                                 \
560
138
              std::string{NAMEOF(&I::lenfunc)},                                \
561
138
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
138
      c.fuzz(chardata);                                                        \
563
138
    }                                                                          \
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
101
    +[](std::span<const char> chardata) {                                      \
555
101
      const auto c =                                                           \
556
101
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
101
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
101
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
101
              &I::lenfunc, &I::conversionfunc,                                 \
560
101
              std::string{NAMEOF(&I::lenfunc)},                                \
561
101
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
101
      c.fuzz(chardata);                                                        \
563
101
    }                                                                          \
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
229
    +[](std::span<const char> chardata) {                                      \
555
229
      const auto c =                                                           \
556
229
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
229
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
229
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
229
              &I::lenfunc, &I::conversionfunc,                                 \
560
229
              std::string{NAMEOF(&I::lenfunc)},                                \
561
229
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
229
      c.fuzz(chardata);                                                        \
563
229
    }                                                                          \
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
203
    +[](std::span<const char> chardata) {                                      \
555
203
      const auto c =                                                           \
556
203
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
203
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
203
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
203
              &I::lenfunc, &I::conversionfunc,                                 \
560
203
              std::string{NAMEOF(&I::lenfunc)},                                \
561
203
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
203
      c.fuzz(chardata);                                                        \
563
203
    }                                                                          \
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
229
    +[](std::span<const char> chardata) {                                      \
555
229
      const auto c =                                                           \
556
229
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
229
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
229
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
229
              &I::lenfunc, &I::conversionfunc,                                 \
560
229
              std::string{NAMEOF(&I::lenfunc)},                                \
561
229
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
229
      c.fuzz(chardata);                                                        \
563
229
    }                                                                          \
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
57
    +[](std::span<const char> chardata) {                                      \
555
57
      const auto c =                                                           \
556
57
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
57
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
57
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
57
              &I::lenfunc, &I::conversionfunc,                                 \
560
57
              std::string{NAMEOF(&I::lenfunc)},                                \
561
57
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
57
      c.fuzz(chardata);                                                        \
563
57
    }                                                                          \
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
131
    +[](std::span<const char> chardata) {                                      \
555
131
      const auto c =                                                           \
556
131
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
131
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
131
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
131
              &I::lenfunc, &I::conversionfunc,                                 \
560
131
              std::string{NAMEOF(&I::lenfunc)},                                \
561
131
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
131
      c.fuzz(chardata);                                                        \
563
131
    }                                                                          \
conversion.cpp:populate_functions()::$_12::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
142
    +[](std::span<const char> chardata) {                                      \
555
142
      const auto c =                                                           \
556
142
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
142
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
142
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
142
              &I::lenfunc, &I::conversionfunc,                                 \
560
142
              std::string{NAMEOF(&I::lenfunc)},                                \
561
142
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
142
      c.fuzz(chardata);                                                        \
563
142
    }                                                                          \
conversion.cpp:populate_functions()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
73
    +[](std::span<const char> chardata) {                                      \
555
73
      const auto c =                                                           \
556
73
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
73
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
73
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
73
              &I::lenfunc, &I::conversionfunc,                                 \
560
73
              std::string{NAMEOF(&I::lenfunc)},                                \
561
73
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
73
      c.fuzz(chardata);                                                        \
563
73
    }                                                                          \
conversion.cpp:populate_functions()::$_14::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()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
218
    +[](std::span<const char> chardata) {                                      \
555
218
      const auto c =                                                           \
556
218
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
218
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
218
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
218
              &I::lenfunc, &I::conversionfunc,                                 \
560
218
              std::string{NAMEOF(&I::lenfunc)},                                \
561
218
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
218
      c.fuzz(chardata);                                                        \
563
218
    }                                                                          \
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
87
    +[](std::span<const char> chardata) {                                      \
555
87
      const auto c =                                                           \
556
87
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
87
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
87
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
87
              &I::lenfunc, &I::conversionfunc,                                 \
560
87
              std::string{NAMEOF(&I::lenfunc)},                                \
561
87
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
87
      c.fuzz(chardata);                                                        \
563
87
    }                                                                          \
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
235
    +[](std::span<const char> chardata) {                                      \
555
235
      const auto c =                                                           \
556
235
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
235
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
235
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
235
              &I::lenfunc, &I::conversionfunc,                                 \
560
235
              std::string{NAMEOF(&I::lenfunc)},                                \
561
235
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
235
      c.fuzz(chardata);                                                        \
563
235
    }                                                                          \
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
260
    +[](std::span<const char> chardata) {                                      \
555
260
      const auto c =                                                           \
556
260
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
260
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
260
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
260
              &I::lenfunc, &I::conversionfunc,                                 \
560
260
              std::string{NAMEOF(&I::lenfunc)},                                \
561
260
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
260
      c.fuzz(chardata);                                                        \
563
260
    }                                                                          \
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
368
    +[](std::span<const char> chardata) {                                      \
555
368
      const auto c =                                                           \
556
368
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
368
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
368
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
368
              &I::lenfunc, &I::conversionfunc,                                 \
560
368
              std::string{NAMEOF(&I::lenfunc)},                                \
561
368
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
368
      c.fuzz(chardata);                                                        \
563
368
    }                                                                          \
conversion.cpp:populate_functions()::$_20::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()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
384
    +[](std::span<const char> chardata) {                                      \
555
384
      const auto c =                                                           \
556
384
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
384
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
384
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
384
              &I::lenfunc, &I::conversionfunc,                                 \
560
384
              std::string{NAMEOF(&I::lenfunc)},                                \
561
384
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
384
      c.fuzz(chardata);                                                        \
563
384
    }                                                                          \
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
374
    +[](std::span<const char> chardata) {                                      \
555
374
      const auto c =                                                           \
556
374
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
374
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
374
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
374
              &I::lenfunc, &I::conversionfunc,                                 \
560
374
              std::string{NAMEOF(&I::lenfunc)},                                \
561
374
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
374
      c.fuzz(chardata);                                                        \
563
374
    }                                                                          \
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
338
    +[](std::span<const char> chardata) {                                      \
555
338
      const auto c =                                                           \
556
338
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
338
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
338
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
338
              &I::lenfunc, &I::conversionfunc,                                 \
560
338
              std::string{NAMEOF(&I::lenfunc)},                                \
561
338
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
338
      c.fuzz(chardata);                                                        \
563
338
    }                                                                          \
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
127
    +[](std::span<const char> chardata) {                                      \
555
127
      const auto c =                                                           \
556
127
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
127
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
127
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
127
              &I::lenfunc, &I::conversionfunc,                                 \
560
127
              std::string{NAMEOF(&I::lenfunc)},                                \
561
127
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
127
      c.fuzz(chardata);                                                        \
563
127
    }                                                                          \
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
179
    +[](std::span<const char> chardata) {                                      \
555
179
      const auto c =                                                           \
556
179
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
179
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
179
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
179
              &I::lenfunc, &I::conversionfunc,                                 \
560
179
              std::string{NAMEOF(&I::lenfunc)},                                \
561
179
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
179
      c.fuzz(chardata);                                                        \
563
179
    }                                                                          \
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
347
    +[](std::span<const char> chardata) {                                      \
555
347
      const auto c =                                                           \
556
347
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
347
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
347
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
347
              &I::lenfunc, &I::conversionfunc,                                 \
560
347
              std::string{NAMEOF(&I::lenfunc)},                                \
561
347
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
347
      c.fuzz(chardata);                                                        \
563
347
    }                                                                          \
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
134
    +[](std::span<const char> chardata) {                                      \
555
134
      const auto c =                                                           \
556
134
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
134
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
134
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
134
              &I::lenfunc, &I::conversionfunc,                                 \
560
134
              std::string{NAMEOF(&I::lenfunc)},                                \
561
134
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
134
      c.fuzz(chardata);                                                        \
563
134
    }                                                                          \
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
168
    +[](std::span<const char> chardata) {                                      \
555
168
      const auto c =                                                           \
556
168
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
168
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
168
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
168
              &I::lenfunc, &I::conversionfunc,                                 \
560
168
              std::string{NAMEOF(&I::lenfunc)},                                \
561
168
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
168
      c.fuzz(chardata);                                                        \
563
168
    }                                                                          \
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
309
    +[](std::span<const char> chardata) {                                      \
555
309
      const auto c =                                                           \
556
309
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
309
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
309
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
309
              &I::lenfunc, &I::conversionfunc,                                 \
560
309
              std::string{NAMEOF(&I::lenfunc)},                                \
561
309
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
309
      c.fuzz(chardata);                                                        \
563
309
    }                                                                          \
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
213
    +[](std::span<const char> chardata) {                                      \
555
213
      const auto c =                                                           \
556
213
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
213
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
213
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
213
              &I::lenfunc, &I::conversionfunc,                                 \
560
213
              std::string{NAMEOF(&I::lenfunc)},                                \
561
213
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
213
      c.fuzz(chardata);                                                        \
563
213
    }                                                                          \
conversion.cpp:populate_functions()::$_31::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()::$_32::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
353
    +[](std::span<const char> chardata) {                                      \
555
353
      const auto c =                                                           \
556
353
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
353
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
353
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
353
              &I::lenfunc, &I::conversionfunc,                                 \
560
353
              std::string{NAMEOF(&I::lenfunc)},                                \
561
353
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
353
      c.fuzz(chardata);                                                        \
563
353
    }                                                                          \
conversion.cpp:populate_functions()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
361
    +[](std::span<const char> chardata) {                                      \
555
361
      const auto c =                                                           \
556
361
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
361
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
361
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
361
              &I::lenfunc, &I::conversionfunc,                                 \
560
361
              std::string{NAMEOF(&I::lenfunc)},                                \
561
361
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
361
      c.fuzz(chardata);                                                        \
563
361
    }                                                                          \
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
239
    +[](std::span<const char> chardata) {                                      \
555
239
      const auto c =                                                           \
556
239
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
239
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
239
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
239
              &I::lenfunc, &I::conversionfunc,                                 \
560
239
              std::string{NAMEOF(&I::lenfunc)},                                \
561
239
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
239
      c.fuzz(chardata);                                                        \
563
239
    }                                                                          \
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
373
    +[](std::span<const char> chardata) {                                      \
555
373
      const auto c =                                                           \
556
373
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
373
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
373
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
373
              &I::lenfunc, &I::conversionfunc,                                 \
560
373
              std::string{NAMEOF(&I::lenfunc)},                                \
561
373
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
373
      c.fuzz(chardata);                                                        \
563
373
    }                                                                          \
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
299
    +[](std::span<const char> chardata) {                                      \
555
299
      const auto c =                                                           \
556
299
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
299
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
299
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
299
              &I::lenfunc, &I::conversionfunc,                                 \
560
299
              std::string{NAMEOF(&I::lenfunc)},                                \
561
299
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
299
      c.fuzz(chardata);                                                        \
563
299
    }                                                                          \
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
348
    +[](std::span<const char> chardata) {                                      \
555
348
      const auto c =                                                           \
556
348
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
348
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
348
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
348
              &I::lenfunc, &I::conversionfunc,                                 \
560
348
              std::string{NAMEOF(&I::lenfunc)},                                \
561
348
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
348
      c.fuzz(chardata);                                                        \
563
348
    }                                                                          \
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
50
    +[](std::span<const char> chardata) {                                      \
555
50
      const auto c =                                                           \
556
50
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
50
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
50
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
50
              &I::lenfunc, &I::conversionfunc,                                 \
560
50
              std::string{NAMEOF(&I::lenfunc)},                                \
561
50
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
50
      c.fuzz(chardata);                                                        \
563
50
    }                                                                          \
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
50
    +[](std::span<const char> chardata) {                                      \
555
50
      const auto c =                                                           \
556
50
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
50
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
50
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
50
              &I::lenfunc, &I::conversionfunc,                                 \
560
50
              std::string{NAMEOF(&I::lenfunc)},                                \
561
50
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
50
      c.fuzz(chardata);                                                        \
563
50
    }                                                                          \
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
36
    +[](std::span<const char> chardata) {                                      \
555
36
      const auto c =                                                           \
556
36
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
36
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
36
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
36
              &I::lenfunc, &I::conversionfunc,                                 \
560
36
              std::string{NAMEOF(&I::lenfunc)},                                \
561
36
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
36
      c.fuzz(chardata);                                                        \
563
36
    }                                                                          \
conversion.cpp:populate_functions()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
278
    +[](std::span<const char> chardata) {                                      \
555
278
      const auto c =                                                           \
556
278
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
278
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
278
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
278
              &I::lenfunc, &I::conversionfunc,                                 \
560
278
              std::string{NAMEOF(&I::lenfunc)},                                \
561
278
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
278
      c.fuzz(chardata);                                                        \
563
278
    }                                                                          \
564
42
  }
565
566
1
  return std::array{
567
      // all these cases require valid input for invoking the convert function
568
569
      // see #493
570
      // IGNORE(latin1_length_from_utf16, convert_valid_utf16be_to_latin1),
571
1
      ADD(utf32_length_from_utf16be, convert_valid_utf16be_to_utf32),
572
1
      ADD(utf8_length_from_utf16be, convert_valid_utf16be_to_utf8),
573
574
      //  see #493
575
      // IGNORE(latin1_length_from_utf16, convert_valid_utf16le_to_latin1),
576
1
      ADD(utf32_length_from_utf16le, convert_valid_utf16le_to_utf32),
577
1
      ADD(utf8_length_from_utf16le, convert_valid_utf16le_to_utf8),
578
579
      // see #493
580
      // IGNORE(latin1_length_from_utf32, convert_valid_utf32_to_latin1),
581
1
      ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16be),
582
1
      ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16le),
583
1
      ADD(utf8_length_from_utf32, convert_valid_utf32_to_utf8),
584
585
      // see #493
586
      // IGNORE(latin1_length_from_utf8, convert_valid_utf8_to_latin1),
587
1
      ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16be),
588
1
      ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16le),
589
1
      ADD(utf32_length_from_utf8, convert_valid_utf8_to_utf32),
590
591
      // all these cases operate on arbitrary data
592
1
      ADD(latin1_length_from_utf16, convert_utf16be_to_latin1),
593
1
      ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32),
594
1
      ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8),
595
596
1
      ADD(latin1_length_from_utf16, convert_utf16le_to_latin1),
597
1
      ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32),
598
1
      ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8),
599
600
1
      ADD(latin1_length_from_utf32, convert_utf32_to_latin1),
601
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16be),
602
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16le),
603
1
      ADD(utf8_length_from_utf32, convert_utf32_to_utf8),
604
605
1
      ADD(latin1_length_from_utf8, convert_utf8_to_latin1),
606
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16be),
607
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16le),
608
1
      ADD(utf32_length_from_utf8, convert_utf8_to_utf32),
609
610
      // all these cases operate on arbitrary data and use the _with_errors
611
      // variant
612
1
      ADD(latin1_length_from_utf16, convert_utf16be_to_latin1_with_errors),
613
1
      ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32_with_errors),
614
1
      ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8_with_errors),
615
616
1
      ADD(latin1_length_from_utf16, convert_utf16le_to_latin1_with_errors),
617
1
      ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32_with_errors),
618
1
      ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8_with_errors),
619
620
1
      ADD(latin1_length_from_utf32, convert_utf32_to_latin1_with_errors),
621
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16be_with_errors),
622
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16le_with_errors),
623
1
      ADD(utf8_length_from_utf32, convert_utf32_to_utf8_with_errors),
624
625
1
      ADD(latin1_length_from_utf8, convert_utf8_to_latin1_with_errors),
626
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16be_with_errors),
627
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16le_with_errors),
628
1
      ADD(utf32_length_from_utf8, convert_utf8_to_utf32_with_errors),
629
630
      // these are a bit special since all input is valid
631
1
      ADD(utf32_length_from_latin1, convert_latin1_to_utf32),
632
1
      ADD(utf16_length_from_latin1, convert_latin1_to_utf16be),
633
1
      ADD(utf16_length_from_latin1, convert_latin1_to_utf16le),
634
1
      ADD(utf8_length_from_latin1, convert_latin1_to_utf8)};
635
636
1
#undef ADD
637
1
}
638
639
8.87k
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
640
8.87k
  static const auto fptrs = populate_functions();
641
8.87k
  constexpr std::size_t Ncases = fptrs.size();
642
643
  // pick one of the function pointers, based on the fuzz data
644
  // the first byte is which action to take. step forward
645
  // several bytes so the input is aligned.
646
8.87k
  if (size < 4) {
647
3
    return 0;
648
3
  }
649
650
8.87k
  constexpr auto actionmask = std::bit_ceil(Ncases) - 1;
651
8.87k
  const auto action = data[0] & actionmask;
652
8.87k
  data += 4;
653
8.87k
  size -= 4;
654
655
8.87k
  if (action >= Ncases) {
656
1
    return 0;
657
1
  }
658
659
8.87k
  if constexpr (use_separate_allocation) {
660
    // this is better at exercising null input and catch buffer underflows
661
8.87k
    const std::vector<char> separate{data, data + size};
662
8.87k
    fptrs[action](std::span(separate));
663
  } else {
664
    std::span<const char> chardata{(const char*)data, size};
665
    fptrs[action](chardata);
666
  }
667
668
8.87k
  return 0;
669
8.87k
}