Coverage Report

Created: 2026-07-25 06:54

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
9.24k
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
9.24k
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
9.24k
                        chardata.size() / sizeof(FromType)};
179
180
9.24k
    static const bool do_print_testcase =
181
9.24k
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
9.24k
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
9.24k
    do {
189
      // step 0 - is the input valid?
190
9.24k
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
9.24k
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
6.18k
                    From == UtfEncodings::UTF8) {
198
6.18k
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
6.18k
      }
201
202
      // step 2 - what is the required size of the output?
203
6.18k
      const auto [output_length, length_agree] =
204
9.24k
          calculate_length(from, inputisvalid);
205
9.24k
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
9.24k
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
103
        return;
211
103
      }
212
213
      // step 3 - run the conversion
214
9.13k
      const auto [written, outputs_agree] =
215
9.13k
          do_conversion(from, output_length, inputisvalid);
216
9.13k
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
9.13k
      return;
221
9.13k
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
9.24k
  }
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
209
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
209
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
209
                        chardata.size() / sizeof(FromType)};
179
180
209
    static const bool do_print_testcase =
181
209
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
209
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
209
    do {
189
      // step 0 - is the input valid?
190
209
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
209
      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
209
                    From == UtfEncodings::UTF8) {
198
209
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
209
      }
201
202
      // step 2 - what is the required size of the output?
203
209
      const auto [output_length, length_agree] =
204
209
          calculate_length(from, inputisvalid);
205
209
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
209
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
13
        return;
211
13
      }
212
213
      // step 3 - run the conversion
214
196
      const auto [written, outputs_agree] =
215
196
          do_conversion(from, output_length, inputisvalid);
216
196
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
196
      return;
221
196
    } 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
209
  }
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
392
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
392
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
392
                        chardata.size() / sizeof(FromType)};
179
180
392
    static const bool do_print_testcase =
181
392
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
392
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
392
    do {
189
      // step 0 - is the input valid?
190
392
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
392
      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
392
                    From == UtfEncodings::UTF8) {
198
392
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
392
      }
201
202
      // step 2 - what is the required size of the output?
203
392
      const auto [output_length, length_agree] =
204
392
          calculate_length(from, inputisvalid);
205
392
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
392
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
17
        return;
211
17
      }
212
213
      // step 3 - run the conversion
214
375
      const auto [written, outputs_agree] =
215
375
          do_conversion(from, output_length, inputisvalid);
216
375
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
375
      return;
221
375
    } 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
392
  }
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
211
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
211
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
211
                        chardata.size() / sizeof(FromType)};
179
180
211
    static const bool do_print_testcase =
181
211
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
211
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
211
    do {
189
      // step 0 - is the input valid?
190
211
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
211
      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
211
                    From == UtfEncodings::UTF8) {
198
211
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
211
      }
201
202
      // step 2 - what is the required size of the output?
203
211
      const auto [output_length, length_agree] =
204
211
          calculate_length(from, inputisvalid);
205
211
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
211
      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
206
      const auto [written, outputs_agree] =
215
206
          do_conversion(from, output_length, inputisvalid);
216
206
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
206
      return;
221
206
    } 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
211
  }
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
444
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
444
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
444
                        chardata.size() / sizeof(FromType)};
179
180
444
    static const bool do_print_testcase =
181
444
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
444
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
444
    do {
189
      // step 0 - is the input valid?
190
444
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
444
      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
444
                    From == UtfEncodings::UTF8) {
198
444
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
444
      }
201
202
      // step 2 - what is the required size of the output?
203
444
      const auto [output_length, length_agree] =
204
444
          calculate_length(from, inputisvalid);
205
444
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
444
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
16
        return;
211
16
      }
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
444
  }
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
333
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
333
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
333
                        chardata.size() / sizeof(FromType)};
179
180
333
    static const bool do_print_testcase =
181
333
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
333
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
333
    do {
189
      // step 0 - is the input valid?
190
333
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
333
      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
333
      const auto [output_length, length_agree] =
204
333
          calculate_length(from, inputisvalid);
205
333
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
333
      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
331
      const auto [written, outputs_agree] =
215
331
          do_conversion(from, output_length, inputisvalid);
216
331
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
331
      return;
221
331
    } 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
333
  }
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
394
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
394
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
394
                        chardata.size() / sizeof(FromType)};
179
180
394
    static const bool do_print_testcase =
181
394
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
394
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
394
    do {
189
      // step 0 - is the input valid?
190
394
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
394
      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
394
      const auto [output_length, length_agree] =
204
394
          calculate_length(from, inputisvalid);
205
394
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
394
      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
387
      const auto [written, outputs_agree] =
215
387
          do_conversion(from, output_length, inputisvalid);
216
387
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
387
      return;
221
387
    } 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
394
  }
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
470
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
470
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
470
                        chardata.size() / sizeof(FromType)};
179
180
470
    static const bool do_print_testcase =
181
470
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
470
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
470
    do {
189
      // step 0 - is the input valid?
190
470
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
470
      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
470
      const auto [output_length, length_agree] =
204
470
          calculate_length(from, inputisvalid);
205
470
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
470
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
12
        return;
211
12
      }
212
213
      // step 3 - run the conversion
214
458
      const auto [written, outputs_agree] =
215
458
          do_conversion(from, output_length, inputisvalid);
216
458
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
458
      return;
221
458
    } 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
470
  }
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
626
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
626
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
626
                        chardata.size() / sizeof(FromType)};
179
180
626
    static const bool do_print_testcase =
181
626
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
626
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
626
    do {
189
      // step 0 - is the input valid?
190
626
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
626
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
626
                    From == UtfEncodings::UTF8) {
198
626
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
626
      }
201
202
      // step 2 - what is the required size of the output?
203
626
      const auto [output_length, length_agree] =
204
626
          calculate_length(from, inputisvalid);
205
626
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
626
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
10
        return;
211
10
      }
212
213
      // step 3 - run the conversion
214
616
      const auto [written, outputs_agree] =
215
616
          do_conversion(from, output_length, inputisvalid);
216
616
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
616
      return;
221
616
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
626
  }
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
599
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
599
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
599
                        chardata.size() / sizeof(FromType)};
179
180
599
    static const bool do_print_testcase =
181
599
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
599
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
599
    do {
189
      // step 0 - is the input valid?
190
599
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
599
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
599
                    From == UtfEncodings::UTF8) {
198
599
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
599
      }
201
202
      // step 2 - what is the required size of the output?
203
599
      const auto [output_length, length_agree] =
204
599
          calculate_length(from, inputisvalid);
205
599
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
599
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
17
        return;
211
17
      }
212
213
      // step 3 - run the conversion
214
582
      const auto [written, outputs_agree] =
215
582
          do_conversion(from, output_length, inputisvalid);
216
582
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
582
      return;
221
582
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
599
  }
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
621
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
621
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
621
                        chardata.size() / sizeof(FromType)};
179
180
621
    static const bool do_print_testcase =
181
621
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
621
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
621
    do {
189
      // step 0 - is the input valid?
190
621
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
621
      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
621
                    From == UtfEncodings::UTF8) {
198
621
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
621
      }
201
202
      // step 2 - what is the required size of the output?
203
621
      const auto [output_length, length_agree] =
204
621
          calculate_length(from, inputisvalid);
205
621
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
621
      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
617
      const auto [written, outputs_agree] =
215
617
          do_conversion(from, output_length, inputisvalid);
216
617
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
617
      return;
221
617
    } 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
621
  }
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
47
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
47
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
47
                        chardata.size() / sizeof(FromType)};
179
180
47
    static const bool do_print_testcase =
181
47
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
47
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
47
    do {
189
      // step 0 - is the input valid?
190
47
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
47
      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
47
                    From == UtfEncodings::UTF8) {
198
47
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
47
      }
201
202
      // step 2 - what is the required size of the output?
203
47
      const auto [output_length, length_agree] =
204
47
          calculate_length(from, inputisvalid);
205
47
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
47
      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
47
      const auto [written, outputs_agree] =
215
47
          do_conversion(from, output_length, inputisvalid);
216
47
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
47
      return;
221
47
    } 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
47
  }
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
67
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
67
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
67
                        chardata.size() / sizeof(FromType)};
179
180
67
    static const bool do_print_testcase =
181
67
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
67
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
67
    do {
189
      // step 0 - is the input valid?
190
67
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
67
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
67
                    From == UtfEncodings::UTF8) {
198
67
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
67
      }
201
202
      // step 2 - what is the required size of the output?
203
67
      const auto [output_length, length_agree] =
204
67
          calculate_length(from, inputisvalid);
205
67
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
67
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
67
      const auto [written, outputs_agree] =
215
67
          do_conversion(from, output_length, inputisvalid);
216
67
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
67
      return;
221
67
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
67
  }
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
86
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
86
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
86
                        chardata.size() / sizeof(FromType)};
179
180
86
    static const bool do_print_testcase =
181
86
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
86
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
86
    do {
189
      // step 0 - is the input valid?
190
86
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
86
      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
86
      const auto [output_length, length_agree] =
204
86
          calculate_length(from, inputisvalid);
205
86
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
86
      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
86
      const auto [written, outputs_agree] =
215
86
          do_conversion(from, output_length, inputisvalid);
216
86
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
86
      return;
221
86
    } 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
86
  }
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
295
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
295
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
295
                        chardata.size() / sizeof(FromType)};
179
180
295
    static const bool do_print_testcase =
181
295
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
295
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
295
    do {
189
      // step 0 - is the input valid?
190
295
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
295
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
295
                    From == UtfEncodings::UTF8) {
198
295
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
295
      }
201
202
      // step 2 - what is the required size of the output?
203
295
      const auto [output_length, length_agree] =
204
295
          calculate_length(from, inputisvalid);
205
295
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
295
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
295
      const auto [written, outputs_agree] =
215
295
          do_conversion(from, output_length, inputisvalid);
216
295
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
295
      return;
221
295
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
295
  }
Conversion<(UtfEncodings)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
125
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
125
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
125
                        chardata.size() / sizeof(FromType)};
179
180
125
    static const bool do_print_testcase =
181
125
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
125
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
125
    do {
189
      // step 0 - is the input valid?
190
125
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
125
      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
125
                    From == UtfEncodings::UTF8) {
198
125
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
125
      }
201
202
      // step 2 - what is the required size of the output?
203
125
      const auto [output_length, length_agree] =
204
125
          calculate_length(from, inputisvalid);
205
125
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
125
      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
125
      const auto [written, outputs_agree] =
215
125
          do_conversion(from, output_length, inputisvalid);
216
125
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
125
      return;
221
125
    } 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
125
  }
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
173
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
173
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
173
                        chardata.size() / sizeof(FromType)};
179
180
173
    static const bool do_print_testcase =
181
173
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
173
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
173
    do {
189
      // step 0 - is the input valid?
190
173
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
173
      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
173
                    From == UtfEncodings::UTF8) {
198
173
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
173
      }
201
202
      // step 2 - what is the required size of the output?
203
173
      const auto [output_length, length_agree] =
204
173
          calculate_length(from, inputisvalid);
205
173
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
173
      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
173
      const auto [written, outputs_agree] =
215
173
          do_conversion(from, output_length, inputisvalid);
216
173
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
173
      return;
221
173
    } 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
173
  }
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
364
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
364
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
364
                        chardata.size() / sizeof(FromType)};
179
180
364
    static const bool do_print_testcase =
181
364
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
364
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
364
    do {
189
      // step 0 - is the input valid?
190
364
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
364
      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
364
                    From == UtfEncodings::UTF8) {
198
364
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
364
      }
201
202
      // step 2 - what is the required size of the output?
203
364
      const auto [output_length, length_agree] =
204
364
          calculate_length(from, inputisvalid);
205
364
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
364
      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
364
      const auto [written, outputs_agree] =
215
364
          do_conversion(from, output_length, inputisvalid);
216
364
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
364
      return;
221
364
    } 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
364
  }
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
139
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
139
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
139
                        chardata.size() / sizeof(FromType)};
179
180
139
    static const bool do_print_testcase =
181
139
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
139
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
139
    do {
189
      // step 0 - is the input valid?
190
139
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
139
      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
139
                    From == UtfEncodings::UTF8) {
198
139
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
139
      }
201
202
      // step 2 - what is the required size of the output?
203
139
      const auto [output_length, length_agree] =
204
139
          calculate_length(from, inputisvalid);
205
139
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
139
      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
139
      const auto [written, outputs_agree] =
215
139
          do_conversion(from, output_length, inputisvalid);
216
139
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
139
      return;
221
139
    } 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
139
  }
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
209
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
209
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
209
                        chardata.size() / sizeof(FromType)};
179
180
209
    static const bool do_print_testcase =
181
209
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
209
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
209
    do {
189
      // step 0 - is the input valid?
190
209
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
209
      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
209
                    From == UtfEncodings::UTF8) {
198
209
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
209
      }
201
202
      // step 2 - what is the required size of the output?
203
209
      const auto [output_length, length_agree] =
204
209
          calculate_length(from, inputisvalid);
205
209
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
209
      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
209
      const auto [written, outputs_agree] =
215
209
          do_conversion(from, output_length, inputisvalid);
216
209
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
209
      return;
221
209
    } 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
209
  }
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
332
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
332
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
332
                        chardata.size() / sizeof(FromType)};
179
180
332
    static const bool do_print_testcase =
181
332
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
332
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
332
    do {
189
      // step 0 - is the input valid?
190
332
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
332
      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
332
                    From == UtfEncodings::UTF8) {
198
332
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
332
      }
201
202
      // step 2 - what is the required size of the output?
203
332
      const auto [output_length, length_agree] =
204
332
          calculate_length(from, inputisvalid);
205
332
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
332
      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
332
      const auto [written, outputs_agree] =
215
332
          do_conversion(from, output_length, inputisvalid);
216
332
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
332
      return;
221
332
    } 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
332
  }
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
204
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
204
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
204
                        chardata.size() / sizeof(FromType)};
179
180
204
    static const bool do_print_testcase =
181
204
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
204
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
204
    do {
189
      // step 0 - is the input valid?
190
204
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
204
      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
204
      const auto [output_length, length_agree] =
204
204
          calculate_length(from, inputisvalid);
205
204
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
204
      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
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
204
  }
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
315
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
315
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
315
                        chardata.size() / sizeof(FromType)};
179
180
315
    static const bool do_print_testcase =
181
315
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
315
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
315
    do {
189
      // step 0 - is the input valid?
190
315
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
315
      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
315
      const auto [output_length, length_agree] =
204
315
          calculate_length(from, inputisvalid);
205
315
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
315
      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
315
      const auto [written, outputs_agree] =
215
315
          do_conversion(from, output_length, inputisvalid);
216
315
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
315
      return;
221
315
    } 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
315
  }
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
342
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
342
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
342
                        chardata.size() / sizeof(FromType)};
179
180
342
    static const bool do_print_testcase =
181
342
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
342
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
342
    do {
189
      // step 0 - is the input valid?
190
342
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
342
      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
342
      const auto [output_length, length_agree] =
204
342
          calculate_length(from, inputisvalid);
205
342
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
342
      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
342
      const auto [written, outputs_agree] =
215
342
          do_conversion(from, output_length, inputisvalid);
216
342
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
342
      return;
221
342
    } 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
342
  }
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
467
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
467
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
467
                        chardata.size() / sizeof(FromType)};
179
180
467
    static const bool do_print_testcase =
181
467
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
467
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
467
    do {
189
      // step 0 - is the input valid?
190
467
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
467
      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
467
      const auto [output_length, length_agree] =
204
467
          calculate_length(from, inputisvalid);
205
467
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
467
      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
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
467
  }
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
251
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
251
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
251
                        chardata.size() / sizeof(FromType)};
179
180
251
    static const bool do_print_testcase =
181
251
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
251
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
251
    do {
189
      // step 0 - is the input valid?
190
251
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
251
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
251
                    From == UtfEncodings::UTF8) {
198
251
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
251
      }
201
202
      // step 2 - what is the required size of the output?
203
251
      const auto [output_length, length_agree] =
204
251
          calculate_length(from, inputisvalid);
205
251
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
251
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
251
      const auto [written, outputs_agree] =
215
251
          do_conversion(from, output_length, inputisvalid);
216
251
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
251
      return;
221
251
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
251
  }
Conversion<(UtfEncodings)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
377
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
377
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
377
                        chardata.size() / sizeof(FromType)};
179
180
377
    static const bool do_print_testcase =
181
377
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
377
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
377
    do {
189
      // step 0 - is the input valid?
190
377
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
377
      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
377
                    From == UtfEncodings::UTF8) {
198
377
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
377
      }
201
202
      // step 2 - what is the required size of the output?
203
377
      const auto [output_length, length_agree] =
204
377
          calculate_length(from, inputisvalid);
205
377
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
377
      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
377
      const auto [written, outputs_agree] =
215
377
          do_conversion(from, output_length, inputisvalid);
216
377
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
377
      return;
221
377
    } 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
377
  }
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
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
306
                    From == UtfEncodings::UTF8) {
198
306
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
306
      }
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
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
306
      const auto [written, outputs_agree] =
215
306
          do_conversion(from, output_length, inputisvalid);
216
306
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
306
      return;
221
306
    } 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)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
397
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
397
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
397
                        chardata.size() / sizeof(FromType)};
179
180
397
    static const bool do_print_testcase =
181
397
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
397
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
397
    do {
189
      // step 0 - is the input valid?
190
397
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
397
      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
397
                    From == UtfEncodings::UTF8) {
198
397
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
397
      }
201
202
      // step 2 - what is the required size of the output?
203
397
      const auto [output_length, length_agree] =
204
397
          calculate_length(from, inputisvalid);
205
397
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
397
      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
397
      const auto [written, outputs_agree] =
215
397
          do_conversion(from, output_length, inputisvalid);
216
397
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
397
      return;
221
397
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
397
  }
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
55
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
55
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
55
                        chardata.size() / sizeof(FromType)};
179
180
55
    static const bool do_print_testcase =
181
55
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
55
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
55
    do {
189
      // step 0 - is the input valid?
190
55
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
55
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    From == UtfEncodings::UTF8) {
198
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
          break;
200
      }
201
202
      // step 2 - what is the required size of the output?
203
55
      const auto [output_length, length_agree] =
204
55
          calculate_length(from, inputisvalid);
205
55
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
55
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
55
      const auto [written, outputs_agree] =
215
55
          do_conversion(from, output_length, inputisvalid);
216
55
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
55
      return;
221
55
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
55
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
44
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
44
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
44
                        chardata.size() / sizeof(FromType)};
179
180
44
    static const bool do_print_testcase =
181
44
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
44
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
44
    do {
189
      // step 0 - is the input valid?
190
44
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
44
      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
44
      const auto [output_length, length_agree] =
204
44
          calculate_length(from, inputisvalid);
205
44
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
44
      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
44
      const auto [written, outputs_agree] =
215
44
          do_conversion(from, output_length, inputisvalid);
216
44
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
44
      return;
221
44
    } 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
44
  }
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
43
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
43
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
43
                        chardata.size() / sizeof(FromType)};
179
180
43
    static const bool do_print_testcase =
181
43
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
43
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
43
    do {
189
      // step 0 - is the input valid?
190
43
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
43
      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
43
      const auto [output_length, length_agree] =
204
43
          calculate_length(from, inputisvalid);
205
43
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
43
      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
43
      const auto [written, outputs_agree] =
215
43
          do_conversion(from, output_length, inputisvalid);
216
43
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
43
      return;
221
43
    } 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
43
  }
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
303
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
303
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
303
                        chardata.size() / sizeof(FromType)};
179
180
303
    static const bool do_print_testcase =
181
303
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
303
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
303
    do {
189
      // step 0 - is the input valid?
190
303
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
303
      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
303
      const auto [output_length, length_agree] =
204
303
          calculate_length(from, inputisvalid);
205
303
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
303
      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
303
      const auto [written, outputs_agree] =
215
303
          do_conversion(from, output_length, inputisvalid);
216
303
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
303
      return;
221
303
    } 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
303
  }
227
228
  template <typename Dummy = void>
229
    requires(From != UtfEncodings::LATIN1)
230
8.79k
  validation_result verify_valid_input(FromSpan src) const {
231
8.79k
    validation_result ret{};
232
233
8.79k
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
8.79k
    const auto implementations = get_supported_implementations();
235
8.79k
    std::vector<simdutf::result> results;
236
8.79k
    results.reserve(implementations.size());
237
238
26.3k
    for (auto impl : implementations) {
239
26.3k
      results.push_back(
240
26.3k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
26.3k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
26.3k
      const bool validation2 =
245
26.3k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
26.3k
                      src.data(), src.size());
247
26.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
26.3k
    }
258
259
17.5k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
418
    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
784
    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
422
    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
888
    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
666
    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
788
    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
940
    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.25k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
1.19k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
1.24k
    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
94
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
172
    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
590
    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
250
    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
346
    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
728
    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
278
    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
418
    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
664
    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
408
    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
630
    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
684
    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
934
    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
502
    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
754
    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
612
    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
794
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
8.79k
    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.79k
    } else {
273
8.79k
      ret.implementations_agree = true;
274
8.79k
    }
275
17.4k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
17.4k
      return r.error == simdutf::SUCCESS;
277
17.4k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
461
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
461
      return r.error == simdutf::SUCCESS;
277
461
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
988
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
988
      return r.error == simdutf::SUCCESS;
277
988
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
451
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
451
      return r.error == simdutf::SUCCESS;
277
451
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.09k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.09k
      return r.error == simdutf::SUCCESS;
277
1.09k
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
619
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
619
      return r.error == simdutf::SUCCESS;
277
619
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
796
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
796
      return r.error == simdutf::SUCCESS;
277
796
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
788
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
788
      return r.error == simdutf::SUCCESS;
277
788
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.30k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.30k
      return r.error == simdutf::SUCCESS;
277
1.30k
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.27k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.27k
      return r.error == simdutf::SUCCESS;
277
1.27k
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
1.32k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.32k
      return r.error == simdutf::SUCCESS;
277
1.32k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
123
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
123
      return r.error == simdutf::SUCCESS;
277
123
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
163
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
163
      return r.error == simdutf::SUCCESS;
277
163
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
140
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
140
      return r.error == simdutf::SUCCESS;
277
140
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
493
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
493
      return r.error == simdutf::SUCCESS;
277
493
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
335
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
335
      return r.error == simdutf::SUCCESS;
277
335
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
339
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
339
      return r.error == simdutf::SUCCESS;
277
339
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
786
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
786
      return r.error == simdutf::SUCCESS;
277
786
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
339
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
339
      return r.error == simdutf::SUCCESS;
277
339
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
391
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
391
      return r.error == simdutf::SUCCESS;
277
391
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
726
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
726
      return r.error == simdutf::SUCCESS;
277
726
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
266
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
266
      return r.error == simdutf::SUCCESS;
277
266
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
487
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
487
      return r.error == simdutf::SUCCESS;
277
487
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
522
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
522
      return r.error == simdutf::SUCCESS;
277
522
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
701
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
701
      return r.error == simdutf::SUCCESS;
277
701
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
485
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
485
      return r.error == simdutf::SUCCESS;
277
485
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
703
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
703
      return r.error == simdutf::SUCCESS;
277
703
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
564
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
564
      return r.error == simdutf::SUCCESS;
277
564
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
757
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
757
      return r.error == simdutf::SUCCESS;
277
757
    });
278
8.79k
    return ret;
279
8.79k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
209
  validation_result verify_valid_input(FromSpan src) const {
231
209
    validation_result ret{};
232
233
209
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
209
    const auto implementations = get_supported_implementations();
235
209
    std::vector<simdutf::result> results;
236
209
    results.reserve(implementations.size());
237
238
627
    for (auto impl : implementations) {
239
627
      results.push_back(
240
627
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
627
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
627
      const bool validation2 =
245
627
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
627
                      src.data(), src.size());
247
627
      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
627
    }
258
259
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
209
    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
209
    } else {
273
209
      ret.implementations_agree = true;
274
209
    }
275
209
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
209
      return r.error == simdutf::SUCCESS;
277
209
    });
278
209
    return ret;
279
209
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
392
  validation_result verify_valid_input(FromSpan src) const {
231
392
    validation_result ret{};
232
233
392
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
392
    const auto implementations = get_supported_implementations();
235
392
    std::vector<simdutf::result> results;
236
392
    results.reserve(implementations.size());
237
238
1.17k
    for (auto impl : implementations) {
239
1.17k
      results.push_back(
240
1.17k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.17k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.17k
      const bool validation2 =
245
1.17k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.17k
                      src.data(), src.size());
247
1.17k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.17k
    }
258
259
392
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
392
    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
392
    } else {
273
392
      ret.implementations_agree = true;
274
392
    }
275
392
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
392
      return r.error == simdutf::SUCCESS;
277
392
    });
278
392
    return ret;
279
392
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
211
  validation_result verify_valid_input(FromSpan src) const {
231
211
    validation_result ret{};
232
233
211
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
211
    const auto implementations = get_supported_implementations();
235
211
    std::vector<simdutf::result> results;
236
211
    results.reserve(implementations.size());
237
238
633
    for (auto impl : implementations) {
239
633
      results.push_back(
240
633
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
633
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
633
      const bool validation2 =
245
633
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
633
                      src.data(), src.size());
247
633
      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
633
    }
258
259
211
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
211
    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
211
    } else {
273
211
      ret.implementations_agree = true;
274
211
    }
275
211
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
211
      return r.error == simdutf::SUCCESS;
277
211
    });
278
211
    return ret;
279
211
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
444
  validation_result verify_valid_input(FromSpan src) const {
231
444
    validation_result ret{};
232
233
444
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
444
    const auto implementations = get_supported_implementations();
235
444
    std::vector<simdutf::result> results;
236
444
    results.reserve(implementations.size());
237
238
1.33k
    for (auto impl : implementations) {
239
1.33k
      results.push_back(
240
1.33k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.33k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.33k
      const bool validation2 =
245
1.33k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.33k
                      src.data(), src.size());
247
1.33k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.33k
    }
258
259
444
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
444
    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
444
    } else {
273
444
      ret.implementations_agree = true;
274
444
    }
275
444
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
444
      return r.error == simdutf::SUCCESS;
277
444
    });
278
444
    return ret;
279
444
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
333
  validation_result verify_valid_input(FromSpan src) const {
231
333
    validation_result ret{};
232
233
333
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
333
    const auto implementations = get_supported_implementations();
235
333
    std::vector<simdutf::result> results;
236
333
    results.reserve(implementations.size());
237
238
999
    for (auto impl : implementations) {
239
999
      results.push_back(
240
999
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
999
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
999
      const bool validation2 =
245
999
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
999
                      src.data(), src.size());
247
999
      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
999
    }
258
259
333
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
333
    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
333
    } else {
273
333
      ret.implementations_agree = true;
274
333
    }
275
333
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
333
      return r.error == simdutf::SUCCESS;
277
333
    });
278
333
    return ret;
279
333
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
394
  validation_result verify_valid_input(FromSpan src) const {
231
394
    validation_result ret{};
232
233
394
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
394
    const auto implementations = get_supported_implementations();
235
394
    std::vector<simdutf::result> results;
236
394
    results.reserve(implementations.size());
237
238
1.18k
    for (auto impl : implementations) {
239
1.18k
      results.push_back(
240
1.18k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.18k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.18k
      const bool validation2 =
245
1.18k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.18k
                      src.data(), src.size());
247
1.18k
      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.18k
    }
258
259
394
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
394
    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
394
    } else {
273
394
      ret.implementations_agree = true;
274
394
    }
275
394
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
394
      return r.error == simdutf::SUCCESS;
277
394
    });
278
394
    return ret;
279
394
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
470
  validation_result verify_valid_input(FromSpan src) const {
231
470
    validation_result ret{};
232
233
470
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
470
    const auto implementations = get_supported_implementations();
235
470
    std::vector<simdutf::result> results;
236
470
    results.reserve(implementations.size());
237
238
1.41k
    for (auto impl : implementations) {
239
1.41k
      results.push_back(
240
1.41k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.41k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.41k
      const bool validation2 =
245
1.41k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.41k
                      src.data(), src.size());
247
1.41k
      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.41k
    }
258
259
470
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
470
    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
470
    } else {
273
470
      ret.implementations_agree = true;
274
470
    }
275
470
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
470
      return r.error == simdutf::SUCCESS;
277
470
    });
278
470
    return ret;
279
470
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
626
  validation_result verify_valid_input(FromSpan src) const {
231
626
    validation_result ret{};
232
233
626
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
626
    const auto implementations = get_supported_implementations();
235
626
    std::vector<simdutf::result> results;
236
626
    results.reserve(implementations.size());
237
238
1.87k
    for (auto impl : implementations) {
239
1.87k
      results.push_back(
240
1.87k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.87k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.87k
      const bool validation2 =
245
1.87k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.87k
                      src.data(), src.size());
247
1.87k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.87k
    }
258
259
626
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
626
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
626
    } else {
273
626
      ret.implementations_agree = true;
274
626
    }
275
626
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
626
      return r.error == simdutf::SUCCESS;
277
626
    });
278
626
    return ret;
279
626
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
599
  validation_result verify_valid_input(FromSpan src) const {
231
599
    validation_result ret{};
232
233
599
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
599
    const auto implementations = get_supported_implementations();
235
599
    std::vector<simdutf::result> results;
236
599
    results.reserve(implementations.size());
237
238
1.79k
    for (auto impl : implementations) {
239
1.79k
      results.push_back(
240
1.79k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.79k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.79k
      const bool validation2 =
245
1.79k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.79k
                      src.data(), src.size());
247
1.79k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.79k
    }
258
259
599
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
599
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
599
    } else {
273
599
      ret.implementations_agree = true;
274
599
    }
275
599
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
599
      return r.error == simdutf::SUCCESS;
277
599
    });
278
599
    return ret;
279
599
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
621
  validation_result verify_valid_input(FromSpan src) const {
231
621
    validation_result ret{};
232
233
621
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
621
    const auto implementations = get_supported_implementations();
235
621
    std::vector<simdutf::result> results;
236
621
    results.reserve(implementations.size());
237
238
1.86k
    for (auto impl : implementations) {
239
1.86k
      results.push_back(
240
1.86k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.86k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.86k
      const bool validation2 =
245
1.86k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.86k
                      src.data(), src.size());
247
1.86k
      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.86k
    }
258
259
621
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
621
    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
621
    } else {
273
621
      ret.implementations_agree = true;
274
621
    }
275
621
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
621
      return r.error == simdutf::SUCCESS;
277
621
    });
278
621
    return ret;
279
621
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
47
  validation_result verify_valid_input(FromSpan src) const {
231
47
    validation_result ret{};
232
233
47
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
47
    const auto implementations = get_supported_implementations();
235
47
    std::vector<simdutf::result> results;
236
47
    results.reserve(implementations.size());
237
238
141
    for (auto impl : implementations) {
239
141
      results.push_back(
240
141
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
141
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
141
      const bool validation2 =
245
141
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
141
                      src.data(), src.size());
247
141
      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
141
    }
258
259
47
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
47
    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
47
    } else {
273
47
      ret.implementations_agree = true;
274
47
    }
275
47
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
47
      return r.error == simdutf::SUCCESS;
277
47
    });
278
47
    return ret;
279
47
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
67
  validation_result verify_valid_input(FromSpan src) const {
231
67
    validation_result ret{};
232
233
67
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
67
    const auto implementations = get_supported_implementations();
235
67
    std::vector<simdutf::result> results;
236
67
    results.reserve(implementations.size());
237
238
201
    for (auto impl : implementations) {
239
201
      results.push_back(
240
201
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
201
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
201
      const bool validation2 =
245
201
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
201
                      src.data(), src.size());
247
201
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
201
    }
258
259
67
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
67
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
67
    } else {
273
67
      ret.implementations_agree = true;
274
67
    }
275
67
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
67
      return r.error == simdutf::SUCCESS;
277
67
    });
278
67
    return ret;
279
67
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
86
  validation_result verify_valid_input(FromSpan src) const {
231
86
    validation_result ret{};
232
233
86
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
86
    const auto implementations = get_supported_implementations();
235
86
    std::vector<simdutf::result> results;
236
86
    results.reserve(implementations.size());
237
238
258
    for (auto impl : implementations) {
239
258
      results.push_back(
240
258
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
258
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
258
      const bool validation2 =
245
258
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
258
                      src.data(), src.size());
247
258
      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
258
    }
258
259
86
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
86
    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
86
    } else {
273
86
      ret.implementations_agree = true;
274
86
    }
275
86
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
86
      return r.error == simdutf::SUCCESS;
277
86
    });
278
86
    return ret;
279
86
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
295
  validation_result verify_valid_input(FromSpan src) const {
231
295
    validation_result ret{};
232
233
295
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
295
    const auto implementations = get_supported_implementations();
235
295
    std::vector<simdutf::result> results;
236
295
    results.reserve(implementations.size());
237
238
885
    for (auto impl : implementations) {
239
885
      results.push_back(
240
885
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
885
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
885
      const bool validation2 =
245
885
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
885
                      src.data(), src.size());
247
885
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
885
    }
258
259
295
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
295
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
295
    } else {
273
295
      ret.implementations_agree = true;
274
295
    }
275
295
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
295
      return r.error == simdutf::SUCCESS;
277
295
    });
278
295
    return ret;
279
295
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
125
  validation_result verify_valid_input(FromSpan src) const {
231
125
    validation_result ret{};
232
233
125
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
125
    const auto implementations = get_supported_implementations();
235
125
    std::vector<simdutf::result> results;
236
125
    results.reserve(implementations.size());
237
238
375
    for (auto impl : implementations) {
239
375
      results.push_back(
240
375
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
375
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
375
      const bool validation2 =
245
375
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
375
                      src.data(), src.size());
247
375
      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
375
    }
258
259
125
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
125
    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
125
    } else {
273
125
      ret.implementations_agree = true;
274
125
    }
275
125
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
125
      return r.error == simdutf::SUCCESS;
277
125
    });
278
125
    return ret;
279
125
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
173
  validation_result verify_valid_input(FromSpan src) const {
231
173
    validation_result ret{};
232
233
173
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
173
    const auto implementations = get_supported_implementations();
235
173
    std::vector<simdutf::result> results;
236
173
    results.reserve(implementations.size());
237
238
519
    for (auto impl : implementations) {
239
519
      results.push_back(
240
519
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
519
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
519
      const bool validation2 =
245
519
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
519
                      src.data(), src.size());
247
519
      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
519
    }
258
259
173
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
173
    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
173
    } else {
273
173
      ret.implementations_agree = true;
274
173
    }
275
173
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
173
      return r.error == simdutf::SUCCESS;
277
173
    });
278
173
    return ret;
279
173
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
364
  validation_result verify_valid_input(FromSpan src) const {
231
364
    validation_result ret{};
232
233
364
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
364
    const auto implementations = get_supported_implementations();
235
364
    std::vector<simdutf::result> results;
236
364
    results.reserve(implementations.size());
237
238
1.09k
    for (auto impl : implementations) {
239
1.09k
      results.push_back(
240
1.09k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.09k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.09k
      const bool validation2 =
245
1.09k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.09k
                      src.data(), src.size());
247
1.09k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.09k
    }
258
259
364
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
364
    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
364
    } else {
273
364
      ret.implementations_agree = true;
274
364
    }
275
364
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
364
      return r.error == simdutf::SUCCESS;
277
364
    });
278
364
    return ret;
279
364
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
139
  validation_result verify_valid_input(FromSpan src) const {
231
139
    validation_result ret{};
232
233
139
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
139
    const auto implementations = get_supported_implementations();
235
139
    std::vector<simdutf::result> results;
236
139
    results.reserve(implementations.size());
237
238
417
    for (auto impl : implementations) {
239
417
      results.push_back(
240
417
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
417
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
417
      const bool validation2 =
245
417
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
417
                      src.data(), src.size());
247
417
      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
417
    }
258
259
139
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
139
    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
139
    } else {
273
139
      ret.implementations_agree = true;
274
139
    }
275
139
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
139
      return r.error == simdutf::SUCCESS;
277
139
    });
278
139
    return ret;
279
139
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
209
  validation_result verify_valid_input(FromSpan src) const {
231
209
    validation_result ret{};
232
233
209
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
209
    const auto implementations = get_supported_implementations();
235
209
    std::vector<simdutf::result> results;
236
209
    results.reserve(implementations.size());
237
238
627
    for (auto impl : implementations) {
239
627
      results.push_back(
240
627
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
627
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
627
      const bool validation2 =
245
627
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
627
                      src.data(), src.size());
247
627
      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
627
    }
258
259
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
209
    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
209
    } else {
273
209
      ret.implementations_agree = true;
274
209
    }
275
209
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
209
      return r.error == simdutf::SUCCESS;
277
209
    });
278
209
    return ret;
279
209
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
332
  validation_result verify_valid_input(FromSpan src) const {
231
332
    validation_result ret{};
232
233
332
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
332
    const auto implementations = get_supported_implementations();
235
332
    std::vector<simdutf::result> results;
236
332
    results.reserve(implementations.size());
237
238
996
    for (auto impl : implementations) {
239
996
      results.push_back(
240
996
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
996
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
996
      const bool validation2 =
245
996
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
996
                      src.data(), src.size());
247
996
      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
996
    }
258
259
332
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
332
    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
332
    } else {
273
332
      ret.implementations_agree = true;
274
332
    }
275
332
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
332
      return r.error == simdutf::SUCCESS;
277
332
    });
278
332
    return ret;
279
332
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
204
  validation_result verify_valid_input(FromSpan src) const {
231
204
    validation_result ret{};
232
233
204
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
204
    const auto implementations = get_supported_implementations();
235
204
    std::vector<simdutf::result> results;
236
204
    results.reserve(implementations.size());
237
238
612
    for (auto impl : implementations) {
239
612
      results.push_back(
240
612
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
612
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
612
      const bool validation2 =
245
612
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
612
                      src.data(), src.size());
247
612
      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
612
    }
258
259
204
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
204
    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
204
    } else {
273
204
      ret.implementations_agree = true;
274
204
    }
275
204
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
204
      return r.error == simdutf::SUCCESS;
277
204
    });
278
204
    return ret;
279
204
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
315
  validation_result verify_valid_input(FromSpan src) const {
231
315
    validation_result ret{};
232
233
315
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
315
    const auto implementations = get_supported_implementations();
235
315
    std::vector<simdutf::result> results;
236
315
    results.reserve(implementations.size());
237
238
945
    for (auto impl : implementations) {
239
945
      results.push_back(
240
945
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
945
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
945
      const bool validation2 =
245
945
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
945
                      src.data(), src.size());
247
945
      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
945
    }
258
259
315
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
315
    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
315
    } else {
273
315
      ret.implementations_agree = true;
274
315
    }
275
315
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
315
      return r.error == simdutf::SUCCESS;
277
315
    });
278
315
    return ret;
279
315
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
342
  validation_result verify_valid_input(FromSpan src) const {
231
342
    validation_result ret{};
232
233
342
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
342
    const auto implementations = get_supported_implementations();
235
342
    std::vector<simdutf::result> results;
236
342
    results.reserve(implementations.size());
237
238
1.02k
    for (auto impl : implementations) {
239
1.02k
      results.push_back(
240
1.02k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.02k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.02k
      const bool validation2 =
245
1.02k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.02k
                      src.data(), src.size());
247
1.02k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.02k
    }
258
259
342
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
342
    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
342
    } else {
273
342
      ret.implementations_agree = true;
274
342
    }
275
342
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
342
      return r.error == simdutf::SUCCESS;
277
342
    });
278
342
    return ret;
279
342
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
467
  validation_result verify_valid_input(FromSpan src) const {
231
467
    validation_result ret{};
232
233
467
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
467
    const auto implementations = get_supported_implementations();
235
467
    std::vector<simdutf::result> results;
236
467
    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
467
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
467
    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
467
    } else {
273
467
      ret.implementations_agree = true;
274
467
    }
275
467
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
467
      return r.error == simdutf::SUCCESS;
277
467
    });
278
467
    return ret;
279
467
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
251
  validation_result verify_valid_input(FromSpan src) const {
231
251
    validation_result ret{};
232
233
251
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
251
    const auto implementations = get_supported_implementations();
235
251
    std::vector<simdutf::result> results;
236
251
    results.reserve(implementations.size());
237
238
753
    for (auto impl : implementations) {
239
753
      results.push_back(
240
753
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
753
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
753
      const bool validation2 =
245
753
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
753
                      src.data(), src.size());
247
753
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
753
    }
258
259
251
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
251
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
251
    } else {
273
251
      ret.implementations_agree = true;
274
251
    }
275
251
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
251
      return r.error == simdutf::SUCCESS;
277
251
    });
278
251
    return ret;
279
251
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
377
  validation_result verify_valid_input(FromSpan src) const {
231
377
    validation_result ret{};
232
233
377
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
377
    const auto implementations = get_supported_implementations();
235
377
    std::vector<simdutf::result> results;
236
377
    results.reserve(implementations.size());
237
238
1.13k
    for (auto impl : implementations) {
239
1.13k
      results.push_back(
240
1.13k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.13k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.13k
      const bool validation2 =
245
1.13k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.13k
                      src.data(), src.size());
247
1.13k
      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.13k
    }
258
259
377
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
377
    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
377
    } else {
273
377
      ret.implementations_agree = true;
274
377
    }
275
377
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
377
      return r.error == simdutf::SUCCESS;
277
377
    });
278
377
    return ret;
279
377
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_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
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
397
  validation_result verify_valid_input(FromSpan src) const {
231
397
    validation_result ret{};
232
233
397
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
397
    const auto implementations = get_supported_implementations();
235
397
    std::vector<simdutf::result> results;
236
397
    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
397
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
397
    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
397
    } else {
273
397
      ret.implementations_agree = true;
274
397
    }
275
397
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
397
      return r.error == simdutf::SUCCESS;
277
397
    });
278
397
    return ret;
279
397
  }
280
281
  template <typename Dummy = void>
282
    requires(From == UtfEncodings::LATIN1)
283
445
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
445
    return validation_result{.valid = true, .implementations_agree = true};
287
445
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
55
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
55
    return validation_result{.valid = true, .implementations_agree = true};
287
55
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
44
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
44
    return validation_result{.valid = true, .implementations_agree = true};
287
44
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
43
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
43
    return validation_result{.valid = true, .implementations_agree = true};
287
43
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
283
303
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
303
    return validation_result{.valid = true, .implementations_agree = true};
287
303
  }
288
289
6.18k
  bool count_the_input(FromSpan src) const {
290
6.18k
    const auto implementations = get_supported_implementations();
291
6.18k
    std::vector<std::size_t> results;
292
6.18k
    results.reserve(implementations.size());
293
294
18.5k
    for (auto impl : implementations) {
295
18.5k
      std::size_t ret;
296
18.5k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
3.93k
        ret = impl->count_utf16be(src.data(), src.size());
298
4.20k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
4.20k
        ret = impl->count_utf16le(src.data(), src.size());
300
10.4k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
10.4k
        ret = impl->count_utf8(src.data(), src.size());
302
10.4k
      }
303
18.5k
      results.push_back(ret);
304
18.5k
    }
305
12.3k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::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
418
    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
784
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::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
422
    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
888
    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.25k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.19k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.24k
    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
94
    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
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
590
    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
250
    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
346
    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
728
    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
278
    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
418
    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
664
    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
502
    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
754
    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
612
    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
794
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
6.18k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
6.18k
    return true;
321
6.18k
  }
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
209
  bool count_the_input(FromSpan src) const {
290
209
    const auto implementations = get_supported_implementations();
291
209
    std::vector<std::size_t> results;
292
209
    results.reserve(implementations.size());
293
294
627
    for (auto impl : implementations) {
295
627
      std::size_t ret;
296
627
      if constexpr (From == UtfEncodings::UTF16BE) {
297
627
        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
627
      results.push_back(ret);
304
627
    }
305
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
209
    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
209
    return true;
321
209
  }
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
392
  bool count_the_input(FromSpan src) const {
290
392
    const auto implementations = get_supported_implementations();
291
392
    std::vector<std::size_t> results;
292
392
    results.reserve(implementations.size());
293
294
1.17k
    for (auto impl : implementations) {
295
1.17k
      std::size_t ret;
296
1.17k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.17k
        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.17k
      results.push_back(ret);
304
1.17k
    }
305
392
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
392
    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
392
    return true;
321
392
  }
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const
Line
Count
Source
289
211
  bool count_the_input(FromSpan src) const {
290
211
    const auto implementations = get_supported_implementations();
291
211
    std::vector<std::size_t> results;
292
211
    results.reserve(implementations.size());
293
294
633
    for (auto impl : implementations) {
295
633
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
633
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
633
        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
633
      results.push_back(ret);
304
633
    }
305
211
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
211
    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
211
    return true;
321
211
  }
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
444
  bool count_the_input(FromSpan src) const {
290
444
    const auto implementations = get_supported_implementations();
291
444
    std::vector<std::size_t> results;
292
444
    results.reserve(implementations.size());
293
294
1.33k
    for (auto impl : implementations) {
295
1.33k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
1.33k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
1.33k
        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.33k
      results.push_back(ret);
304
1.33k
    }
305
444
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
444
    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
444
    return true;
321
444
  }
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
626
  bool count_the_input(FromSpan src) const {
290
626
    const auto implementations = get_supported_implementations();
291
626
    std::vector<std::size_t> results;
292
626
    results.reserve(implementations.size());
293
294
1.87k
    for (auto impl : implementations) {
295
1.87k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.87k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.87k
        ret = impl->count_utf8(src.data(), src.size());
302
1.87k
      }
303
1.87k
      results.push_back(ret);
304
1.87k
    }
305
626
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
626
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
626
    return true;
321
626
  }
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
289
599
  bool count_the_input(FromSpan src) const {
290
599
    const auto implementations = get_supported_implementations();
291
599
    std::vector<std::size_t> results;
292
599
    results.reserve(implementations.size());
293
294
1.79k
    for (auto impl : implementations) {
295
1.79k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.79k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.79k
        ret = impl->count_utf8(src.data(), src.size());
302
1.79k
      }
303
1.79k
      results.push_back(ret);
304
1.79k
    }
305
599
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
599
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
599
    return true;
321
599
  }
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
289
621
  bool count_the_input(FromSpan src) const {
290
621
    const auto implementations = get_supported_implementations();
291
621
    std::vector<std::size_t> results;
292
621
    results.reserve(implementations.size());
293
294
1.86k
    for (auto impl : implementations) {
295
1.86k
      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.86k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.86k
        ret = impl->count_utf8(src.data(), src.size());
302
1.86k
      }
303
1.86k
      results.push_back(ret);
304
1.86k
    }
305
621
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
621
    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
621
    return true;
321
621
  }
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
47
  bool count_the_input(FromSpan src) const {
290
47
    const auto implementations = get_supported_implementations();
291
47
    std::vector<std::size_t> results;
292
47
    results.reserve(implementations.size());
293
294
141
    for (auto impl : implementations) {
295
141
      std::size_t ret;
296
141
      if constexpr (From == UtfEncodings::UTF16BE) {
297
141
        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
141
      results.push_back(ret);
304
141
    }
305
47
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
47
    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
47
    return true;
321
47
  }
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const
Line
Count
Source
289
67
  bool count_the_input(FromSpan src) const {
290
67
    const auto implementations = get_supported_implementations();
291
67
    std::vector<std::size_t> results;
292
67
    results.reserve(implementations.size());
293
294
201
    for (auto impl : implementations) {
295
201
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
201
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
201
        ret = impl->count_utf16le(src.data(), src.size());
300
      } else if constexpr (From == UtfEncodings::UTF8) {
301
        ret = impl->count_utf8(src.data(), src.size());
302
      }
303
201
      results.push_back(ret);
304
201
    }
305
67
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
67
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
67
    return true;
321
67
  }
Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
289
295
  bool count_the_input(FromSpan src) const {
290
295
    const auto implementations = get_supported_implementations();
291
295
    std::vector<std::size_t> results;
292
295
    results.reserve(implementations.size());
293
294
885
    for (auto impl : implementations) {
295
885
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
885
      } else if constexpr (From == UtfEncodings::UTF8) {
301
885
        ret = impl->count_utf8(src.data(), src.size());
302
885
      }
303
885
      results.push_back(ret);
304
885
    }
305
295
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
295
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
295
    return true;
321
295
  }
Conversion<(UtfEncodings)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
125
  bool count_the_input(FromSpan src) const {
290
125
    const auto implementations = get_supported_implementations();
291
125
    std::vector<std::size_t> results;
292
125
    results.reserve(implementations.size());
293
294
375
    for (auto impl : implementations) {
295
375
      std::size_t ret;
296
375
      if constexpr (From == UtfEncodings::UTF16BE) {
297
375
        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
375
      results.push_back(ret);
304
375
    }
305
125
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
125
    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
125
    return true;
321
125
  }
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
173
  bool count_the_input(FromSpan src) const {
290
173
    const auto implementations = get_supported_implementations();
291
173
    std::vector<std::size_t> results;
292
173
    results.reserve(implementations.size());
293
294
519
    for (auto impl : implementations) {
295
519
      std::size_t ret;
296
519
      if constexpr (From == UtfEncodings::UTF16BE) {
297
519
        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
519
      results.push_back(ret);
304
519
    }
305
173
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
173
    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
173
    return true;
321
173
  }
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
364
  bool count_the_input(FromSpan src) const {
290
364
    const auto implementations = get_supported_implementations();
291
364
    std::vector<std::size_t> results;
292
364
    results.reserve(implementations.size());
293
294
1.09k
    for (auto impl : implementations) {
295
1.09k
      std::size_t ret;
296
1.09k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.09k
        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.09k
      results.push_back(ret);
304
1.09k
    }
305
364
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
364
    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
364
    return true;
321
364
  }
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
139
  bool count_the_input(FromSpan src) const {
290
139
    const auto implementations = get_supported_implementations();
291
139
    std::vector<std::size_t> results;
292
139
    results.reserve(implementations.size());
293
294
417
    for (auto impl : implementations) {
295
417
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
417
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
417
        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
417
      results.push_back(ret);
304
417
    }
305
139
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
139
    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
139
    return true;
321
139
  }
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
209
  bool count_the_input(FromSpan src) const {
290
209
    const auto implementations = get_supported_implementations();
291
209
    std::vector<std::size_t> results;
292
209
    results.reserve(implementations.size());
293
294
627
    for (auto impl : implementations) {
295
627
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
627
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
627
        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
627
      results.push_back(ret);
304
627
    }
305
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
209
    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
209
    return true;
321
209
  }
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
332
  bool count_the_input(FromSpan src) const {
290
332
    const auto implementations = get_supported_implementations();
291
332
    std::vector<std::size_t> results;
292
332
    results.reserve(implementations.size());
293
294
996
    for (auto impl : implementations) {
295
996
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
996
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
996
        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
996
      results.push_back(ret);
304
996
    }
305
332
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
332
    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
332
    return true;
321
332
  }
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
251
  bool count_the_input(FromSpan src) const {
290
251
    const auto implementations = get_supported_implementations();
291
251
    std::vector<std::size_t> results;
292
251
    results.reserve(implementations.size());
293
294
753
    for (auto impl : implementations) {
295
753
      std::size_t ret;
296
      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
753
      } else if constexpr (From == UtfEncodings::UTF8) {
301
753
        ret = impl->count_utf8(src.data(), src.size());
302
753
      }
303
753
      results.push_back(ret);
304
753
    }
305
251
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
251
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
251
    return true;
321
251
  }
Conversion<(UtfEncodings)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
377
  bool count_the_input(FromSpan src) const {
290
377
    const auto implementations = get_supported_implementations();
291
377
    std::vector<std::size_t> results;
292
377
    results.reserve(implementations.size());
293
294
1.13k
    for (auto impl : implementations) {
295
1.13k
      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.13k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.13k
        ret = impl->count_utf8(src.data(), src.size());
302
1.13k
      }
303
1.13k
      results.push_back(ret);
304
1.13k
    }
305
377
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
377
    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
377
    return true;
321
377
  }
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
306
  bool count_the_input(FromSpan src) const {
290
306
    const auto implementations = get_supported_implementations();
291
306
    std::vector<std::size_t> results;
292
306
    results.reserve(implementations.size());
293
294
918
    for (auto impl : implementations) {
295
918
      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
918
      } else if constexpr (From == UtfEncodings::UTF8) {
301
918
        ret = impl->count_utf8(src.data(), src.size());
302
918
      }
303
918
      results.push_back(ret);
304
918
    }
305
306
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
306
    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
306
    return true;
321
306
  }
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
397
  bool count_the_input(FromSpan src) const {
290
397
    const auto implementations = get_supported_implementations();
291
397
    std::vector<std::size_t> results;
292
397
    results.reserve(implementations.size());
293
294
1.19k
    for (auto impl : implementations) {
295
1.19k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.19k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.19k
        ret = impl->count_utf8(src.data(), src.size());
302
1.19k
      }
303
1.19k
      results.push_back(ret);
304
1.19k
    }
305
397
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
397
    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
397
    return true;
321
397
  }
322
323
  // this quirk is needed because length calculations do not have consistent
324
  // signatures since some of them do not look at the input data, just the
325
  // length of it.
326
  template <typename Dummy = void>
327
    requires std::is_invocable_v<LengthFunction, const simdutf::implementation*,
328
                                 const FromType*, std::size_t>
329
  std::size_t invoke_lengthcalc(const simdutf::implementation* impl,
330
25.2k
                                FromSpan src) const {
331
25.2k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
25.2k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
627
                                FromSpan src) const {
331
627
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
627
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.17k
                                FromSpan src) const {
331
1.17k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.17k
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
633
                                FromSpan src) const {
331
633
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
633
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.33k
                                FromSpan src) const {
331
1.33k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.33k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
999
                                FromSpan src) const {
331
999
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
999
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.18k
                                FromSpan src) const {
331
1.18k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.18k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.41k
                                FromSpan src) const {
331
1.41k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.41k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.87k
                                FromSpan src) const {
331
1.87k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.87k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.79k
                                FromSpan src) const {
331
1.79k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.79k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.86k
                                FromSpan src) const {
331
1.86k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.86k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
885
                                FromSpan src) const {
331
885
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
885
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
519
                                FromSpan src) const {
331
519
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
519
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.09k
                                FromSpan src) const {
331
1.09k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.09k
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
627
                                FromSpan src) const {
331
627
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
627
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
996
                                FromSpan src) const {
331
996
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
996
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
945
                                FromSpan src) const {
331
945
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
945
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.02k
                                FromSpan src) const {
331
1.02k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.02k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_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_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
753
                                FromSpan src) const {
331
753
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
753
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.13k
                                FromSpan src) const {
331
1.13k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.13k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
918
                                FromSpan src) const {
331
918
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
918
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_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
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
909
                                FromSpan src) const {
331
909
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
909
  }
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.43k
                                FromSpan src) const {
339
2.43k
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
2.43k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
141
                                FromSpan src) const {
339
141
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
141
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
201
                                FromSpan src) const {
339
201
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
201
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
258
                                FromSpan src) const {
339
258
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
258
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
375
                                FromSpan src) const {
339
375
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
375
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
417
                                FromSpan src) const {
339
417
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
417
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
612
                                FromSpan src) const {
339
612
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
612
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
165
                                FromSpan src) const {
339
165
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
165
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
132
                                FromSpan src) const {
339
132
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
132
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
129
                                FromSpan src) const {
339
129
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
129
  }
341
342
9.24k
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
9.24k
    length_result ret{};
344
345
9.24k
    const auto implementations = get_supported_implementations();
346
9.24k
    std::vector<std::size_t> results;
347
9.24k
    results.reserve(implementations.size());
348
349
27.7k
    for (auto impl : implementations) {
350
27.7k
      const auto len = invoke_lengthcalc(impl, src);
351
27.7k
      results.push_back(len);
352
27.7k
      ret.length.push_back(len);
353
27.7k
    }
354
355
18.4k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::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
418
    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
784
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::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
422
    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
888
    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
666
    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
788
    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
940
    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.25k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.19k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.24k
    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
94
    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
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
172
    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
590
    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
250
    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
346
    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
728
    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
278
    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
418
    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
664
    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
408
    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
630
    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
684
    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
934
    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
502
    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
754
    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
612
    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
794
    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
110
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
88
    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
86
    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
606
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
9.24k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
9.24k
    } else {
375
9.24k
      ret.implementations_agree = true;
376
9.24k
    }
377
9.24k
    return ret;
378
9.24k
  }
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
209
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
209
    length_result ret{};
344
345
209
    const auto implementations = get_supported_implementations();
346
209
    std::vector<std::size_t> results;
347
209
    results.reserve(implementations.size());
348
349
627
    for (auto impl : implementations) {
350
627
      const auto len = invoke_lengthcalc(impl, src);
351
627
      results.push_back(len);
352
627
      ret.length.push_back(len);
353
627
    }
354
355
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
209
    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
209
    } else {
375
209
      ret.implementations_agree = true;
376
209
    }
377
209
    return ret;
378
209
  }
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
392
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
392
    length_result ret{};
344
345
392
    const auto implementations = get_supported_implementations();
346
392
    std::vector<std::size_t> results;
347
392
    results.reserve(implementations.size());
348
349
1.17k
    for (auto impl : implementations) {
350
1.17k
      const auto len = invoke_lengthcalc(impl, src);
351
1.17k
      results.push_back(len);
352
1.17k
      ret.length.push_back(len);
353
1.17k
    }
354
355
392
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
392
    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
392
    } else {
375
392
      ret.implementations_agree = true;
376
392
    }
377
392
    return ret;
378
392
  }
Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
211
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
211
    length_result ret{};
344
345
211
    const auto implementations = get_supported_implementations();
346
211
    std::vector<std::size_t> results;
347
211
    results.reserve(implementations.size());
348
349
633
    for (auto impl : implementations) {
350
633
      const auto len = invoke_lengthcalc(impl, src);
351
633
      results.push_back(len);
352
633
      ret.length.push_back(len);
353
633
    }
354
355
211
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
211
    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
211
    } else {
375
211
      ret.implementations_agree = true;
376
211
    }
377
211
    return ret;
378
211
  }
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
444
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
444
    length_result ret{};
344
345
444
    const auto implementations = get_supported_implementations();
346
444
    std::vector<std::size_t> results;
347
444
    results.reserve(implementations.size());
348
349
1.33k
    for (auto impl : implementations) {
350
1.33k
      const auto len = invoke_lengthcalc(impl, src);
351
1.33k
      results.push_back(len);
352
1.33k
      ret.length.push_back(len);
353
1.33k
    }
354
355
444
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
444
    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
444
    } else {
375
444
      ret.implementations_agree = true;
376
444
    }
377
444
    return ret;
378
444
  }
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
333
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
333
    length_result ret{};
344
345
333
    const auto implementations = get_supported_implementations();
346
333
    std::vector<std::size_t> results;
347
333
    results.reserve(implementations.size());
348
349
999
    for (auto impl : implementations) {
350
999
      const auto len = invoke_lengthcalc(impl, src);
351
999
      results.push_back(len);
352
999
      ret.length.push_back(len);
353
999
    }
354
355
333
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
333
    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
333
    } else {
375
333
      ret.implementations_agree = true;
376
333
    }
377
333
    return ret;
378
333
  }
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
394
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
394
    length_result ret{};
344
345
394
    const auto implementations = get_supported_implementations();
346
394
    std::vector<std::size_t> results;
347
394
    results.reserve(implementations.size());
348
349
1.18k
    for (auto impl : implementations) {
350
1.18k
      const auto len = invoke_lengthcalc(impl, src);
351
1.18k
      results.push_back(len);
352
1.18k
      ret.length.push_back(len);
353
1.18k
    }
354
355
394
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
394
    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
394
    } else {
375
394
      ret.implementations_agree = true;
376
394
    }
377
394
    return ret;
378
394
  }
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
470
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
470
    length_result ret{};
344
345
470
    const auto implementations = get_supported_implementations();
346
470
    std::vector<std::size_t> results;
347
470
    results.reserve(implementations.size());
348
349
1.41k
    for (auto impl : implementations) {
350
1.41k
      const auto len = invoke_lengthcalc(impl, src);
351
1.41k
      results.push_back(len);
352
1.41k
      ret.length.push_back(len);
353
1.41k
    }
354
355
470
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
470
    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
470
    } else {
375
470
      ret.implementations_agree = true;
376
470
    }
377
470
    return ret;
378
470
  }
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
626
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
626
    length_result ret{};
344
345
626
    const auto implementations = get_supported_implementations();
346
626
    std::vector<std::size_t> results;
347
626
    results.reserve(implementations.size());
348
349
1.87k
    for (auto impl : implementations) {
350
1.87k
      const auto len = invoke_lengthcalc(impl, src);
351
1.87k
      results.push_back(len);
352
1.87k
      ret.length.push_back(len);
353
1.87k
    }
354
355
626
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
626
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
626
    } else {
375
626
      ret.implementations_agree = true;
376
626
    }
377
626
    return ret;
378
626
  }
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
599
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
599
    length_result ret{};
344
345
599
    const auto implementations = get_supported_implementations();
346
599
    std::vector<std::size_t> results;
347
599
    results.reserve(implementations.size());
348
349
1.79k
    for (auto impl : implementations) {
350
1.79k
      const auto len = invoke_lengthcalc(impl, src);
351
1.79k
      results.push_back(len);
352
1.79k
      ret.length.push_back(len);
353
1.79k
    }
354
355
599
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
599
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
599
    } else {
375
599
      ret.implementations_agree = true;
376
599
    }
377
599
    return ret;
378
599
  }
Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
621
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
621
    length_result ret{};
344
345
621
    const auto implementations = get_supported_implementations();
346
621
    std::vector<std::size_t> results;
347
621
    results.reserve(implementations.size());
348
349
1.86k
    for (auto impl : implementations) {
350
1.86k
      const auto len = invoke_lengthcalc(impl, src);
351
1.86k
      results.push_back(len);
352
1.86k
      ret.length.push_back(len);
353
1.86k
    }
354
355
621
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
621
    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
621
    } else {
375
621
      ret.implementations_agree = true;
376
621
    }
377
621
    return ret;
378
621
  }
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
47
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
47
    length_result ret{};
344
345
47
    const auto implementations = get_supported_implementations();
346
47
    std::vector<std::size_t> results;
347
47
    results.reserve(implementations.size());
348
349
141
    for (auto impl : implementations) {
350
141
      const auto len = invoke_lengthcalc(impl, src);
351
141
      results.push_back(len);
352
141
      ret.length.push_back(len);
353
141
    }
354
355
47
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
47
    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
47
    } else {
375
47
      ret.implementations_agree = true;
376
47
    }
377
47
    return ret;
378
47
  }
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
67
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
67
    length_result ret{};
344
345
67
    const auto implementations = get_supported_implementations();
346
67
    std::vector<std::size_t> results;
347
67
    results.reserve(implementations.size());
348
349
201
    for (auto impl : implementations) {
350
201
      const auto len = invoke_lengthcalc(impl, src);
351
201
      results.push_back(len);
352
201
      ret.length.push_back(len);
353
201
    }
354
355
67
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
67
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
67
    } else {
375
67
      ret.implementations_agree = true;
376
67
    }
377
67
    return ret;
378
67
  }
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
86
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
86
    length_result ret{};
344
345
86
    const auto implementations = get_supported_implementations();
346
86
    std::vector<std::size_t> results;
347
86
    results.reserve(implementations.size());
348
349
258
    for (auto impl : implementations) {
350
258
      const auto len = invoke_lengthcalc(impl, src);
351
258
      results.push_back(len);
352
258
      ret.length.push_back(len);
353
258
    }
354
355
86
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
86
    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
86
    } else {
375
86
      ret.implementations_agree = true;
376
86
    }
377
86
    return ret;
378
86
  }
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
295
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
295
    length_result ret{};
344
345
295
    const auto implementations = get_supported_implementations();
346
295
    std::vector<std::size_t> results;
347
295
    results.reserve(implementations.size());
348
349
885
    for (auto impl : implementations) {
350
885
      const auto len = invoke_lengthcalc(impl, src);
351
885
      results.push_back(len);
352
885
      ret.length.push_back(len);
353
885
    }
354
355
295
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
295
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
295
    } else {
375
295
      ret.implementations_agree = true;
376
295
    }
377
295
    return ret;
378
295
  }
Conversion<(UtfEncodings)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
125
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
125
    length_result ret{};
344
345
125
    const auto implementations = get_supported_implementations();
346
125
    std::vector<std::size_t> results;
347
125
    results.reserve(implementations.size());
348
349
375
    for (auto impl : implementations) {
350
375
      const auto len = invoke_lengthcalc(impl, src);
351
375
      results.push_back(len);
352
375
      ret.length.push_back(len);
353
375
    }
354
355
125
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
125
    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
125
    } else {
375
125
      ret.implementations_agree = true;
376
125
    }
377
125
    return ret;
378
125
  }
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
173
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
173
    length_result ret{};
344
345
173
    const auto implementations = get_supported_implementations();
346
173
    std::vector<std::size_t> results;
347
173
    results.reserve(implementations.size());
348
349
519
    for (auto impl : implementations) {
350
519
      const auto len = invoke_lengthcalc(impl, src);
351
519
      results.push_back(len);
352
519
      ret.length.push_back(len);
353
519
    }
354
355
173
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
173
    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
173
    } else {
375
173
      ret.implementations_agree = true;
376
173
    }
377
173
    return ret;
378
173
  }
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
364
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
364
    length_result ret{};
344
345
364
    const auto implementations = get_supported_implementations();
346
364
    std::vector<std::size_t> results;
347
364
    results.reserve(implementations.size());
348
349
1.09k
    for (auto impl : implementations) {
350
1.09k
      const auto len = invoke_lengthcalc(impl, src);
351
1.09k
      results.push_back(len);
352
1.09k
      ret.length.push_back(len);
353
1.09k
    }
354
355
364
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
364
    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
364
    } else {
375
364
      ret.implementations_agree = true;
376
364
    }
377
364
    return ret;
378
364
  }
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
139
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
139
    length_result ret{};
344
345
139
    const auto implementations = get_supported_implementations();
346
139
    std::vector<std::size_t> results;
347
139
    results.reserve(implementations.size());
348
349
417
    for (auto impl : implementations) {
350
417
      const auto len = invoke_lengthcalc(impl, src);
351
417
      results.push_back(len);
352
417
      ret.length.push_back(len);
353
417
    }
354
355
139
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
139
    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
139
    } else {
375
139
      ret.implementations_agree = true;
376
139
    }
377
139
    return ret;
378
139
  }
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
209
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
209
    length_result ret{};
344
345
209
    const auto implementations = get_supported_implementations();
346
209
    std::vector<std::size_t> results;
347
209
    results.reserve(implementations.size());
348
349
627
    for (auto impl : implementations) {
350
627
      const auto len = invoke_lengthcalc(impl, src);
351
627
      results.push_back(len);
352
627
      ret.length.push_back(len);
353
627
    }
354
355
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
209
    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
209
    } else {
375
209
      ret.implementations_agree = true;
376
209
    }
377
209
    return ret;
378
209
  }
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
332
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
332
    length_result ret{};
344
345
332
    const auto implementations = get_supported_implementations();
346
332
    std::vector<std::size_t> results;
347
332
    results.reserve(implementations.size());
348
349
996
    for (auto impl : implementations) {
350
996
      const auto len = invoke_lengthcalc(impl, src);
351
996
      results.push_back(len);
352
996
      ret.length.push_back(len);
353
996
    }
354
355
332
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
332
    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
332
    } else {
375
332
      ret.implementations_agree = true;
376
332
    }
377
332
    return ret;
378
332
  }
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
204
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
204
    length_result ret{};
344
345
204
    const auto implementations = get_supported_implementations();
346
204
    std::vector<std::size_t> results;
347
204
    results.reserve(implementations.size());
348
349
612
    for (auto impl : implementations) {
350
612
      const auto len = invoke_lengthcalc(impl, src);
351
612
      results.push_back(len);
352
612
      ret.length.push_back(len);
353
612
    }
354
355
204
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
204
    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
204
    } else {
375
204
      ret.implementations_agree = true;
376
204
    }
377
204
    return ret;
378
204
  }
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
315
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
315
    length_result ret{};
344
345
315
    const auto implementations = get_supported_implementations();
346
315
    std::vector<std::size_t> results;
347
315
    results.reserve(implementations.size());
348
349
945
    for (auto impl : implementations) {
350
945
      const auto len = invoke_lengthcalc(impl, src);
351
945
      results.push_back(len);
352
945
      ret.length.push_back(len);
353
945
    }
354
355
315
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
315
    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
315
    } else {
375
315
      ret.implementations_agree = true;
376
315
    }
377
315
    return ret;
378
315
  }
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
342
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
342
    length_result ret{};
344
345
342
    const auto implementations = get_supported_implementations();
346
342
    std::vector<std::size_t> results;
347
342
    results.reserve(implementations.size());
348
349
1.02k
    for (auto impl : implementations) {
350
1.02k
      const auto len = invoke_lengthcalc(impl, src);
351
1.02k
      results.push_back(len);
352
1.02k
      ret.length.push_back(len);
353
1.02k
    }
354
355
342
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
342
    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
342
    } else {
375
342
      ret.implementations_agree = true;
376
342
    }
377
342
    return ret;
378
342
  }
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
467
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
467
    length_result ret{};
344
345
467
    const auto implementations = get_supported_implementations();
346
467
    std::vector<std::size_t> results;
347
467
    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
467
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
467
    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
467
    } else {
375
467
      ret.implementations_agree = true;
376
467
    }
377
467
    return ret;
378
467
  }
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
251
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
251
    length_result ret{};
344
345
251
    const auto implementations = get_supported_implementations();
346
251
    std::vector<std::size_t> results;
347
251
    results.reserve(implementations.size());
348
349
753
    for (auto impl : implementations) {
350
753
      const auto len = invoke_lengthcalc(impl, src);
351
753
      results.push_back(len);
352
753
      ret.length.push_back(len);
353
753
    }
354
355
251
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
251
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
251
    } else {
375
251
      ret.implementations_agree = true;
376
251
    }
377
251
    return ret;
378
251
  }
Conversion<(UtfEncodings)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
377
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
377
    length_result ret{};
344
345
377
    const auto implementations = get_supported_implementations();
346
377
    std::vector<std::size_t> results;
347
377
    results.reserve(implementations.size());
348
349
1.13k
    for (auto impl : implementations) {
350
1.13k
      const auto len = invoke_lengthcalc(impl, src);
351
1.13k
      results.push_back(len);
352
1.13k
      ret.length.push_back(len);
353
1.13k
    }
354
355
377
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
377
    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
377
    } else {
375
377
      ret.implementations_agree = true;
376
377
    }
377
377
    return ret;
378
377
  }
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
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)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
397
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
397
    length_result ret{};
344
345
397
    const auto implementations = get_supported_implementations();
346
397
    std::vector<std::size_t> results;
347
397
    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
397
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
397
    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
397
    } else {
375
397
      ret.implementations_agree = true;
376
397
    }
377
397
    return ret;
378
397
  }
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
55
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
55
    length_result ret{};
344
345
55
    const auto implementations = get_supported_implementations();
346
55
    std::vector<std::size_t> results;
347
55
    results.reserve(implementations.size());
348
349
165
    for (auto impl : implementations) {
350
165
      const auto len = invoke_lengthcalc(impl, src);
351
165
      results.push_back(len);
352
165
      ret.length.push_back(len);
353
165
    }
354
355
55
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
55
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
55
    } else {
375
55
      ret.implementations_agree = true;
376
55
    }
377
55
    return ret;
378
55
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
44
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
44
    length_result ret{};
344
345
44
    const auto implementations = get_supported_implementations();
346
44
    std::vector<std::size_t> results;
347
44
    results.reserve(implementations.size());
348
349
132
    for (auto impl : implementations) {
350
132
      const auto len = invoke_lengthcalc(impl, src);
351
132
      results.push_back(len);
352
132
      ret.length.push_back(len);
353
132
    }
354
355
44
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
44
    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
44
    } else {
375
44
      ret.implementations_agree = true;
376
44
    }
377
44
    return ret;
378
44
  }
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
43
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
43
    length_result ret{};
344
345
43
    const auto implementations = get_supported_implementations();
346
43
    std::vector<std::size_t> results;
347
43
    results.reserve(implementations.size());
348
349
129
    for (auto impl : implementations) {
350
129
      const auto len = invoke_lengthcalc(impl, src);
351
129
      results.push_back(len);
352
129
      ret.length.push_back(len);
353
129
    }
354
355
43
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
43
    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
43
    } else {
375
43
      ret.implementations_agree = true;
376
43
    }
377
43
    return ret;
378
43
  }
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
303
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
303
    length_result ret{};
344
345
303
    const auto implementations = get_supported_implementations();
346
303
    std::vector<std::size_t> results;
347
303
    results.reserve(implementations.size());
348
349
909
    for (auto impl : implementations) {
350
909
      const auto len = invoke_lengthcalc(impl, src);
351
909
      results.push_back(len);
352
909
      ret.length.push_back(len);
353
909
    }
354
355
303
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
303
    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
303
    } else {
375
303
      ret.implementations_agree = true;
376
303
    }
377
303
    return ret;
378
303
  }
379
380
  conversion_result do_conversion(FromSpan src,
381
                                  const std::vector<std::size_t>& outlength,
382
9.13k
                                  const bool inputisvalid) const {
383
9.13k
    conversion_result ret{};
384
385
9.13k
    const auto implementations = get_supported_implementations();
386
387
9.13k
    std::vector<result<ConversionResult>> results;
388
9.13k
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
9.13k
    std::vector<std::vector<ToType>> outputbuffers;
393
9.13k
    outputbuffers.reserve(implementations.size());
394
36.5k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
27.4k
      auto impl = implementations[i];
396
27.4k
      const ToType canary1{42};
397
27.4k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
27.4k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
27.4k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
27.4k
      const auto success = [](const ConversionResult& r) -> bool {
402
27.4k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
15.4k
          return r != 0;
404
15.4k
        } else {
405
12.0k
          return r.error == simdutf::error_code::SUCCESS;
406
12.0k
        }
407
27.4k
      }(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
588
      const auto success = [](const ConversionResult& r) -> bool {
402
588
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
588
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
588
      }(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.12k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.12k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.12k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.12k
      }(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
618
      const auto success = [](const ConversionResult& r) -> bool {
402
618
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
618
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
618
      }(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
993
      const auto success = [](const ConversionResult& r) -> bool {
402
993
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
993
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
993
      }(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.16k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.16k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.16k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.16k
      }(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.37k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.37k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.37k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.37k
      }(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.84k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.84k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.84k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.84k
      }(implret1);
Conversion<(UtfEncodings)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.74k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.74k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.74k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.74k
      }(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.85k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.85k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.85k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.85k
      }(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
141
      const auto success = [](const ConversionResult& r) -> bool {
402
141
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
141
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
141
      }(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
201
      const auto success = [](const ConversionResult& r) -> bool {
402
201
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
201
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
201
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
258
      const auto success = [](const ConversionResult& r) -> bool {
402
258
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
258
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
258
      }(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
885
      const auto success = [](const ConversionResult& r) -> bool {
402
885
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
885
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
885
      }(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
375
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
375
        } else {
405
375
          return r.error == simdutf::error_code::SUCCESS;
406
375
        }
407
375
      }(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
519
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
519
        } else {
405
519
          return r.error == simdutf::error_code::SUCCESS;
406
519
        }
407
519
      }(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.09k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.09k
        } else {
405
1.09k
          return r.error == simdutf::error_code::SUCCESS;
406
1.09k
        }
407
1.09k
      }(implret1);
Conversion<(UtfEncodings)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
417
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
417
        } else {
405
417
          return r.error == simdutf::error_code::SUCCESS;
406
417
        }
407
417
      }(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
627
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
627
        } else {
405
627
          return r.error == simdutf::error_code::SUCCESS;
406
627
        }
407
627
      }(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
996
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
996
        } else {
405
996
          return r.error == simdutf::error_code::SUCCESS;
406
996
        }
407
996
      }(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
612
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
612
        } else {
405
612
          return r.error == simdutf::error_code::SUCCESS;
406
612
        }
407
612
      }(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
945
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
945
        } else {
405
945
          return r.error == simdutf::error_code::SUCCESS;
406
945
        }
407
945
      }(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.02k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.02k
        } else {
405
1.02k
          return r.error == simdutf::error_code::SUCCESS;
406
1.02k
        }
407
1.02k
      }(implret1);
Conversion<(UtfEncodings)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.40k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.40k
        } else {
405
1.40k
          return r.error == simdutf::error_code::SUCCESS;
406
1.40k
        }
407
1.40k
      }(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
753
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
753
        } else {
405
753
          return r.error == simdutf::error_code::SUCCESS;
406
753
        }
407
753
      }(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.13k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.13k
        } else {
405
1.13k
          return r.error == simdutf::error_code::SUCCESS;
406
1.13k
        }
407
1.13k
      }(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
918
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
918
        } else {
405
918
          return r.error == simdutf::error_code::SUCCESS;
406
918
        }
407
918
      }(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.19k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.19k
        } else {
405
1.19k
          return r.error == simdutf::error_code::SUCCESS;
406
1.19k
        }
407
1.19k
      }(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
165
      const auto success = [](const ConversionResult& r) -> bool {
402
165
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
165
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
165
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
132
      const auto success = [](const ConversionResult& r) -> bool {
402
132
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
132
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
132
      }(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
129
      const auto success = [](const ConversionResult& r) -> bool {
402
129
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
129
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
129
      }(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
909
      const auto success = [](const ConversionResult& r) -> bool {
402
909
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
909
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
909
      }(implret1);
408
27.4k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
27.4k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
27.4k
        const ToType canary2{25};
414
27.4k
        const auto outputbuffer_first_run = outputbuffer;
415
27.4k
        std::ranges::fill(outputbuffer, canary2);
416
27.4k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
27.4k
                                          src.size(), outputbuffer.data());
418
419
27.4k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
27.4k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
13.5k
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
13.5k
          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.5k
        }
440
27.4k
      }
441
27.4k
      results.emplace_back(implret1, success ? hash1 : "");
442
27.4k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
9.13k
    if (!inputisvalid) {
447
13.1k
      for (auto& e : results) {
448
13.1k
        e.outputhash.clear();
449
13.1k
      }
450
4.37k
    }
451
452
18.2k
    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
392
    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
750
    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
412
    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
662
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::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
774
    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
916
    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.23k
    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.16k
    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.23k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
94
    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
134
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
172
    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
590
    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
250
    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
346
    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
728
    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
278
    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
418
    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
664
    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
408
    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
630
    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
684
    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
934
    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
502
    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
754
    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
612
    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
794
    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
110
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
88
    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
86
    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
606
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
9.13k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
9.13k
    } else {
474
9.13k
      ret.implementations_agree = true;
475
9.13k
    }
476
9.13k
    return ret;
477
9.13k
  }
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
196
                                  const bool inputisvalid) const {
383
196
    conversion_result ret{};
384
385
196
    const auto implementations = get_supported_implementations();
386
387
196
    std::vector<result<ConversionResult>> results;
388
196
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
196
    std::vector<std::vector<ToType>> outputbuffers;
393
196
    outputbuffers.reserve(implementations.size());
394
784
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
588
      auto impl = implementations[i];
396
588
      const ToType canary1{42};
397
588
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
588
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
588
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
588
      const auto success = [](const ConversionResult& r) -> bool {
402
588
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
588
          return r != 0;
404
588
        } else {
405
588
          return r.error == simdutf::error_code::SUCCESS;
406
588
        }
407
588
      }(implret1);
408
588
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
588
      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
588
        const ToType canary2{25};
414
588
        const auto outputbuffer_first_run = outputbuffer;
415
588
        std::ranges::fill(outputbuffer, canary2);
416
588
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
588
                                          src.size(), outputbuffer.data());
418
419
588
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
588
        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
588
      }
441
588
      results.emplace_back(implret1, success ? hash1 : "");
442
588
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
196
    if (!inputisvalid) {
447
210
      for (auto& e : results) {
448
210
        e.outputhash.clear();
449
210
      }
450
70
    }
451
452
196
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
196
    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
196
    } else {
474
196
      ret.implementations_agree = true;
475
196
    }
476
196
    return ret;
477
196
  }
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
375
                                  const bool inputisvalid) const {
383
375
    conversion_result ret{};
384
385
375
    const auto implementations = get_supported_implementations();
386
387
375
    std::vector<result<ConversionResult>> results;
388
375
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
375
    std::vector<std::vector<ToType>> outputbuffers;
393
375
    outputbuffers.reserve(implementations.size());
394
1.50k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.12k
      auto impl = implementations[i];
396
1.12k
      const ToType canary1{42};
397
1.12k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.12k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.12k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.12k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.12k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.12k
          return r != 0;
404
1.12k
        } else {
405
1.12k
          return r.error == simdutf::error_code::SUCCESS;
406
1.12k
        }
407
1.12k
      }(implret1);
408
1.12k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.12k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.12k
        const ToType canary2{25};
414
1.12k
        const auto outputbuffer_first_run = outputbuffer;
415
1.12k
        std::ranges::fill(outputbuffer, canary2);
416
1.12k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.12k
                                          src.size(), outputbuffer.data());
418
419
1.12k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.12k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
885
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
885
          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
885
        }
440
1.12k
      }
441
1.12k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.12k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
375
    if (!inputisvalid) {
447
231
      for (auto& e : results) {
448
231
        e.outputhash.clear();
449
231
      }
450
77
    }
451
452
375
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
375
    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
375
    } else {
474
375
      ret.implementations_agree = true;
475
375
    }
476
375
    return ret;
477
375
  }
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
206
                                  const bool inputisvalid) const {
383
206
    conversion_result ret{};
384
385
206
    const auto implementations = get_supported_implementations();
386
387
206
    std::vector<result<ConversionResult>> results;
388
206
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
206
    std::vector<std::vector<ToType>> outputbuffers;
393
206
    outputbuffers.reserve(implementations.size());
394
824
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
618
      auto impl = implementations[i];
396
618
      const ToType canary1{42};
397
618
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
618
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
618
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
618
      const auto success = [](const ConversionResult& r) -> bool {
402
618
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
618
          return r != 0;
404
618
        } else {
405
618
          return r.error == simdutf::error_code::SUCCESS;
406
618
        }
407
618
      }(implret1);
408
618
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
618
      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
618
        const ToType canary2{25};
414
618
        const auto outputbuffer_first_run = outputbuffer;
415
618
        std::ranges::fill(outputbuffer, canary2);
416
618
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
618
                                          src.size(), outputbuffer.data());
418
419
618
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
618
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
348
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
348
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
348
        }
440
618
      }
441
618
      results.emplace_back(implret1, success ? hash1 : "");
442
618
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
206
    if (!inputisvalid) {
447
258
      for (auto& e : results) {
448
258
        e.outputhash.clear();
449
258
      }
450
86
    }
451
452
206
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
206
    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
206
    } else {
474
206
      ret.implementations_agree = true;
475
206
    }
476
206
    return ret;
477
206
  }
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
969
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
969
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
969
        }
440
1.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
303
      for (auto& e : results) {
448
303
        e.outputhash.clear();
449
303
      }
450
101
    }
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
331
                                  const bool inputisvalid) const {
383
331
    conversion_result ret{};
384
385
331
    const auto implementations = get_supported_implementations();
386
387
331
    std::vector<result<ConversionResult>> results;
388
331
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
331
    std::vector<std::vector<ToType>> outputbuffers;
393
331
    outputbuffers.reserve(implementations.size());
394
1.32k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
993
      auto impl = implementations[i];
396
993
      const ToType canary1{42};
397
993
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
993
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
993
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
993
      const auto success = [](const ConversionResult& r) -> bool {
402
993
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
993
          return r != 0;
404
993
        } else {
405
993
          return r.error == simdutf::error_code::SUCCESS;
406
993
        }
407
993
      }(implret1);
408
993
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
993
      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
993
        const ToType canary2{25};
414
993
        const auto outputbuffer_first_run = outputbuffer;
415
993
        std::ranges::fill(outputbuffer, canary2);
416
993
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
993
                                          src.size(), outputbuffer.data());
418
419
993
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
993
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
417
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
417
          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
417
        }
440
993
      }
441
993
      results.emplace_back(implret1, success ? hash1 : "");
442
993
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
331
    if (!inputisvalid) {
447
564
      for (auto& e : results) {
448
564
        e.outputhash.clear();
449
564
      }
450
188
    }
451
452
331
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
331
    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
331
    } else {
474
331
      ret.implementations_agree = true;
475
331
    }
476
331
    return ret;
477
331
  }
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::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
387
                                  const bool inputisvalid) const {
383
387
    conversion_result ret{};
384
385
387
    const auto implementations = get_supported_implementations();
386
387
387
    std::vector<result<ConversionResult>> results;
388
387
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
387
    std::vector<std::vector<ToType>> outputbuffers;
393
387
    outputbuffers.reserve(implementations.size());
394
1.54k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.16k
      auto impl = implementations[i];
396
1.16k
      const ToType canary1{42};
397
1.16k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.16k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.16k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.16k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.16k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.16k
          return r != 0;
404
1.16k
        } else {
405
1.16k
          return r.error == simdutf::error_code::SUCCESS;
406
1.16k
        }
407
1.16k
      }(implret1);
408
1.16k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.16k
      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.16k
        const ToType canary2{25};
414
1.16k
        const auto outputbuffer_first_run = outputbuffer;
415
1.16k
        std::ranges::fill(outputbuffer, canary2);
416
1.16k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.16k
                                          src.size(), outputbuffer.data());
418
419
1.16k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.16k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
588
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
588
          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
588
        }
440
1.16k
      }
441
1.16k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.16k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
387
    if (!inputisvalid) {
447
558
      for (auto& e : results) {
448
558
        e.outputhash.clear();
449
558
      }
450
186
    }
451
452
387
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
387
    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
387
    } else {
474
387
      ret.implementations_agree = true;
475
387
    }
476
387
    return ret;
477
387
  }
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
458
                                  const bool inputisvalid) const {
383
458
    conversion_result ret{};
384
385
458
    const auto implementations = get_supported_implementations();
386
387
458
    std::vector<result<ConversionResult>> results;
388
458
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
458
    std::vector<std::vector<ToType>> outputbuffers;
393
458
    outputbuffers.reserve(implementations.size());
394
1.83k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.37k
      auto impl = implementations[i];
396
1.37k
      const ToType canary1{42};
397
1.37k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.37k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.37k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.37k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.37k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.37k
          return r != 0;
404
1.37k
        } else {
405
1.37k
          return r.error == simdutf::error_code::SUCCESS;
406
1.37k
        }
407
1.37k
      }(implret1);
408
1.37k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.37k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.37k
        const ToType canary2{25};
414
1.37k
        const auto outputbuffer_first_run = outputbuffer;
415
1.37k
        std::ranges::fill(outputbuffer, canary2);
416
1.37k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.37k
                                          src.size(), outputbuffer.data());
418
419
1.37k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.37k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
468
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
468
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
468
        }
440
1.37k
      }
441
1.37k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.37k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
458
    if (!inputisvalid) {
447
897
      for (auto& e : results) {
448
897
        e.outputhash.clear();
449
897
      }
450
299
    }
451
452
458
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
458
    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
458
    } else {
474
458
      ret.implementations_agree = true;
475
458
    }
476
458
    return ret;
477
458
  }
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
616
                                  const bool inputisvalid) const {
383
616
    conversion_result ret{};
384
385
616
    const auto implementations = get_supported_implementations();
386
387
616
    std::vector<result<ConversionResult>> results;
388
616
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
616
    std::vector<std::vector<ToType>> outputbuffers;
393
616
    outputbuffers.reserve(implementations.size());
394
2.46k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.84k
      auto impl = implementations[i];
396
1.84k
      const ToType canary1{42};
397
1.84k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.84k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.84k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.84k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.84k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.84k
          return r != 0;
404
1.84k
        } else {
405
1.84k
          return r.error == simdutf::error_code::SUCCESS;
406
1.84k
        }
407
1.84k
      }(implret1);
408
1.84k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.84k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.84k
        const ToType canary2{25};
414
1.84k
        const auto outputbuffer_first_run = outputbuffer;
415
1.84k
        std::ranges::fill(outputbuffer, canary2);
416
1.84k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.84k
                                          src.size(), outputbuffer.data());
418
419
1.84k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.84k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
1.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.84k
      }
441
1.84k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.84k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
616
    if (!inputisvalid) {
447
837
      for (auto& e : results) {
448
837
        e.outputhash.clear();
449
837
      }
450
279
    }
451
452
616
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
616
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
616
    } else {
474
616
      ret.implementations_agree = true;
475
616
    }
476
616
    return ret;
477
616
  }
Conversion<(UtfEncodings)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
582
                                  const bool inputisvalid) const {
383
582
    conversion_result ret{};
384
385
582
    const auto implementations = get_supported_implementations();
386
387
582
    std::vector<result<ConversionResult>> results;
388
582
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
582
    std::vector<std::vector<ToType>> outputbuffers;
393
582
    outputbuffers.reserve(implementations.size());
394
2.32k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.74k
      auto impl = implementations[i];
396
1.74k
      const ToType canary1{42};
397
1.74k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.74k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.74k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.74k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.74k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.74k
          return r != 0;
404
1.74k
        } else {
405
1.74k
          return r.error == simdutf::error_code::SUCCESS;
406
1.74k
        }
407
1.74k
      }(implret1);
408
1.74k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.74k
      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.74k
        const ToType canary2{25};
414
1.74k
        const auto outputbuffer_first_run = outputbuffer;
415
1.74k
        std::ranges::fill(outputbuffer, canary2);
416
1.74k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.74k
                                          src.size(), outputbuffer.data());
418
419
1.74k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.74k
        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.74k
      }
441
1.74k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.74k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
582
    if (!inputisvalid) {
447
732
      for (auto& e : results) {
448
732
        e.outputhash.clear();
449
732
      }
450
244
    }
451
452
582
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
582
    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
582
    } else {
474
582
      ret.implementations_agree = true;
475
582
    }
476
582
    return ret;
477
582
  }
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
617
                                  const bool inputisvalid) const {
383
617
    conversion_result ret{};
384
385
617
    const auto implementations = get_supported_implementations();
386
387
617
    std::vector<result<ConversionResult>> results;
388
617
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
617
    std::vector<std::vector<ToType>> outputbuffers;
393
617
    outputbuffers.reserve(implementations.size());
394
2.46k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.85k
      auto impl = implementations[i];
396
1.85k
      const ToType canary1{42};
397
1.85k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.85k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.85k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.85k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.85k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.85k
          return r != 0;
404
1.85k
        } else {
405
1.85k
          return r.error == simdutf::error_code::SUCCESS;
406
1.85k
        }
407
1.85k
      }(implret1);
408
1.85k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.85k
      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.85k
        const ToType canary2{25};
414
1.85k
        const auto outputbuffer_first_run = outputbuffer;
415
1.85k
        std::ranges::fill(outputbuffer, canary2);
416
1.85k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.85k
                                          src.size(), outputbuffer.data());
418
419
1.85k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.85k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
1.05k
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
1.05k
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
1.05k
        }
440
1.85k
      }
441
1.85k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.85k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
617
    if (!inputisvalid) {
447
792
      for (auto& e : results) {
448
792
        e.outputhash.clear();
449
792
      }
450
264
    }
451
452
617
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
617
    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
617
    } else {
474
617
      ret.implementations_agree = true;
475
617
    }
476
617
    return ret;
477
617
  }
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
47
                                  const bool inputisvalid) const {
383
47
    conversion_result ret{};
384
385
47
    const auto implementations = get_supported_implementations();
386
387
47
    std::vector<result<ConversionResult>> results;
388
47
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
47
    std::vector<std::vector<ToType>> outputbuffers;
393
47
    outputbuffers.reserve(implementations.size());
394
188
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
141
      auto impl = implementations[i];
396
141
      const ToType canary1{42};
397
141
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
141
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
141
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
141
      const auto success = [](const ConversionResult& r) -> bool {
402
141
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
141
          return r != 0;
404
141
        } else {
405
141
          return r.error == simdutf::error_code::SUCCESS;
406
141
        }
407
141
      }(implret1);
408
141
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
141
      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
141
        const ToType canary2{25};
414
141
        const auto outputbuffer_first_run = outputbuffer;
415
141
        std::ranges::fill(outputbuffer, canary2);
416
141
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
141
                                          src.size(), outputbuffer.data());
418
419
141
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
141
        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
141
      }
441
141
      results.emplace_back(implret1, success ? hash1 : "");
442
141
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
47
    if (!inputisvalid) {
447
27
      for (auto& e : results) {
448
27
        e.outputhash.clear();
449
27
      }
450
9
    }
451
452
47
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
47
    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
47
    } else {
474
47
      ret.implementations_agree = true;
475
47
    }
476
47
    return ret;
477
47
  }
Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
67
                                  const bool inputisvalid) const {
383
67
    conversion_result ret{};
384
385
67
    const auto implementations = get_supported_implementations();
386
387
67
    std::vector<result<ConversionResult>> results;
388
67
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
67
    std::vector<std::vector<ToType>> outputbuffers;
393
67
    outputbuffers.reserve(implementations.size());
394
268
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
201
      auto impl = implementations[i];
396
201
      const ToType canary1{42};
397
201
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
201
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
201
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
201
      const auto success = [](const ConversionResult& r) -> bool {
402
201
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
201
          return r != 0;
404
201
        } else {
405
201
          return r.error == simdutf::error_code::SUCCESS;
406
201
        }
407
201
      }(implret1);
408
201
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
201
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
201
        const ToType canary2{25};
414
201
        const auto outputbuffer_first_run = outputbuffer;
415
201
        std::ranges::fill(outputbuffer, canary2);
416
201
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
201
                                          src.size(), outputbuffer.data());
418
419
201
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
201
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
69
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
69
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
69
        }
440
201
      }
441
201
      results.emplace_back(implret1, success ? hash1 : "");
442
201
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
67
    if (!inputisvalid) {
447
57
      for (auto& e : results) {
448
57
        e.outputhash.clear();
449
57
      }
450
19
    }
451
452
67
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
67
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
67
    } else {
474
67
      ret.implementations_agree = true;
475
67
    }
476
67
    return ret;
477
67
  }
Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
86
                                  const bool inputisvalid) const {
383
86
    conversion_result ret{};
384
385
86
    const auto implementations = get_supported_implementations();
386
387
86
    std::vector<result<ConversionResult>> results;
388
86
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
86
    std::vector<std::vector<ToType>> outputbuffers;
393
86
    outputbuffers.reserve(implementations.size());
394
344
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
258
      auto impl = implementations[i];
396
258
      const ToType canary1{42};
397
258
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
258
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
258
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
258
      const auto success = [](const ConversionResult& r) -> bool {
402
258
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
258
          return r != 0;
404
258
        } else {
405
258
          return r.error == simdutf::error_code::SUCCESS;
406
258
        }
407
258
      }(implret1);
408
258
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
258
      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
258
        const ToType canary2{25};
414
258
        const auto outputbuffer_first_run = outputbuffer;
415
258
        std::ranges::fill(outputbuffer, canary2);
416
258
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
258
                                          src.size(), outputbuffer.data());
418
419
258
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
258
        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
258
      }
441
258
      results.emplace_back(implret1, success ? hash1 : "");
442
258
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
86
    if (!inputisvalid) {
447
177
      for (auto& e : results) {
448
177
        e.outputhash.clear();
449
177
      }
450
59
    }
451
452
86
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
86
    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
86
    } else {
474
86
      ret.implementations_agree = true;
475
86
    }
476
86
    return ret;
477
86
  }
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
295
                                  const bool inputisvalid) const {
383
295
    conversion_result ret{};
384
385
295
    const auto implementations = get_supported_implementations();
386
387
295
    std::vector<result<ConversionResult>> results;
388
295
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
295
    std::vector<std::vector<ToType>> outputbuffers;
393
295
    outputbuffers.reserve(implementations.size());
394
1.18k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
885
      auto impl = implementations[i];
396
885
      const ToType canary1{42};
397
885
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
885
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
885
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
885
      const auto success = [](const ConversionResult& r) -> bool {
402
885
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
885
          return r != 0;
404
885
        } else {
405
885
          return r.error == simdutf::error_code::SUCCESS;
406
885
        }
407
885
      }(implret1);
408
885
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
885
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
885
        const ToType canary2{25};
414
885
        const auto outputbuffer_first_run = outputbuffer;
415
885
        std::ranges::fill(outputbuffer, canary2);
416
885
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
885
                                          src.size(), outputbuffer.data());
418
419
885
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
885
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
267
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
267
          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
267
        }
440
885
      }
441
885
      results.emplace_back(implret1, success ? hash1 : "");
442
885
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
295
    if (!inputisvalid) {
447
588
      for (auto& e : results) {
448
588
        e.outputhash.clear();
449
588
      }
450
196
    }
451
452
295
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
295
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
295
    } else {
474
295
      ret.implementations_agree = true;
475
295
    }
476
295
    return ret;
477
295
  }
Conversion<(UtfEncodings)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
125
                                  const bool inputisvalid) const {
383
125
    conversion_result ret{};
384
385
125
    const auto implementations = get_supported_implementations();
386
387
125
    std::vector<result<ConversionResult>> results;
388
125
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
125
    std::vector<std::vector<ToType>> outputbuffers;
393
125
    outputbuffers.reserve(implementations.size());
394
500
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
375
      auto impl = implementations[i];
396
375
      const ToType canary1{42};
397
375
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
375
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
375
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
375
      const auto success = [](const ConversionResult& r) -> bool {
402
375
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
375
          return r != 0;
404
375
        } else {
405
375
          return r.error == simdutf::error_code::SUCCESS;
406
375
        }
407
375
      }(implret1);
408
375
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
375
      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
375
        const ToType canary2{25};
414
375
        const auto outputbuffer_first_run = outputbuffer;
415
375
        std::ranges::fill(outputbuffer, canary2);
416
375
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
375
                                          src.size(), outputbuffer.data());
418
419
375
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
375
        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
375
      }
441
375
      results.emplace_back(implret1, success ? hash1 : "");
442
375
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
125
    if (!inputisvalid) {
447
60
      for (auto& e : results) {
448
60
        e.outputhash.clear();
449
60
      }
450
20
    }
451
452
125
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
125
    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
125
    } else {
474
125
      ret.implementations_agree = true;
475
125
    }
476
125
    return ret;
477
125
  }
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
173
                                  const bool inputisvalid) const {
383
173
    conversion_result ret{};
384
385
173
    const auto implementations = get_supported_implementations();
386
387
173
    std::vector<result<ConversionResult>> results;
388
173
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
173
    std::vector<std::vector<ToType>> outputbuffers;
393
173
    outputbuffers.reserve(implementations.size());
394
692
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
519
      auto impl = implementations[i];
396
519
      const ToType canary1{42};
397
519
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
519
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
519
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
519
      const auto success = [](const ConversionResult& r) -> bool {
402
519
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
519
          return r != 0;
404
519
        } else {
405
519
          return r.error == simdutf::error_code::SUCCESS;
406
519
        }
407
519
      }(implret1);
408
519
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
519
      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
519
        const ToType canary2{25};
414
519
        const auto outputbuffer_first_run = outputbuffer;
415
519
        std::ranges::fill(outputbuffer, canary2);
416
519
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
519
                                          src.size(), outputbuffer.data());
418
419
519
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
519
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
249
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
249
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
249
        }
440
519
      }
441
519
      results.emplace_back(implret1, success ? hash1 : "");
442
519
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
173
    if (!inputisvalid) {
447
270
      for (auto& e : results) {
448
270
        e.outputhash.clear();
449
270
      }
450
90
    }
451
452
173
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
173
    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
173
    } else {
474
173
      ret.implementations_agree = true;
475
173
    }
476
173
    return ret;
477
173
  }
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
364
                                  const bool inputisvalid) const {
383
364
    conversion_result ret{};
384
385
364
    const auto implementations = get_supported_implementations();
386
387
364
    std::vector<result<ConversionResult>> results;
388
364
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
364
    std::vector<std::vector<ToType>> outputbuffers;
393
364
    outputbuffers.reserve(implementations.size());
394
1.45k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.09k
      auto impl = implementations[i];
396
1.09k
      const ToType canary1{42};
397
1.09k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.09k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.09k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.09k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.09k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.09k
          return r != 0;
404
1.09k
        } else {
405
1.09k
          return r.error == simdutf::error_code::SUCCESS;
406
1.09k
        }
407
1.09k
      }(implret1);
408
1.09k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.09k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.09k
        const ToType canary2{25};
414
1.09k
        const auto outputbuffer_first_run = outputbuffer;
415
1.09k
        std::ranges::fill(outputbuffer, canary2);
416
1.09k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.09k
                                          src.size(), outputbuffer.data());
418
419
1.09k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.09k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
633
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
633
          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
633
        }
440
1.09k
      }
441
1.09k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.09k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
364
    if (!inputisvalid) {
447
459
      for (auto& e : results) {
448
459
        e.outputhash.clear();
449
459
      }
450
153
    }
451
452
364
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
364
    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
364
    } else {
474
364
      ret.implementations_agree = true;
475
364
    }
476
364
    return ret;
477
364
  }
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
139
                                  const bool inputisvalid) const {
383
139
    conversion_result ret{};
384
385
139
    const auto implementations = get_supported_implementations();
386
387
139
    std::vector<result<ConversionResult>> results;
388
139
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
139
    std::vector<std::vector<ToType>> outputbuffers;
393
139
    outputbuffers.reserve(implementations.size());
394
556
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
417
      auto impl = implementations[i];
396
417
      const ToType canary1{42};
397
417
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
417
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
417
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
417
      const auto success = [](const ConversionResult& r) -> bool {
402
417
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
417
          return r != 0;
404
417
        } else {
405
417
          return r.error == simdutf::error_code::SUCCESS;
406
417
        }
407
417
      }(implret1);
408
417
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
417
      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
417
        const ToType canary2{25};
414
417
        const auto outputbuffer_first_run = outputbuffer;
415
417
        std::ranges::fill(outputbuffer, canary2);
416
417
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
417
                                          src.size(), outputbuffer.data());
418
419
417
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
417
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
150
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
150
          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
150
        }
440
417
      }
441
417
      results.emplace_back(implret1, success ? hash1 : "");
442
417
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
139
    if (!inputisvalid) {
447
117
      for (auto& e : results) {
448
117
        e.outputhash.clear();
449
117
      }
450
39
    }
451
452
139
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
139
    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
139
    } else {
474
139
      ret.implementations_agree = true;
475
139
    }
476
139
    return ret;
477
139
  }
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
209
                                  const bool inputisvalid) const {
383
209
    conversion_result ret{};
384
385
209
    const auto implementations = get_supported_implementations();
386
387
209
    std::vector<result<ConversionResult>> results;
388
209
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
209
    std::vector<std::vector<ToType>> outputbuffers;
393
209
    outputbuffers.reserve(implementations.size());
394
836
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
627
      auto impl = implementations[i];
396
627
      const ToType canary1{42};
397
627
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
627
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
627
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
627
      const auto success = [](const ConversionResult& r) -> bool {
402
627
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
627
          return r != 0;
404
627
        } else {
405
627
          return r.error == simdutf::error_code::SUCCESS;
406
627
        }
407
627
      }(implret1);
408
627
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
627
      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
627
        const ToType canary2{25};
414
627
        const auto outputbuffer_first_run = outputbuffer;
415
627
        std::ranges::fill(outputbuffer, canary2);
416
627
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
627
                                          src.size(), outputbuffer.data());
418
419
627
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
627
        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
627
      }
441
627
      results.emplace_back(implret1, success ? hash1 : "");
442
627
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
209
    if (!inputisvalid) {
447
354
      for (auto& e : results) {
448
354
        e.outputhash.clear();
449
354
      }
450
118
    }
451
452
209
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
209
    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
209
    } else {
474
209
      ret.implementations_agree = true;
475
209
    }
476
209
    return ret;
477
209
  }
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
332
                                  const bool inputisvalid) const {
383
332
    conversion_result ret{};
384
385
332
    const auto implementations = get_supported_implementations();
386
387
332
    std::vector<result<ConversionResult>> results;
388
332
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
332
    std::vector<std::vector<ToType>> outputbuffers;
393
332
    outputbuffers.reserve(implementations.size());
394
1.32k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
996
      auto impl = implementations[i];
396
996
      const ToType canary1{42};
397
996
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
996
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
996
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
996
      const auto success = [](const ConversionResult& r) -> bool {
402
996
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
996
          return r != 0;
404
996
        } else {
405
996
          return r.error == simdutf::error_code::SUCCESS;
406
996
        }
407
996
      }(implret1);
408
996
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
996
      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
996
        const ToType canary2{25};
414
996
        const auto outputbuffer_first_run = outputbuffer;
415
996
        std::ranges::fill(outputbuffer, canary2);
416
996
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
996
                                          src.size(), outputbuffer.data());
418
419
996
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
996
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
591
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
591
          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
591
        }
440
996
      }
441
996
      results.emplace_back(implret1, success ? hash1 : "");
442
996
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
332
    if (!inputisvalid) {
447
405
      for (auto& e : results) {
448
405
        e.outputhash.clear();
449
405
      }
450
135
    }
451
452
332
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
332
    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
332
    } else {
474
332
      ret.implementations_agree = true;
475
332
    }
476
332
    return ret;
477
332
  }
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
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
69
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
69
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
69
        }
440
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
519
      for (auto& e : results) {
448
519
        e.outputhash.clear();
449
519
      }
450
173
    }
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)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
315
                                  const bool inputisvalid) const {
383
315
    conversion_result ret{};
384
385
315
    const auto implementations = get_supported_implementations();
386
387
315
    std::vector<result<ConversionResult>> results;
388
315
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
315
    std::vector<std::vector<ToType>> outputbuffers;
393
315
    outputbuffers.reserve(implementations.size());
394
1.26k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
945
      auto impl = implementations[i];
396
945
      const ToType canary1{42};
397
945
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
945
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
945
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
945
      const auto success = [](const ConversionResult& r) -> bool {
402
945
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
945
          return r != 0;
404
945
        } else {
405
945
          return r.error == simdutf::error_code::SUCCESS;
406
945
        }
407
945
      }(implret1);
408
945
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
945
      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
945
        const ToType canary2{25};
414
945
        const auto outputbuffer_first_run = outputbuffer;
415
945
        std::ranges::fill(outputbuffer, canary2);
416
945
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
945
                                          src.size(), outputbuffer.data());
418
419
945
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
945
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
258
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
258
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
258
        }
440
945
      }
441
945
      results.emplace_back(implret1, success ? hash1 : "");
442
945
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
315
    if (!inputisvalid) {
447
687
      for (auto& e : results) {
448
687
        e.outputhash.clear();
449
687
      }
450
229
    }
451
452
315
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
315
    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
315
    } else {
474
315
      ret.implementations_agree = true;
475
315
    }
476
315
    return ret;
477
315
  }
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
342
                                  const bool inputisvalid) const {
383
342
    conversion_result ret{};
384
385
342
    const auto implementations = get_supported_implementations();
386
387
342
    std::vector<result<ConversionResult>> results;
388
342
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
342
    std::vector<std::vector<ToType>> outputbuffers;
393
342
    outputbuffers.reserve(implementations.size());
394
1.36k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.02k
      auto impl = implementations[i];
396
1.02k
      const ToType canary1{42};
397
1.02k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.02k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.02k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.02k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.02k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.02k
          return r != 0;
404
1.02k
        } else {
405
1.02k
          return r.error == simdutf::error_code::SUCCESS;
406
1.02k
        }
407
1.02k
      }(implret1);
408
1.02k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.02k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.02k
        const ToType canary2{25};
414
1.02k
        const auto outputbuffer_first_run = outputbuffer;
415
1.02k
        std::ranges::fill(outputbuffer, canary2);
416
1.02k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.02k
                                          src.size(), outputbuffer.data());
418
419
1.02k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.02k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
270
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
270
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
270
        }
440
1.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
342
    if (!inputisvalid) {
447
756
      for (auto& e : results) {
448
756
        e.outputhash.clear();
449
756
      }
450
252
    }
451
452
342
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
342
    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
342
    } else {
474
342
      ret.implementations_agree = true;
475
342
    }
476
342
    return ret;
477
342
  }
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
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
351
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
351
          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
351
        }
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
1.05k
      for (auto& e : results) {
448
1.05k
        e.outputhash.clear();
449
1.05k
      }
450
350
    }
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)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
251
                                  const bool inputisvalid) const {
383
251
    conversion_result ret{};
384
385
251
    const auto implementations = get_supported_implementations();
386
387
251
    std::vector<result<ConversionResult>> results;
388
251
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
251
    std::vector<std::vector<ToType>> outputbuffers;
393
251
    outputbuffers.reserve(implementations.size());
394
1.00k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
753
      auto impl = implementations[i];
396
753
      const ToType canary1{42};
397
753
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
753
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
753
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
753
      const auto success = [](const ConversionResult& r) -> bool {
402
753
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
753
          return r != 0;
404
753
        } else {
405
753
          return r.error == simdutf::error_code::SUCCESS;
406
753
        }
407
753
      }(implret1);
408
753
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
753
      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
753
        const ToType canary2{25};
414
753
        const auto outputbuffer_first_run = outputbuffer;
415
753
        std::ranges::fill(outputbuffer, canary2);
416
753
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
753
                                          src.size(), outputbuffer.data());
418
419
753
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
753
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
336
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
336
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
336
        }
440
753
      }
441
753
      results.emplace_back(implret1, success ? hash1 : "");
442
753
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
251
    if (!inputisvalid) {
447
402
      for (auto& e : results) {
448
402
        e.outputhash.clear();
449
402
      }
450
134
    }
451
452
251
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
251
    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
251
    } else {
474
251
      ret.implementations_agree = true;
475
251
    }
476
251
    return ret;
477
251
  }
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
377
                                  const bool inputisvalid) const {
383
377
    conversion_result ret{};
384
385
377
    const auto implementations = get_supported_implementations();
386
387
377
    std::vector<result<ConversionResult>> results;
388
377
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
377
    std::vector<std::vector<ToType>> outputbuffers;
393
377
    outputbuffers.reserve(implementations.size());
394
1.50k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.13k
      auto impl = implementations[i];
396
1.13k
      const ToType canary1{42};
397
1.13k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.13k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.13k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.13k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.13k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.13k
          return r != 0;
404
1.13k
        } else {
405
1.13k
          return r.error == simdutf::error_code::SUCCESS;
406
1.13k
        }
407
1.13k
      }(implret1);
408
1.13k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.13k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.13k
        const ToType canary2{25};
414
1.13k
        const auto outputbuffer_first_run = outputbuffer;
415
1.13k
        std::ranges::fill(outputbuffer, canary2);
416
1.13k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.13k
                                          src.size(), outputbuffer.data());
418
419
1.13k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.13k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
489
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
489
          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
489
        }
440
1.13k
      }
441
1.13k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.13k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
377
    if (!inputisvalid) {
447
642
      for (auto& e : results) {
448
642
        e.outputhash.clear();
449
642
      }
450
214
    }
451
452
377
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
377
    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
377
    } else {
474
377
      ret.implementations_agree = true;
475
377
    }
476
377
    return ret;
477
377
  }
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
306
                                  const bool inputisvalid) const {
383
306
    conversion_result ret{};
384
385
306
    const auto implementations = get_supported_implementations();
386
387
306
    std::vector<result<ConversionResult>> results;
388
306
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
306
    std::vector<std::vector<ToType>> outputbuffers;
393
306
    outputbuffers.reserve(implementations.size());
394
1.22k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
918
      auto impl = implementations[i];
396
918
      const ToType canary1{42};
397
918
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
918
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
918
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
918
      const auto success = [](const ConversionResult& r) -> bool {
402
918
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
918
          return r != 0;
404
918
        } else {
405
918
          return r.error == simdutf::error_code::SUCCESS;
406
918
        }
407
918
      }(implret1);
408
918
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
918
      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
918
        const ToType canary2{25};
414
918
        const auto outputbuffer_first_run = outputbuffer;
415
918
        std::ranges::fill(outputbuffer, canary2);
416
918
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
918
                                          src.size(), outputbuffer.data());
418
419
918
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
918
        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
918
      }
441
918
      results.emplace_back(implret1, success ? hash1 : "");
442
918
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
306
    if (!inputisvalid) {
447
531
      for (auto& e : results) {
448
531
        e.outputhash.clear();
449
531
      }
450
177
    }
451
452
306
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
306
    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
306
    } else {
474
306
      ret.implementations_agree = true;
475
306
    }
476
306
    return ret;
477
306
  }
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
397
                                  const bool inputisvalid) const {
383
397
    conversion_result ret{};
384
385
397
    const auto implementations = get_supported_implementations();
386
387
397
    std::vector<result<ConversionResult>> results;
388
397
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
397
    std::vector<std::vector<ToType>> outputbuffers;
393
397
    outputbuffers.reserve(implementations.size());
394
1.58k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.19k
      auto impl = implementations[i];
396
1.19k
      const ToType canary1{42};
397
1.19k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.19k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.19k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.19k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.19k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.19k
          return r != 0;
404
1.19k
        } else {
405
1.19k
          return r.error == simdutf::error_code::SUCCESS;
406
1.19k
        }
407
1.19k
      }(implret1);
408
1.19k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.19k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.19k
        const ToType canary2{25};
414
1.19k
        const auto outputbuffer_first_run = outputbuffer;
415
1.19k
        std::ranges::fill(outputbuffer, canary2);
416
1.19k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.19k
                                          src.size(), outputbuffer.data());
418
419
1.19k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.19k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
540
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
540
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
540
        }
440
1.19k
      }
441
1.19k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.19k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
397
    if (!inputisvalid) {
447
651
      for (auto& e : results) {
448
651
        e.outputhash.clear();
449
651
      }
450
217
    }
451
452
397
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
397
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
397
    } else {
474
397
      ret.implementations_agree = true;
475
397
    }
476
397
    return ret;
477
397
  }
Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
55
                                  const bool inputisvalid) const {
383
55
    conversion_result ret{};
384
385
55
    const auto implementations = get_supported_implementations();
386
387
55
    std::vector<result<ConversionResult>> results;
388
55
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
55
    std::vector<std::vector<ToType>> outputbuffers;
393
55
    outputbuffers.reserve(implementations.size());
394
220
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
165
      auto impl = implementations[i];
396
165
      const ToType canary1{42};
397
165
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
165
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
165
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
165
      const auto success = [](const ConversionResult& r) -> bool {
402
165
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
165
          return r != 0;
404
165
        } else {
405
165
          return r.error == simdutf::error_code::SUCCESS;
406
165
        }
407
165
      }(implret1);
408
165
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
165
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
165
        const ToType canary2{25};
414
165
        const auto outputbuffer_first_run = outputbuffer;
415
165
        std::ranges::fill(outputbuffer, canary2);
416
165
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
165
                                          src.size(), outputbuffer.data());
418
419
165
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
165
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
159
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
159
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
159
        }
440
165
      }
441
165
      results.emplace_back(implret1, success ? hash1 : "");
442
165
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
55
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
55
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
55
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
55
    } else {
474
55
      ret.implementations_agree = true;
475
55
    }
476
55
    return ret;
477
55
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
44
                                  const bool inputisvalid) const {
383
44
    conversion_result ret{};
384
385
44
    const auto implementations = get_supported_implementations();
386
387
44
    std::vector<result<ConversionResult>> results;
388
44
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
44
    std::vector<std::vector<ToType>> outputbuffers;
393
44
    outputbuffers.reserve(implementations.size());
394
176
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
132
      auto impl = implementations[i];
396
132
      const ToType canary1{42};
397
132
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
132
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
132
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
132
      const auto success = [](const ConversionResult& r) -> bool {
402
132
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
132
          return r != 0;
404
132
        } else {
405
132
          return r.error == simdutf::error_code::SUCCESS;
406
132
        }
407
132
      }(implret1);
408
132
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
132
      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
132
        const ToType canary2{25};
414
132
        const auto outputbuffer_first_run = outputbuffer;
415
132
        std::ranges::fill(outputbuffer, canary2);
416
132
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
132
                                          src.size(), outputbuffer.data());
418
419
132
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
132
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
126
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
126
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
126
        }
440
132
      }
441
132
      results.emplace_back(implret1, success ? hash1 : "");
442
132
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
44
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
44
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
44
    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
44
    } else {
474
44
      ret.implementations_agree = true;
475
44
    }
476
44
    return ret;
477
44
  }
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
43
                                  const bool inputisvalid) const {
383
43
    conversion_result ret{};
384
385
43
    const auto implementations = get_supported_implementations();
386
387
43
    std::vector<result<ConversionResult>> results;
388
43
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
43
    std::vector<std::vector<ToType>> outputbuffers;
393
43
    outputbuffers.reserve(implementations.size());
394
172
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
129
      auto impl = implementations[i];
396
129
      const ToType canary1{42};
397
129
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
129
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
129
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
129
      const auto success = [](const ConversionResult& r) -> bool {
402
129
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
129
          return r != 0;
404
129
        } else {
405
129
          return r.error == simdutf::error_code::SUCCESS;
406
129
        }
407
129
      }(implret1);
408
129
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
129
      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
129
        const ToType canary2{25};
414
129
        const auto outputbuffer_first_run = outputbuffer;
415
129
        std::ranges::fill(outputbuffer, canary2);
416
129
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
129
                                          src.size(), outputbuffer.data());
418
419
129
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
129
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
123
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
123
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
123
        }
440
129
      }
441
129
      results.emplace_back(implret1, success ? hash1 : "");
442
129
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
43
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
43
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
43
    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
43
    } else {
474
43
      ret.implementations_agree = true;
475
43
    }
476
43
    return ret;
477
43
  }
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
303
                                  const bool inputisvalid) const {
383
303
    conversion_result ret{};
384
385
303
    const auto implementations = get_supported_implementations();
386
387
303
    std::vector<result<ConversionResult>> results;
388
303
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
303
    std::vector<std::vector<ToType>> outputbuffers;
393
303
    outputbuffers.reserve(implementations.size());
394
1.21k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
909
      auto impl = implementations[i];
396
909
      const ToType canary1{42};
397
909
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
909
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
909
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
909
      const auto success = [](const ConversionResult& r) -> bool {
402
909
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
909
          return r != 0;
404
909
        } else {
405
909
          return r.error == simdutf::error_code::SUCCESS;
406
909
        }
407
909
      }(implret1);
408
909
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
909
      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
909
        const ToType canary2{25};
414
909
        const auto outputbuffer_first_run = outputbuffer;
415
909
        std::ranges::fill(outputbuffer, canary2);
416
909
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
909
                                          src.size(), outputbuffer.data());
418
419
909
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
909
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
903
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
903
          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
903
        }
440
909
      }
441
909
      results.emplace_back(implret1, success ? hash1 : "");
442
909
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
303
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
303
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
303
    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
303
    } else {
474
303
      ret.implementations_agree = true;
475
303
    }
476
303
    return ret;
477
303
  }
478
479
0
  void dump_testcase(FromSpan typedspan, std::ostream& os) const {
480
0
    const auto testhash = FNV1A_hash::as_str(name, typedspan);
481
482
0
    os << "// begin testcase\n";
483
0
    os << "TEST(issue_" << name << "_" << testhash << ") {\n";
484
0
    os << " alignas(" << sizeof(FromType) << ") const unsigned char data[]={";
485
0
    const auto first = reinterpret_cast<const unsigned char*>(typedspan.data());
486
0
    const auto last = first + typedspan.size_bytes();
487
0
    for (auto it = first; it != last; ++it) {
488
0
      os << "0x" << std::hex << std::setfill('0') << std::setw(2) << (+*it)
489
0
         << (it + 1 == last ? "};\n" : ", ");
490
0
    }
491
0
    os << " constexpr std::size_t data_len_bytes=sizeof(data);\n";
492
0
    os << " constexpr std::size_t data_len=data_len_bytes/sizeof("
493
0
       << nameoftype(FromType{}) << ");\n";
494
0
    if constexpr (From != UtfEncodings::LATIN1) {
495
0
      os << "const auto validation1=implementation."
496
0
         << ValidationFunctionTrait<From>::ValidationWithErrorsName
497
0
         << "((const " << nameoftype(FromType{}) << "*) data,\n data_len);\n";
498
0
      os << "   ASSERT_EQUAL(validation1.count, 1234);\n";
499
0
      os << "   ASSERT_EQUAL(validation1.error, "
500
0
            "simdutf::error_code::SUCCESS);\n";
501
0
      os << '\n';
502
0
      os << "const bool validation2=implementation."
503
0
         << ValidationFunctionTrait<From>::ValidationName << "((const "
504
0
         << nameoftype(FromType{}) << "*) data,\n data_len);\n";
505
0
      os << "   "
506
0
            "ASSERT_EQUAL(validation1.error==simdutf::error_code::SUCCESS,"
507
0
            "validation2);\n";
508
0
      os << '\n';
509
0
      os << " if(validation1.error!= simdutf::error_code::SUCCESS) {return;}\n";
510
0
    }
511
512
0
    if (std::is_invocable_v<LengthFunction, const simdutf::implementation*,
513
0
                            const FromType*, std::size_t>) {
514
0
      os << "const auto outlen=implementation." << lengthcalcname << "((const "
515
0
         << nameoftype(FromType{}) << "*) data,\n data_len);\n";
516
0
    } else if (std::is_invocable_v<LengthFunction,
517
0
                                   const simdutf::implementation*,
518
0
                                   std::size_t>) {
519
0
      os << "const auto outlen=implementation." << lengthcalcname
520
0
         << "(data_len);\n";
521
0
    } else {
522
      // programming error
523
0
      std::abort();
524
0
    }
525
0
    os << "ASSERT_EQUAL(outlen, 1234);\n";
526
0
    os << "std::vector<" << nameoftype(ToType{}) << "> output(outlen);\n";
527
0
    os << "const auto r = implementation." << name << "((const "
528
0
       << nameoftype(FromType{}) << "*) data\n, data_len\n, output.data());\n";
529
530
0
    if constexpr (std::is_same_v<ConversionResult, simdutf::result>) {
531
0
      os << " ASSERT_EQUAL(r.error,simdutf::error_code::SUCCESS);\n";
532
0
      os << " ASSERT_EQUAL(r.count,1234);\n";
533
0
    } else {
534
0
      os << "   ASSERT_EQUAL(r, 1234);\n";
535
0
    }
536
537
    // dump the output data
538
0
    os << "const std::vector<" << nameoftype(ToType{}) << "> expected_out{};\n";
539
0
    os << " ASSERT_TRUE(output.size()==expected_out.size());\n";
540
0
    os << " for(std::size_t i=0; i<output.size(); ++i) { "
541
0
          "ASSERT_EQUAL(+output.at(i),+expected_out.at(i));};\n";
542
543
0
    os << "}\n";
544
0
    os << "// end testcase\n";
545
0
  }
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)0, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char32_t const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
Unexecuted instantiation: Conversion<(UtfEncodings)4, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char*) noexcept const>::dump_testcase(std::__1::span<char const, 18446744073709551615ul>, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const
546
};
547
548
1
const auto populate_functions() {
549
1
  using I = simdutf::implementation;
550
1
  using FuzzSignature = void (*)(std::span<const char>);
551
552
1
#define ADD(lenfunc, conversionfunc)                                           \
553
42
  FuzzSignature {                                                              \
554
9.24k
    +[](std::span<const char> chardata) {                                      \
555
9.24k
      const auto c =                                                           \
556
9.24k
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
9.24k
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
9.24k
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
9.24k
              &I::lenfunc, &I::conversionfunc,                                 \
560
9.24k
              std::string{NAMEOF(&I::lenfunc)},                                \
561
9.24k
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
9.24k
      c.fuzz(chardata);                                                        \
563
9.24k
    }                                                                          \
conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
99
    +[](std::span<const char> chardata) {                                      \
555
99
      const auto c =                                                           \
556
99
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
99
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
99
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
99
              &I::lenfunc, &I::conversionfunc,                                 \
560
99
              std::string{NAMEOF(&I::lenfunc)},                                \
561
99
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
99
      c.fuzz(chardata);                                                        \
563
99
    }                                                                          \
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
216
    +[](std::span<const char> chardata) {                                      \
555
216
      const auto c =                                                           \
556
216
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
216
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
216
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
216
              &I::lenfunc, &I::conversionfunc,                                 \
560
216
              std::string{NAMEOF(&I::lenfunc)},                                \
561
216
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
216
      c.fuzz(chardata);                                                        \
563
216
    }                                                                          \
conversion.cpp:populate_functions()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
58
    +[](std::span<const char> chardata) {                                      \
555
58
      const auto c =                                                           \
556
58
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
58
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
58
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
58
              &I::lenfunc, &I::conversionfunc,                                 \
560
58
              std::string{NAMEOF(&I::lenfunc)},                                \
561
58
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
58
      c.fuzz(chardata);                                                        \
563
58
    }                                                                          \
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
236
    +[](std::span<const char> chardata) {                                      \
555
236
      const auto c =                                                           \
556
236
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
236
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
236
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
236
              &I::lenfunc, &I::conversionfunc,                                 \
560
236
              std::string{NAMEOF(&I::lenfunc)},                                \
561
236
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
236
      c.fuzz(chardata);                                                        \
563
236
    }                                                                          \
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
66
    +[](std::span<const char> chardata) {                                      \
555
66
      const auto c =                                                           \
556
66
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
66
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
66
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
66
              &I::lenfunc, &I::conversionfunc,                                 \
560
66
              std::string{NAMEOF(&I::lenfunc)},                                \
561
66
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
66
      c.fuzz(chardata);                                                        \
563
66
    }                                                                          \
conversion.cpp:populate_functions()::$_5::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()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
115
    +[](std::span<const char> chardata) {                                      \
555
115
      const auto c =                                                           \
556
115
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
115
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
115
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
115
              &I::lenfunc, &I::conversionfunc,                                 \
560
115
              std::string{NAMEOF(&I::lenfunc)},                                \
561
115
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
115
      c.fuzz(chardata);                                                        \
563
115
    }                                                                          \
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
248
    +[](std::span<const char> chardata) {                                      \
555
248
      const auto c =                                                           \
556
248
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
248
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
248
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
248
              &I::lenfunc, &I::conversionfunc,                                 \
560
248
              std::string{NAMEOF(&I::lenfunc)},                                \
561
248
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
248
      c.fuzz(chardata);                                                        \
563
248
    }                                                                          \
conversion.cpp:populate_functions()::$_8::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()::$_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
47
    +[](std::span<const char> chardata) {                                      \
555
47
      const auto c =                                                           \
556
47
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
47
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
47
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
47
              &I::lenfunc, &I::conversionfunc,                                 \
560
47
              std::string{NAMEOF(&I::lenfunc)},                                \
561
47
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
47
      c.fuzz(chardata);                                                        \
563
47
    }                                                                          \
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
110
    +[](std::span<const char> chardata) {                                      \
555
110
      const auto c =                                                           \
556
110
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
110
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
110
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
110
              &I::lenfunc, &I::conversionfunc,                                 \
560
110
              std::string{NAMEOF(&I::lenfunc)},                                \
561
110
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
110
      c.fuzz(chardata);                                                        \
563
110
    }                                                                          \
conversion.cpp:populate_functions()::$_12::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
176
    +[](std::span<const char> chardata) {                                      \
555
176
      const auto c =                                                           \
556
176
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
176
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
176
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
176
              &I::lenfunc, &I::conversionfunc,                                 \
560
176
              std::string{NAMEOF(&I::lenfunc)},                                \
561
176
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
176
      c.fuzz(chardata);                                                        \
563
176
    }                                                                          \
conversion.cpp:populate_functions()::$_13::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
67
    +[](std::span<const char> chardata) {                                      \
555
67
      const auto c =                                                           \
556
67
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
67
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
67
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
67
              &I::lenfunc, &I::conversionfunc,                                 \
560
67
              std::string{NAMEOF(&I::lenfunc)},                                \
561
67
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
67
      c.fuzz(chardata);                                                        \
563
67
    }                                                                          \
conversion.cpp:populate_functions()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
153
    +[](std::span<const char> chardata) {                                      \
555
153
      const auto c =                                                           \
556
153
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
153
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
153
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
153
              &I::lenfunc, &I::conversionfunc,                                 \
560
153
              std::string{NAMEOF(&I::lenfunc)},                                \
561
153
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
153
      c.fuzz(chardata);                                                        \
563
153
    }                                                                          \
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
208
    +[](std::span<const char> chardata) {                                      \
555
208
      const auto c =                                                           \
556
208
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
208
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
208
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
208
              &I::lenfunc, &I::conversionfunc,                                 \
560
208
              std::string{NAMEOF(&I::lenfunc)},                                \
561
208
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
208
      c.fuzz(chardata);                                                        \
563
208
    }                                                                          \
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
86
    +[](std::span<const char> chardata) {                                      \
555
86
      const auto c =                                                           \
556
86
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
86
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
86
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
86
              &I::lenfunc, &I::conversionfunc,                                 \
560
86
              std::string{NAMEOF(&I::lenfunc)},                                \
561
86
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
86
      c.fuzz(chardata);                                                        \
563
86
    }                                                                          \
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
267
    +[](std::span<const char> chardata) {                                      \
555
267
      const auto c =                                                           \
556
267
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
267
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
267
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
267
              &I::lenfunc, &I::conversionfunc,                                 \
560
267
              std::string{NAMEOF(&I::lenfunc)},                                \
561
267
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
267
      c.fuzz(chardata);                                                        \
563
267
    }                                                                          \
conversion.cpp:populate_functions()::$_18::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
263
    +[](std::span<const char> chardata) {                                      \
555
263
      const auto c =                                                           \
556
263
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
263
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
263
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
263
              &I::lenfunc, &I::conversionfunc,                                 \
560
263
              std::string{NAMEOF(&I::lenfunc)},                                \
561
263
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
263
      c.fuzz(chardata);                                                        \
563
263
    }                                                                          \
conversion.cpp:populate_functions()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
355
    +[](std::span<const char> chardata) {                                      \
555
355
      const auto c =                                                           \
556
355
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
355
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
355
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
355
              &I::lenfunc, &I::conversionfunc,                                 \
560
355
              std::string{NAMEOF(&I::lenfunc)},                                \
561
355
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
355
      c.fuzz(chardata);                                                        \
563
355
    }                                                                          \
conversion.cpp:populate_functions()::$_20::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
295
    +[](std::span<const char> chardata) {                                      \
555
295
      const auto c =                                                           \
556
295
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
295
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
295
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
295
              &I::lenfunc, &I::conversionfunc,                                 \
560
295
              std::string{NAMEOF(&I::lenfunc)},                                \
561
295
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
295
      c.fuzz(chardata);                                                        \
563
295
    }                                                                          \
conversion.cpp:populate_functions()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
378
    +[](std::span<const char> chardata) {                                      \
555
378
      const auto c =                                                           \
556
378
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
378
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
378
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
378
              &I::lenfunc, &I::conversionfunc,                                 \
560
378
              std::string{NAMEOF(&I::lenfunc)},                                \
561
378
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
378
      c.fuzz(chardata);                                                        \
563
378
    }                                                                          \
conversion.cpp:populate_functions()::$_22::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
360
    +[](std::span<const char> chardata) {                                      \
555
360
      const auto c =                                                           \
556
360
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
360
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
360
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
360
              &I::lenfunc, &I::conversionfunc,                                 \
560
360
              std::string{NAMEOF(&I::lenfunc)},                                \
561
360
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
360
      c.fuzz(chardata);                                                        \
563
360
    }                                                                          \
conversion.cpp:populate_functions()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
392
    +[](std::span<const char> chardata) {                                      \
555
392
      const auto c =                                                           \
556
392
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
392
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
392
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
392
              &I::lenfunc, &I::conversionfunc,                                 \
560
392
              std::string{NAMEOF(&I::lenfunc)},                                \
561
392
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
392
      c.fuzz(chardata);                                                        \
563
392
    }                                                                          \
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
125
    +[](std::span<const char> chardata) {                                      \
555
125
      const auto c =                                                           \
556
125
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
125
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
125
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
125
              &I::lenfunc, &I::conversionfunc,                                 \
560
125
              std::string{NAMEOF(&I::lenfunc)},                                \
561
125
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
125
      c.fuzz(chardata);                                                        \
563
125
    }                                                                          \
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
173
    +[](std::span<const char> chardata) {                                      \
555
173
      const auto c =                                                           \
556
173
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
173
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
173
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
173
              &I::lenfunc, &I::conversionfunc,                                 \
560
173
              std::string{NAMEOF(&I::lenfunc)},                                \
561
173
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
173
      c.fuzz(chardata);                                                        \
563
173
    }                                                                          \
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
364
    +[](std::span<const char> chardata) {                                      \
555
364
      const auto c =                                                           \
556
364
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
364
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
364
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
364
              &I::lenfunc, &I::conversionfunc,                                 \
560
364
              std::string{NAMEOF(&I::lenfunc)},                                \
561
364
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
364
      c.fuzz(chardata);                                                        \
563
364
    }                                                                          \
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
139
    +[](std::span<const char> chardata) {                                      \
555
139
      const auto c =                                                           \
556
139
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
139
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
139
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
139
              &I::lenfunc, &I::conversionfunc,                                 \
560
139
              std::string{NAMEOF(&I::lenfunc)},                                \
561
139
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
139
      c.fuzz(chardata);                                                        \
563
139
    }                                                                          \
conversion.cpp:populate_functions()::$_28::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
209
    +[](std::span<const char> chardata) {                                      \
555
209
      const auto c =                                                           \
556
209
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
209
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
209
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
209
              &I::lenfunc, &I::conversionfunc,                                 \
560
209
              std::string{NAMEOF(&I::lenfunc)},                                \
561
209
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
209
      c.fuzz(chardata);                                                        \
563
209
    }                                                                          \
conversion.cpp:populate_functions()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
332
    +[](std::span<const char> chardata) {                                      \
555
332
      const auto c =                                                           \
556
332
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
332
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
332
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
332
              &I::lenfunc, &I::conversionfunc,                                 \
560
332
              std::string{NAMEOF(&I::lenfunc)},                                \
561
332
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
332
      c.fuzz(chardata);                                                        \
563
332
    }                                                                          \
conversion.cpp:populate_functions()::$_30::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
204
    +[](std::span<const char> chardata) {                                      \
555
204
      const auto c =                                                           \
556
204
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
204
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
204
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
204
              &I::lenfunc, &I::conversionfunc,                                 \
560
204
              std::string{NAMEOF(&I::lenfunc)},                                \
561
204
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
204
      c.fuzz(chardata);                                                        \
563
204
    }                                                                          \
conversion.cpp:populate_functions()::$_31::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
315
    +[](std::span<const char> chardata) {                                      \
555
315
      const auto c =                                                           \
556
315
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
315
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
315
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
315
              &I::lenfunc, &I::conversionfunc,                                 \
560
315
              std::string{NAMEOF(&I::lenfunc)},                                \
561
315
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
315
      c.fuzz(chardata);                                                        \
563
315
    }                                                                          \
conversion.cpp:populate_functions()::$_32::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
342
    +[](std::span<const char> chardata) {                                      \
555
342
      const auto c =                                                           \
556
342
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
342
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
342
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
342
              &I::lenfunc, &I::conversionfunc,                                 \
560
342
              std::string{NAMEOF(&I::lenfunc)},                                \
561
342
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
342
      c.fuzz(chardata);                                                        \
563
342
    }                                                                          \
conversion.cpp:populate_functions()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
467
    +[](std::span<const char> chardata) {                                      \
555
467
      const auto c =                                                           \
556
467
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
467
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
467
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
467
              &I::lenfunc, &I::conversionfunc,                                 \
560
467
              std::string{NAMEOF(&I::lenfunc)},                                \
561
467
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
467
      c.fuzz(chardata);                                                        \
563
467
    }                                                                          \
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
251
    +[](std::span<const char> chardata) {                                      \
555
251
      const auto c =                                                           \
556
251
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
251
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
251
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
251
              &I::lenfunc, &I::conversionfunc,                                 \
560
251
              std::string{NAMEOF(&I::lenfunc)},                                \
561
251
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
251
      c.fuzz(chardata);                                                        \
563
251
    }                                                                          \
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
377
    +[](std::span<const char> chardata) {                                      \
555
377
      const auto c =                                                           \
556
377
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
377
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
377
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
377
              &I::lenfunc, &I::conversionfunc,                                 \
560
377
              std::string{NAMEOF(&I::lenfunc)},                                \
561
377
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
377
      c.fuzz(chardata);                                                        \
563
377
    }                                                                          \
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
306
    +[](std::span<const char> chardata) {                                      \
555
306
      const auto c =                                                           \
556
306
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
306
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
306
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
306
              &I::lenfunc, &I::conversionfunc,                                 \
560
306
              std::string{NAMEOF(&I::lenfunc)},                                \
561
306
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
306
      c.fuzz(chardata);                                                        \
563
306
    }                                                                          \
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
397
    +[](std::span<const char> chardata) {                                      \
555
397
      const auto c =                                                           \
556
397
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
397
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
397
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
397
              &I::lenfunc, &I::conversionfunc,                                 \
560
397
              std::string{NAMEOF(&I::lenfunc)},                                \
561
397
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
397
      c.fuzz(chardata);                                                        \
563
397
    }                                                                          \
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
55
    +[](std::span<const char> chardata) {                                      \
555
55
      const auto c =                                                           \
556
55
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
55
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
55
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
55
              &I::lenfunc, &I::conversionfunc,                                 \
560
55
              std::string{NAMEOF(&I::lenfunc)},                                \
561
55
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
55
      c.fuzz(chardata);                                                        \
563
55
    }                                                                          \
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
44
    +[](std::span<const char> chardata) {                                      \
555
44
      const auto c =                                                           \
556
44
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
44
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
44
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
44
              &I::lenfunc, &I::conversionfunc,                                 \
560
44
              std::string{NAMEOF(&I::lenfunc)},                                \
561
44
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
44
      c.fuzz(chardata);                                                        \
563
44
    }                                                                          \
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
43
    +[](std::span<const char> chardata) {                                      \
555
43
      const auto c =                                                           \
556
43
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
43
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
43
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
43
              &I::lenfunc, &I::conversionfunc,                                 \
560
43
              std::string{NAMEOF(&I::lenfunc)},                                \
561
43
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
43
      c.fuzz(chardata);                                                        \
563
43
    }                                                                          \
conversion.cpp:populate_functions()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
303
    +[](std::span<const char> chardata) {                                      \
555
303
      const auto c =                                                           \
556
303
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
303
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
303
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
303
              &I::lenfunc, &I::conversionfunc,                                 \
560
303
              std::string{NAMEOF(&I::lenfunc)},                                \
561
303
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
303
      c.fuzz(chardata);                                                        \
563
303
    }                                                                          \
564
42
  }
565
566
1
  return std::array{
567
      // all these cases require valid input for invoking the convert function
568
569
      // see #493
570
      // IGNORE(latin1_length_from_utf16, convert_valid_utf16be_to_latin1),
571
1
      ADD(utf32_length_from_utf16be, convert_valid_utf16be_to_utf32),
572
1
      ADD(utf8_length_from_utf16be, convert_valid_utf16be_to_utf8),
573
574
      //  see #493
575
      // IGNORE(latin1_length_from_utf16, convert_valid_utf16le_to_latin1),
576
1
      ADD(utf32_length_from_utf16le, convert_valid_utf16le_to_utf32),
577
1
      ADD(utf8_length_from_utf16le, convert_valid_utf16le_to_utf8),
578
579
      // see #493
580
      // IGNORE(latin1_length_from_utf32, convert_valid_utf32_to_latin1),
581
1
      ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16be),
582
1
      ADD(utf16_length_from_utf32, convert_valid_utf32_to_utf16le),
583
1
      ADD(utf8_length_from_utf32, convert_valid_utf32_to_utf8),
584
585
      // see #493
586
      // IGNORE(latin1_length_from_utf8, convert_valid_utf8_to_latin1),
587
1
      ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16be),
588
1
      ADD(utf16_length_from_utf8, convert_valid_utf8_to_utf16le),
589
1
      ADD(utf32_length_from_utf8, convert_valid_utf8_to_utf32),
590
591
      // all these cases operate on arbitrary data
592
1
      ADD(latin1_length_from_utf16, convert_utf16be_to_latin1),
593
1
      ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32),
594
1
      ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8),
595
596
1
      ADD(latin1_length_from_utf16, convert_utf16le_to_latin1),
597
1
      ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32),
598
1
      ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8),
599
600
1
      ADD(latin1_length_from_utf32, convert_utf32_to_latin1),
601
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16be),
602
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16le),
603
1
      ADD(utf8_length_from_utf32, convert_utf32_to_utf8),
604
605
1
      ADD(latin1_length_from_utf8, convert_utf8_to_latin1),
606
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16be),
607
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16le),
608
1
      ADD(utf32_length_from_utf8, convert_utf8_to_utf32),
609
610
      // all these cases operate on arbitrary data and use the _with_errors
611
      // variant
612
1
      ADD(latin1_length_from_utf16, convert_utf16be_to_latin1_with_errors),
613
1
      ADD(utf32_length_from_utf16be, convert_utf16be_to_utf32_with_errors),
614
1
      ADD(utf8_length_from_utf16be, convert_utf16be_to_utf8_with_errors),
615
616
1
      ADD(latin1_length_from_utf16, convert_utf16le_to_latin1_with_errors),
617
1
      ADD(utf32_length_from_utf16le, convert_utf16le_to_utf32_with_errors),
618
1
      ADD(utf8_length_from_utf16le, convert_utf16le_to_utf8_with_errors),
619
620
1
      ADD(latin1_length_from_utf32, convert_utf32_to_latin1_with_errors),
621
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16be_with_errors),
622
1
      ADD(utf16_length_from_utf32, convert_utf32_to_utf16le_with_errors),
623
1
      ADD(utf8_length_from_utf32, convert_utf32_to_utf8_with_errors),
624
625
1
      ADD(latin1_length_from_utf8, convert_utf8_to_latin1_with_errors),
626
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16be_with_errors),
627
1
      ADD(utf16_length_from_utf8, convert_utf8_to_utf16le_with_errors),
628
1
      ADD(utf32_length_from_utf8, convert_utf8_to_utf32_with_errors),
629
630
      // these are a bit special since all input is valid
631
1
      ADD(utf32_length_from_latin1, convert_latin1_to_utf32),
632
1
      ADD(utf16_length_from_latin1, convert_latin1_to_utf16be),
633
1
      ADD(utf16_length_from_latin1, convert_latin1_to_utf16le),
634
1
      ADD(utf8_length_from_latin1, convert_latin1_to_utf8)};
635
636
1
#undef ADD
637
1
}
638
639
9.24k
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
640
9.24k
  static const auto fptrs = populate_functions();
641
9.24k
  constexpr std::size_t Ncases = fptrs.size();
642
643
  // pick one of the function pointers, based on the fuzz data
644
  // the first byte is which action to take. step forward
645
  // several bytes so the input is aligned.
646
9.24k
  if (size < 4) {
647
3
    return 0;
648
3
  }
649
650
9.24k
  constexpr auto actionmask = std::bit_ceil(Ncases) - 1;
651
9.24k
  const auto action = data[0] & actionmask;
652
9.24k
  data += 4;
653
9.24k
  size -= 4;
654
655
9.24k
  if (action >= Ncases) {
656
1
    return 0;
657
1
  }
658
659
9.24k
  if constexpr (use_separate_allocation) {
660
    // this is better at exercising null input and catch buffer underflows
661
9.24k
    const std::vector<char> separate{data, data + size};
662
9.24k
    fptrs[action](std::span(separate));
663
  } else {
664
    std::span<const char> chardata{(const char*)data, size};
665
    fptrs[action](chardata);
666
  }
667
668
9.24k
  return 0;
669
9.24k
}