Coverage Report

Created: 2026-07-16 06:41

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.07k
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
9.07k
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
9.07k
                        chardata.size() / sizeof(FromType)};
179
180
9.07k
    static const bool do_print_testcase =
181
9.07k
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
9.07k
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
9.07k
    do {
189
      // step 0 - is the input valid?
190
9.07k
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
9.07k
      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.11k
                    From == UtfEncodings::UTF8) {
198
6.11k
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
6.11k
      }
201
202
      // step 2 - what is the required size of the output?
203
6.11k
      const auto [output_length, length_agree] =
204
9.07k
          calculate_length(from, inputisvalid);
205
9.07k
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
9.07k
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
90
        return;
211
90
      }
212
213
      // step 3 - run the conversion
214
8.98k
      const auto [written, outputs_agree] =
215
8.98k
          do_conversion(from, output_length, inputisvalid);
216
8.98k
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
8.98k
      return;
221
8.98k
    } 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.07k
  }
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
208
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
208
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
208
                        chardata.size() / sizeof(FromType)};
179
180
208
    static const bool do_print_testcase =
181
208
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
208
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
208
    do {
189
      // step 0 - is the input valid?
190
208
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
208
      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
208
                    From == UtfEncodings::UTF8) {
198
208
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
208
      }
201
202
      // step 2 - what is the required size of the output?
203
208
      const auto [output_length, length_agree] =
204
208
          calculate_length(from, inputisvalid);
205
208
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
208
      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
192
      const auto [written, outputs_agree] =
215
192
          do_conversion(from, output_length, inputisvalid);
216
192
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
192
      return;
221
192
    } 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
208
  }
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
383
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
383
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
383
                        chardata.size() / sizeof(FromType)};
179
180
383
    static const bool do_print_testcase =
181
383
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
383
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
383
    do {
189
      // step 0 - is the input valid?
190
383
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
383
      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
383
                    From == UtfEncodings::UTF8) {
198
383
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
383
      }
201
202
      // step 2 - what is the required size of the output?
203
383
      const auto [output_length, length_agree] =
204
383
          calculate_length(from, inputisvalid);
205
383
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
383
      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
371
      const auto [written, outputs_agree] =
215
371
          do_conversion(from, output_length, inputisvalid);
216
371
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
371
      return;
221
371
    } 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
383
  }
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
213
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
213
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
213
                        chardata.size() / sizeof(FromType)};
179
180
213
    static const bool do_print_testcase =
181
213
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
213
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
213
    do {
189
      // step 0 - is the input valid?
190
213
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
213
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
213
                    From == UtfEncodings::UTF8) {
198
213
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
213
      }
201
202
      // step 2 - what is the required size of the output?
203
213
      const auto [output_length, length_agree] =
204
213
          calculate_length(from, inputisvalid);
205
213
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
213
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
6
        return;
211
6
      }
212
213
      // step 3 - run the conversion
214
207
      const auto [written, outputs_agree] =
215
207
          do_conversion(from, output_length, inputisvalid);
216
207
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
207
      return;
221
207
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
213
  }
Conversion<(UtfEncodings)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
428
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
428
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
428
                        chardata.size() / sizeof(FromType)};
179
180
428
    static const bool do_print_testcase =
181
428
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
428
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
428
    do {
189
      // step 0 - is the input valid?
190
428
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
428
      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
428
                    From == UtfEncodings::UTF8) {
198
428
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
428
      }
201
202
      // step 2 - what is the required size of the output?
203
428
      const auto [output_length, length_agree] =
204
428
          calculate_length(from, inputisvalid);
205
428
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
428
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
9
        return;
211
9
      }
212
213
      // step 3 - run the conversion
214
419
      const auto [written, outputs_agree] =
215
419
          do_conversion(from, output_length, inputisvalid);
216
419
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
419
      return;
221
419
    } 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
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>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
319
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
319
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
319
                        chardata.size() / sizeof(FromType)};
179
180
319
    static const bool do_print_testcase =
181
319
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
319
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
319
    do {
189
      // step 0 - is the input valid?
190
319
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
319
      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
319
      const auto [output_length, length_agree] =
204
319
          calculate_length(from, inputisvalid);
205
319
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
319
      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
317
      const auto [written, outputs_agree] =
215
317
          do_conversion(from, output_length, inputisvalid);
216
317
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
317
      return;
221
317
    } 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
319
  }
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
376
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
376
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
376
                        chardata.size() / sizeof(FromType)};
179
180
376
    static const bool do_print_testcase =
181
376
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
376
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
376
    do {
189
      // step 0 - is the input valid?
190
376
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
376
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    From == UtfEncodings::UTF8) {
198
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
          break;
200
      }
201
202
      // step 2 - what is the required size of the output?
203
376
      const auto [output_length, length_agree] =
204
376
          calculate_length(from, inputisvalid);
205
376
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
376
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
7
        return;
211
7
      }
212
213
      // step 3 - run the conversion
214
369
      const auto [written, outputs_agree] =
215
369
          do_conversion(from, output_length, inputisvalid);
216
369
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
369
      return;
221
369
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
376
  }
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
438
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
438
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
438
                        chardata.size() / sizeof(FromType)};
179
180
438
    static const bool do_print_testcase =
181
438
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
438
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
438
    do {
189
      // step 0 - is the input valid?
190
438
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
438
      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
438
      const auto [output_length, length_agree] =
204
438
          calculate_length(from, inputisvalid);
205
438
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
438
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
8
        return;
211
8
      }
212
213
      // step 3 - run the conversion
214
430
      const auto [written, outputs_agree] =
215
430
          do_conversion(from, output_length, inputisvalid);
216
430
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
430
      return;
221
430
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
438
  }
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
623
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
623
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
623
                        chardata.size() / sizeof(FromType)};
179
180
623
    static const bool do_print_testcase =
181
623
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
623
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
623
    do {
189
      // step 0 - is the input valid?
190
623
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
623
      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
623
                    From == UtfEncodings::UTF8) {
198
623
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
623
      }
201
202
      // step 2 - what is the required size of the output?
203
623
      const auto [output_length, length_agree] =
204
623
          calculate_length(from, inputisvalid);
205
623
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
623
      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
607
      const auto [written, outputs_agree] =
215
607
          do_conversion(from, output_length, inputisvalid);
216
607
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
607
      return;
221
607
    } 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
623
  }
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
603
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
603
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
603
                        chardata.size() / sizeof(FromType)};
179
180
603
    static const bool do_print_testcase =
181
603
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
603
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
603
    do {
189
      // step 0 - is the input valid?
190
603
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
603
      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
603
                    From == UtfEncodings::UTF8) {
198
603
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
603
      }
201
202
      // step 2 - what is the required size of the output?
203
603
      const auto [output_length, length_agree] =
204
603
          calculate_length(from, inputisvalid);
205
603
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
603
      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
596
      const auto [written, outputs_agree] =
215
596
          do_conversion(from, output_length, inputisvalid);
216
596
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
596
      return;
221
596
    } 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
603
  }
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
613
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
613
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
613
                        chardata.size() / sizeof(FromType)};
179
180
613
    static const bool do_print_testcase =
181
613
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
613
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
613
    do {
189
      // step 0 - is the input valid?
190
613
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
613
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
613
                    From == UtfEncodings::UTF8) {
198
613
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
613
      }
201
202
      // step 2 - what is the required size of the output?
203
613
      const auto [output_length, length_agree] =
204
613
          calculate_length(from, inputisvalid);
205
613
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
613
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
7
        return;
211
7
      }
212
213
      // step 3 - run the conversion
214
606
      const auto [written, outputs_agree] =
215
606
          do_conversion(from, output_length, inputisvalid);
216
606
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
606
      return;
221
606
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
613
  }
Conversion<(UtfEncodings)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
51
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
51
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
51
                        chardata.size() / sizeof(FromType)};
179
180
51
    static const bool do_print_testcase =
181
51
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
51
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
51
    do {
189
      // step 0 - is the input valid?
190
51
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
51
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
51
                    From == UtfEncodings::UTF8) {
198
51
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
51
      }
201
202
      // step 2 - what is the required size of the output?
203
51
      const auto [output_length, length_agree] =
204
51
          calculate_length(from, inputisvalid);
205
51
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
51
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
51
      const auto [written, outputs_agree] =
215
51
          do_conversion(from, output_length, inputisvalid);
216
51
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
51
      return;
221
51
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
51
  }
Conversion<(UtfEncodings)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
66
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
66
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
66
                        chardata.size() / sizeof(FromType)};
179
180
66
    static const bool do_print_testcase =
181
66
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
66
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
66
    do {
189
      // step 0 - is the input valid?
190
66
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
66
      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
66
                    From == UtfEncodings::UTF8) {
198
66
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
66
      }
201
202
      // step 2 - what is the required size of the output?
203
66
      const auto [output_length, length_agree] =
204
66
          calculate_length(from, inputisvalid);
205
66
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
66
      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
66
      const auto [written, outputs_agree] =
215
66
          do_conversion(from, output_length, inputisvalid);
216
66
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
66
      return;
221
66
    } 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
66
  }
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
89
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
89
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
89
                        chardata.size() / sizeof(FromType)};
179
180
89
    static const bool do_print_testcase =
181
89
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
89
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
89
    do {
189
      // step 0 - is the input valid?
190
89
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
89
      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
89
      const auto [output_length, length_agree] =
204
89
          calculate_length(from, inputisvalid);
205
89
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
89
      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
89
      const auto [written, outputs_agree] =
215
89
          do_conversion(from, output_length, inputisvalid);
216
89
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
89
      return;
221
89
    } 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
89
  }
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
288
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
288
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
288
                        chardata.size() / sizeof(FromType)};
179
180
288
    static const bool do_print_testcase =
181
288
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
288
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
288
    do {
189
      // step 0 - is the input valid?
190
288
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
288
      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
288
                    From == UtfEncodings::UTF8) {
198
288
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
288
      }
201
202
      // step 2 - what is the required size of the output?
203
288
      const auto [output_length, length_agree] =
204
288
          calculate_length(from, inputisvalid);
205
288
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
288
      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
288
      const auto [written, outputs_agree] =
215
288
          do_conversion(from, output_length, inputisvalid);
216
288
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
288
      return;
221
288
    } 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
288
  }
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
124
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
124
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
124
                        chardata.size() / sizeof(FromType)};
179
180
124
    static const bool do_print_testcase =
181
124
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
124
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
124
    do {
189
      // step 0 - is the input valid?
190
124
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
124
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
124
                    From == UtfEncodings::UTF8) {
198
124
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
124
      }
201
202
      // step 2 - what is the required size of the output?
203
124
      const auto [output_length, length_agree] =
204
124
          calculate_length(from, inputisvalid);
205
124
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
124
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
124
      const auto [written, outputs_agree] =
215
124
          do_conversion(from, output_length, inputisvalid);
216
124
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
124
      return;
221
124
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
124
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
181
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
181
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
181
                        chardata.size() / sizeof(FromType)};
179
180
181
    static const bool do_print_testcase =
181
181
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
181
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
181
    do {
189
      // step 0 - is the input valid?
190
181
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
181
      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
181
                    From == UtfEncodings::UTF8) {
198
181
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
181
      }
201
202
      // step 2 - what is the required size of the output?
203
181
      const auto [output_length, length_agree] =
204
181
          calculate_length(from, inputisvalid);
205
181
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
181
      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
181
      const auto [written, outputs_agree] =
215
181
          do_conversion(from, output_length, inputisvalid);
216
181
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
181
      return;
221
181
    } 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
181
  }
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
358
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
358
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
358
                        chardata.size() / sizeof(FromType)};
179
180
358
    static const bool do_print_testcase =
181
358
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
358
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
358
    do {
189
      // step 0 - is the input valid?
190
358
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
358
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
358
                    From == UtfEncodings::UTF8) {
198
358
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
358
      }
201
202
      // step 2 - what is the required size of the output?
203
358
      const auto [output_length, length_agree] =
204
358
          calculate_length(from, inputisvalid);
205
358
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
358
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
358
      const auto [written, outputs_agree] =
215
358
          do_conversion(from, output_length, inputisvalid);
216
358
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
358
      return;
221
358
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
358
  }
Conversion<(UtfEncodings)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
141
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
141
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
141
                        chardata.size() / sizeof(FromType)};
179
180
141
    static const bool do_print_testcase =
181
141
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
141
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
141
    do {
189
      // step 0 - is the input valid?
190
141
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
141
      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
141
                    From == UtfEncodings::UTF8) {
198
141
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
141
      }
201
202
      // step 2 - what is the required size of the output?
203
141
      const auto [output_length, length_agree] =
204
141
          calculate_length(from, inputisvalid);
205
141
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
141
      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
141
      const auto [written, outputs_agree] =
215
141
          do_conversion(from, output_length, inputisvalid);
216
141
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
141
      return;
221
141
    } 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
141
  }
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
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
204
                    From == UtfEncodings::UTF8) {
198
204
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
204
      }
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)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
339
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
339
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
339
                        chardata.size() / sizeof(FromType)};
179
180
339
    static const bool do_print_testcase =
181
339
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
339
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
339
    do {
189
      // step 0 - is the input valid?
190
339
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
339
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
339
                    From == UtfEncodings::UTF8) {
198
339
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
339
      }
201
202
      // step 2 - what is the required size of the output?
203
339
      const auto [output_length, length_agree] =
204
339
          calculate_length(from, inputisvalid);
205
339
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
339
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
339
      const auto [written, outputs_agree] =
215
339
          do_conversion(from, output_length, inputisvalid);
216
339
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
339
      return;
221
339
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
339
  }
Conversion<(UtfEncodings)3, (UtfEncodings)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
296
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
296
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
296
                        chardata.size() / sizeof(FromType)};
179
180
296
    static const bool do_print_testcase =
181
296
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
296
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
296
    do {
189
      // step 0 - is the input valid?
190
296
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
296
      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
296
      const auto [output_length, length_agree] =
204
296
          calculate_length(from, inputisvalid);
205
296
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
296
      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
296
      const auto [written, outputs_agree] =
215
296
          do_conversion(from, output_length, inputisvalid);
216
296
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
296
      return;
221
296
    } 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
296
  }
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
329
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
329
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
329
                        chardata.size() / sizeof(FromType)};
179
180
329
    static const bool do_print_testcase =
181
329
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
329
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
329
    do {
189
      // step 0 - is the input valid?
190
329
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
329
      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
329
      const auto [output_length, length_agree] =
204
329
          calculate_length(from, inputisvalid);
205
329
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
329
      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
329
      const auto [written, outputs_agree] =
215
329
          do_conversion(from, output_length, inputisvalid);
216
329
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
329
      return;
221
329
    } 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
329
  }
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
446
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
446
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
446
                        chardata.size() / sizeof(FromType)};
179
180
446
    static const bool do_print_testcase =
181
446
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
446
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
446
    do {
189
      // step 0 - is the input valid?
190
446
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
446
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    From == UtfEncodings::UTF8) {
198
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
          break;
200
      }
201
202
      // step 2 - what is the required size of the output?
203
446
      const auto [output_length, length_agree] =
204
446
          calculate_length(from, inputisvalid);
205
446
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
446
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
446
      const auto [written, outputs_agree] =
215
446
          do_conversion(from, output_length, inputisvalid);
216
446
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
446
      return;
221
446
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
446
  }
Conversion<(UtfEncodings)2, (UtfEncodings)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
250
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
250
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
250
                        chardata.size() / sizeof(FromType)};
179
180
250
    static const bool do_print_testcase =
181
250
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
250
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
250
    do {
189
      // step 0 - is the input valid?
190
250
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
250
      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
250
                    From == UtfEncodings::UTF8) {
198
250
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
250
      }
201
202
      // step 2 - what is the required size of the output?
203
250
      const auto [output_length, length_agree] =
204
250
          calculate_length(from, inputisvalid);
205
250
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
250
      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
250
      const auto [written, outputs_agree] =
215
250
          do_conversion(from, output_length, inputisvalid);
216
250
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
250
      return;
221
250
    } 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
250
  }
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
379
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
379
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
379
                        chardata.size() / sizeof(FromType)};
179
180
379
    static const bool do_print_testcase =
181
379
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
379
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
379
    do {
189
      // step 0 - is the input valid?
190
379
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
379
      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
379
                    From == UtfEncodings::UTF8) {
198
379
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
379
      }
201
202
      // step 2 - what is the required size of the output?
203
379
      const auto [output_length, length_agree] =
204
379
          calculate_length(from, inputisvalid);
205
379
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
379
      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
379
      const auto [written, outputs_agree] =
215
379
          do_conversion(from, output_length, inputisvalid);
216
379
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
379
      return;
221
379
    } 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
379
  }
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
284
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
284
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
284
                        chardata.size() / sizeof(FromType)};
179
180
284
    static const bool do_print_testcase =
181
284
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
284
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
284
    do {
189
      // step 0 - is the input valid?
190
284
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
284
      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
284
                    From == UtfEncodings::UTF8) {
198
284
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
284
      }
201
202
      // step 2 - what is the required size of the output?
203
284
      const auto [output_length, length_agree] =
204
284
          calculate_length(from, inputisvalid);
205
284
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
284
      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
284
      const auto [written, outputs_agree] =
215
284
          do_conversion(from, output_length, inputisvalid);
216
284
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
284
      return;
221
284
    } 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
284
  }
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
382
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
382
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
382
                        chardata.size() / sizeof(FromType)};
179
180
382
    static const bool do_print_testcase =
181
382
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
382
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
382
    do {
189
      // step 0 - is the input valid?
190
382
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
382
      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
382
                    From == UtfEncodings::UTF8) {
198
382
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
0
          break;
200
382
      }
201
202
      // step 2 - what is the required size of the output?
203
382
      const auto [output_length, length_agree] =
204
382
          calculate_length(from, inputisvalid);
205
382
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
382
      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
382
      const auto [written, outputs_agree] =
215
382
          do_conversion(from, output_length, inputisvalid);
216
382
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
382
      return;
221
382
    } 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
382
  }
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
63
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
63
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
63
                        chardata.size() / sizeof(FromType)};
179
180
63
    static const bool do_print_testcase =
181
63
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
63
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
63
    do {
189
      // step 0 - is the input valid?
190
63
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
63
      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
63
      const auto [output_length, length_agree] =
204
63
          calculate_length(from, inputisvalid);
205
63
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
63
      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
63
      const auto [written, outputs_agree] =
215
63
          do_conversion(from, output_length, inputisvalid);
216
63
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
63
      return;
221
63
    } 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
63
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
50
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
50
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
50
                        chardata.size() / sizeof(FromType)};
179
180
50
    static const bool do_print_testcase =
181
50
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
50
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
50
    do {
189
      // step 0 - is the input valid?
190
50
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
50
      if (!valid_input_agree && !allow_implementations_to_differ)
192
0
        break;
193
194
      // step 1 - count the input (only makes sense for some of the encodings)
195
      if constexpr (From == UtfEncodings::UTF16BE ||
196
                    From == UtfEncodings::UTF16LE ||
197
                    From == UtfEncodings::UTF8) {
198
        if (!count_the_input(from) && !allow_implementations_to_differ)
199
          break;
200
      }
201
202
      // step 2 - what is the required size of the output?
203
50
      const auto [output_length, length_agree] =
204
50
          calculate_length(from, inputisvalid);
205
50
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
50
      if (!inputisvalid && name.find("valid") != std::string::npos) {
209
        // don't run the conversion step, it requires valid input
210
0
        return;
211
0
      }
212
213
      // step 3 - run the conversion
214
50
      const auto [written, outputs_agree] =
215
50
          do_conversion(from, output_length, inputisvalid);
216
50
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
50
      return;
221
50
    } while (0);
222
    // if we come here, something failed
223
0
    std::cerr << "something failed, rerun with PRINT_FUZZ_CASE set to print a "
224
0
                 "reproducer to stderr\n";
225
0
    std::abort();
226
50
  }
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::fuzz(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
175
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)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
307
  void fuzz(std::span<const char> chardata) const {
176
    // assume the input is aligned to FromType
177
307
    const FromSpan from{reinterpret_cast<const FromType*>(chardata.data()),
178
307
                        chardata.size() / sizeof(FromType)};
179
180
307
    static const bool do_print_testcase =
181
307
        std::getenv("PRINT_FUZZ_CASE") != nullptr;
182
183
307
    if (do_print_testcase) {
184
0
      dump_testcase(from, std::cerr);
185
0
      std::exit(EXIT_SUCCESS);
186
0
    }
187
188
307
    do {
189
      // step 0 - is the input valid?
190
307
      const auto [inputisvalid, valid_input_agree] = verify_valid_input(from);
191
307
      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
307
      const auto [output_length, length_agree] =
204
307
          calculate_length(from, inputisvalid);
205
307
      if (!length_agree && !allow_implementations_to_differ)
206
0
        break;
207
208
307
      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
307
      const auto [written, outputs_agree] =
215
307
          do_conversion(from, output_length, inputisvalid);
216
307
      if (!outputs_agree && !allow_implementations_to_differ)
217
0
        break;
218
219
      // coming this far means no problems were found
220
307
      return;
221
307
    } 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
307
  }
227
228
  template <typename Dummy = void>
229
    requires(From != UtfEncodings::LATIN1)
230
8.61k
  validation_result verify_valid_input(FromSpan src) const {
231
8.61k
    validation_result ret{};
232
233
8.61k
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
8.61k
    const auto implementations = get_supported_implementations();
235
8.61k
    std::vector<simdutf::result> results;
236
8.61k
    results.reserve(implementations.size());
237
238
25.8k
    for (auto impl : implementations) {
239
25.8k
      results.push_back(
240
25.8k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
25.8k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
25.8k
      const bool validation2 =
245
25.8k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
25.8k
                      src.data(), src.size());
247
25.8k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
25.8k
    }
258
259
17.2k
    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
416
    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
766
    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
426
    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
856
    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
638
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
752
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clINS1_6resultESO_EEDaSI_SL_
Line
Count
Source
259
876
    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.24k
    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.20k
    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.22k
    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
102
    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
132
    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
178
    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
576
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS5_S5_EEDaSJ_SM_
Line
Count
Source
259
248
    auto neq = [](const auto& a, const auto& b) { return a != b; };
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKT_RKT0_E_clIS7_S7_EEDaSJ_SM_
Line
Count
Source
259
362
    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
716
    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
282
    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
408
    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
678
    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
592
    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
658
    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
892
    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
500
    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
758
    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
568
    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
764
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
8.61k
    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.61k
    } else {
273
8.61k
      ret.implementations_agree = true;
274
8.61k
    }
275
17.1k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
17.1k
      return r.error == simdutf::SUCCESS;
277
17.1k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
442
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
442
      return r.error == simdutf::SUCCESS;
277
442
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
971
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
971
      return r.error == simdutf::SUCCESS;
277
971
    });
_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.05k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.05k
      return r.error == simdutf::SUCCESS;
277
1.05k
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
583
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
583
      return r.error == simdutf::SUCCESS;
277
583
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
766
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
766
      return r.error == simdutf::SUCCESS;
277
766
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
766
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
766
      return r.error == simdutf::SUCCESS;
277
766
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_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_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.34k
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
1.34k
      return r.error == simdutf::SUCCESS;
277
1.34k
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
129
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
129
      return r.error == simdutf::SUCCESS;
277
129
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
154
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
154
      return r.error == simdutf::SUCCESS;
277
154
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
145
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
145
      return r.error == simdutf::SUCCESS;
277
145
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKNS1_6resultEE_clESI_
Line
Count
Source
275
490
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
490
      return r.error == simdutf::SUCCESS;
277
490
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
312
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
312
      return r.error == simdutf::SUCCESS;
277
312
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
355
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
355
      return r.error == simdutf::SUCCESS;
277
355
    });
_ZZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
780
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
780
      return r.error == simdutf::SUCCESS;
277
780
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
337
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
337
      return r.error == simdutf::SUCCESS;
277
337
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
382
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
382
      return r.error == simdutf::SUCCESS;
277
382
    });
_ZZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
735
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
735
      return r.error == simdutf::SUCCESS;
277
735
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEEENKUlRKS5_E_clESI_
Line
Count
Source
275
264
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
264
      return r.error == simdutf::SUCCESS;
277
264
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
474
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
474
      return r.error == simdutf::SUCCESS;
277
474
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
505
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
505
      return r.error == simdutf::SUCCESS;
277
505
    });
_ZZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
668
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
668
      return r.error == simdutf::SUCCESS;
277
668
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
488
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
488
      return r.error == simdutf::SUCCESS;
277
488
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
717
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
717
      return r.error == simdutf::SUCCESS;
277
717
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
536
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
536
      return r.error == simdutf::SUCCESS;
277
536
    });
_ZZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEEENKUlRKS7_E_clESI_
Line
Count
Source
275
734
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
734
      return r.error == simdutf::SUCCESS;
277
734
    });
278
8.61k
    return ret;
279
8.61k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
208
  validation_result verify_valid_input(FromSpan src) const {
231
208
    validation_result ret{};
232
233
208
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
208
    const auto implementations = get_supported_implementations();
235
208
    std::vector<simdutf::result> results;
236
208
    results.reserve(implementations.size());
237
238
624
    for (auto impl : implementations) {
239
624
      results.push_back(
240
624
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
624
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
624
      const bool validation2 =
245
624
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
624
                      src.data(), src.size());
247
624
      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
624
    }
258
259
208
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
208
    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
208
    } else {
273
208
      ret.implementations_agree = true;
274
208
    }
275
208
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
208
      return r.error == simdutf::SUCCESS;
277
208
    });
278
208
    return ret;
279
208
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
383
  validation_result verify_valid_input(FromSpan src) const {
231
383
    validation_result ret{};
232
233
383
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
383
    const auto implementations = get_supported_implementations();
235
383
    std::vector<simdutf::result> results;
236
383
    results.reserve(implementations.size());
237
238
1.14k
    for (auto impl : implementations) {
239
1.14k
      results.push_back(
240
1.14k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.14k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.14k
      const bool validation2 =
245
1.14k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.14k
                      src.data(), src.size());
247
1.14k
      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.14k
    }
258
259
383
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
383
    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
383
    } else {
273
383
      ret.implementations_agree = true;
274
383
    }
275
383
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
383
      return r.error == simdutf::SUCCESS;
277
383
    });
278
383
    return ret;
279
383
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
213
  validation_result verify_valid_input(FromSpan src) const {
231
213
    validation_result ret{};
232
233
213
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
213
    const auto implementations = get_supported_implementations();
235
213
    std::vector<simdutf::result> results;
236
213
    results.reserve(implementations.size());
237
238
639
    for (auto impl : implementations) {
239
639
      results.push_back(
240
639
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
639
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
639
      const bool validation2 =
245
639
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
639
                      src.data(), src.size());
247
639
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
639
    }
258
259
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
213
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
213
    } else {
273
213
      ret.implementations_agree = true;
274
213
    }
275
213
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
213
      return r.error == simdutf::SUCCESS;
277
213
    });
278
213
    return ret;
279
213
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
428
  validation_result verify_valid_input(FromSpan src) const {
231
428
    validation_result ret{};
232
233
428
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
428
    const auto implementations = get_supported_implementations();
235
428
    std::vector<simdutf::result> results;
236
428
    results.reserve(implementations.size());
237
238
1.28k
    for (auto impl : implementations) {
239
1.28k
      results.push_back(
240
1.28k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.28k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.28k
      const bool validation2 =
245
1.28k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.28k
                      src.data(), src.size());
247
1.28k
      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.28k
    }
258
259
428
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
428
    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
428
    } else {
273
428
      ret.implementations_agree = true;
274
428
    }
275
428
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
428
      return r.error == simdutf::SUCCESS;
277
428
    });
278
428
    return ret;
279
428
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
319
  validation_result verify_valid_input(FromSpan src) const {
231
319
    validation_result ret{};
232
233
319
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
319
    const auto implementations = get_supported_implementations();
235
319
    std::vector<simdutf::result> results;
236
319
    results.reserve(implementations.size());
237
238
957
    for (auto impl : implementations) {
239
957
      results.push_back(
240
957
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
957
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
957
      const bool validation2 =
245
957
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
957
                      src.data(), src.size());
247
957
      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
957
    }
258
259
319
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
319
    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
319
    } else {
273
319
      ret.implementations_agree = true;
274
319
    }
275
319
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
319
      return r.error == simdutf::SUCCESS;
277
319
    });
278
319
    return ret;
279
319
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
376
  validation_result verify_valid_input(FromSpan src) const {
231
376
    validation_result ret{};
232
233
376
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
376
    const auto implementations = get_supported_implementations();
235
376
    std::vector<simdutf::result> results;
236
376
    results.reserve(implementations.size());
237
238
1.12k
    for (auto impl : implementations) {
239
1.12k
      results.push_back(
240
1.12k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.12k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.12k
      const bool validation2 =
245
1.12k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.12k
                      src.data(), src.size());
247
1.12k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.12k
    }
258
259
376
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
376
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
376
    } else {
273
376
      ret.implementations_agree = true;
274
376
    }
275
376
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
376
      return r.error == simdutf::SUCCESS;
277
376
    });
278
376
    return ret;
279
376
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
438
  validation_result verify_valid_input(FromSpan src) const {
231
438
    validation_result ret{};
232
233
438
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
438
    const auto implementations = get_supported_implementations();
235
438
    std::vector<simdutf::result> results;
236
438
    results.reserve(implementations.size());
237
238
1.31k
    for (auto impl : implementations) {
239
1.31k
      results.push_back(
240
1.31k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.31k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.31k
      const bool validation2 =
245
1.31k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.31k
                      src.data(), src.size());
247
1.31k
      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.31k
    }
258
259
438
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
438
    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
438
    } else {
273
438
      ret.implementations_agree = true;
274
438
    }
275
438
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
438
      return r.error == simdutf::SUCCESS;
277
438
    });
278
438
    return ret;
279
438
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
623
  validation_result verify_valid_input(FromSpan src) const {
231
623
    validation_result ret{};
232
233
623
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
623
    const auto implementations = get_supported_implementations();
235
623
    std::vector<simdutf::result> results;
236
623
    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
623
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
623
    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
623
    } else {
273
623
      ret.implementations_agree = true;
274
623
    }
275
623
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
623
      return r.error == simdutf::SUCCESS;
277
623
    });
278
623
    return ret;
279
623
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
603
  validation_result verify_valid_input(FromSpan src) const {
231
603
    validation_result ret{};
232
233
603
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
603
    const auto implementations = get_supported_implementations();
235
603
    std::vector<simdutf::result> results;
236
603
    results.reserve(implementations.size());
237
238
1.80k
    for (auto impl : implementations) {
239
1.80k
      results.push_back(
240
1.80k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.80k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.80k
      const bool validation2 =
245
1.80k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.80k
                      src.data(), src.size());
247
1.80k
      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.80k
    }
258
259
603
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
603
    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
603
    } else {
273
603
      ret.implementations_agree = true;
274
603
    }
275
603
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
603
      return r.error == simdutf::SUCCESS;
277
603
    });
278
603
    return ret;
279
603
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
613
  validation_result verify_valid_input(FromSpan src) const {
231
613
    validation_result ret{};
232
233
613
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
613
    const auto implementations = get_supported_implementations();
235
613
    std::vector<simdutf::result> results;
236
613
    results.reserve(implementations.size());
237
238
1.83k
    for (auto impl : implementations) {
239
1.83k
      results.push_back(
240
1.83k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.83k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.83k
      const bool validation2 =
245
1.83k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.83k
                      src.data(), src.size());
247
1.83k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.83k
    }
258
259
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
613
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
613
    } else {
273
613
      ret.implementations_agree = true;
274
613
    }
275
613
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
613
      return r.error == simdutf::SUCCESS;
277
613
    });
278
613
    return ret;
279
613
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
51
  validation_result verify_valid_input(FromSpan src) const {
231
51
    validation_result ret{};
232
233
51
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
51
    const auto implementations = get_supported_implementations();
235
51
    std::vector<simdutf::result> results;
236
51
    results.reserve(implementations.size());
237
238
153
    for (auto impl : implementations) {
239
153
      results.push_back(
240
153
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
153
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
153
      const bool validation2 =
245
153
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
153
                      src.data(), src.size());
247
153
      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
153
    }
258
259
51
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
51
    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
51
    } else {
273
51
      ret.implementations_agree = true;
274
51
    }
275
51
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
51
      return r.error == simdutf::SUCCESS;
277
51
    });
278
51
    return ret;
279
51
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
66
  validation_result verify_valid_input(FromSpan src) const {
231
66
    validation_result ret{};
232
233
66
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
66
    const auto implementations = get_supported_implementations();
235
66
    std::vector<simdutf::result> results;
236
66
    results.reserve(implementations.size());
237
238
198
    for (auto impl : implementations) {
239
198
      results.push_back(
240
198
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
198
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
198
      const bool validation2 =
245
198
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
198
                      src.data(), src.size());
247
198
      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
198
    }
258
259
66
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
66
    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
66
    } else {
273
66
      ret.implementations_agree = true;
274
66
    }
275
66
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
66
      return r.error == simdutf::SUCCESS;
277
66
    });
278
66
    return ret;
279
66
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
230
89
  validation_result verify_valid_input(FromSpan src) const {
231
89
    validation_result ret{};
232
233
89
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
89
    const auto implementations = get_supported_implementations();
235
89
    std::vector<simdutf::result> results;
236
89
    results.reserve(implementations.size());
237
238
267
    for (auto impl : implementations) {
239
267
      results.push_back(
240
267
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
267
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
267
      const bool validation2 =
245
267
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
267
                      src.data(), src.size());
247
267
      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
267
    }
258
259
89
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
89
    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
89
    } else {
273
89
      ret.implementations_agree = true;
274
89
    }
275
89
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
89
      return r.error == simdutf::SUCCESS;
277
89
    });
278
89
    return ret;
279
89
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
288
  validation_result verify_valid_input(FromSpan src) const {
231
288
    validation_result ret{};
232
233
288
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
288
    const auto implementations = get_supported_implementations();
235
288
    std::vector<simdutf::result> results;
236
288
    results.reserve(implementations.size());
237
238
864
    for (auto impl : implementations) {
239
864
      results.push_back(
240
864
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
864
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
864
      const bool validation2 =
245
864
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
864
                      src.data(), src.size());
247
864
      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
864
    }
258
259
288
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
288
    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
288
    } else {
273
288
      ret.implementations_agree = true;
274
288
    }
275
288
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
288
      return r.error == simdutf::SUCCESS;
277
288
    });
278
288
    return ret;
279
288
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
124
  validation_result verify_valid_input(FromSpan src) const {
231
124
    validation_result ret{};
232
233
124
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
124
    const auto implementations = get_supported_implementations();
235
124
    std::vector<simdutf::result> results;
236
124
    results.reserve(implementations.size());
237
238
372
    for (auto impl : implementations) {
239
372
      results.push_back(
240
372
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
372
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
372
      const bool validation2 =
245
372
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
372
                      src.data(), src.size());
247
372
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
372
    }
258
259
124
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
124
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
124
    } else {
273
124
      ret.implementations_agree = true;
274
124
    }
275
124
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
124
      return r.error == simdutf::SUCCESS;
277
124
    });
278
124
    return ret;
279
124
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
181
  validation_result verify_valid_input(FromSpan src) const {
231
181
    validation_result ret{};
232
233
181
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
181
    const auto implementations = get_supported_implementations();
235
181
    std::vector<simdutf::result> results;
236
181
    results.reserve(implementations.size());
237
238
543
    for (auto impl : implementations) {
239
543
      results.push_back(
240
543
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
543
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
543
      const bool validation2 =
245
543
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
543
                      src.data(), src.size());
247
543
      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
543
    }
258
259
181
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
181
    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
181
    } else {
273
181
      ret.implementations_agree = true;
274
181
    }
275
181
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
181
      return r.error == simdutf::SUCCESS;
277
181
    });
278
181
    return ret;
279
181
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
358
  validation_result verify_valid_input(FromSpan src) const {
231
358
    validation_result ret{};
232
233
358
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
358
    const auto implementations = get_supported_implementations();
235
358
    std::vector<simdutf::result> results;
236
358
    results.reserve(implementations.size());
237
238
1.07k
    for (auto impl : implementations) {
239
1.07k
      results.push_back(
240
1.07k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.07k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.07k
      const bool validation2 =
245
1.07k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.07k
                      src.data(), src.size());
247
1.07k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.07k
    }
258
259
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
358
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
358
    } else {
273
358
      ret.implementations_agree = true;
274
358
    }
275
358
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
358
      return r.error == simdutf::SUCCESS;
277
358
    });
278
358
    return ret;
279
358
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
230
141
  validation_result verify_valid_input(FromSpan src) const {
231
141
    validation_result ret{};
232
233
141
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
141
    const auto implementations = get_supported_implementations();
235
141
    std::vector<simdutf::result> results;
236
141
    results.reserve(implementations.size());
237
238
423
    for (auto impl : implementations) {
239
423
      results.push_back(
240
423
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
423
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
423
      const bool validation2 =
245
423
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
423
                      src.data(), src.size());
247
423
      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
423
    }
258
259
141
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
141
    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
141
    } else {
273
141
      ret.implementations_agree = true;
274
141
    }
275
141
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
141
      return r.error == simdutf::SUCCESS;
277
141
    });
278
141
    return ret;
279
141
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_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
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
339
  validation_result verify_valid_input(FromSpan src) const {
231
339
    validation_result ret{};
232
233
339
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
339
    const auto implementations = get_supported_implementations();
235
339
    std::vector<simdutf::result> results;
236
339
    results.reserve(implementations.size());
237
238
1.01k
    for (auto impl : implementations) {
239
1.01k
      results.push_back(
240
1.01k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.01k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.01k
      const bool validation2 =
245
1.01k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.01k
                      src.data(), src.size());
247
1.01k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.01k
    }
258
259
339
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
339
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
339
    } else {
273
339
      ret.implementations_agree = true;
274
339
    }
275
339
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
339
      return r.error == simdutf::SUCCESS;
277
339
    });
278
339
    return ret;
279
339
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_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
296
  validation_result verify_valid_input(FromSpan src) const {
231
296
    validation_result ret{};
232
233
296
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
296
    const auto implementations = get_supported_implementations();
235
296
    std::vector<simdutf::result> results;
236
296
    results.reserve(implementations.size());
237
238
888
    for (auto impl : implementations) {
239
888
      results.push_back(
240
888
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
888
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
888
      const bool validation2 =
245
888
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
888
                      src.data(), src.size());
247
888
      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
888
    }
258
259
296
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
296
    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
296
    } else {
273
296
      ret.implementations_agree = true;
274
296
    }
275
296
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
296
      return r.error == simdutf::SUCCESS;
277
296
    });
278
296
    return ret;
279
296
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
329
  validation_result verify_valid_input(FromSpan src) const {
231
329
    validation_result ret{};
232
233
329
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
329
    const auto implementations = get_supported_implementations();
235
329
    std::vector<simdutf::result> results;
236
329
    results.reserve(implementations.size());
237
238
987
    for (auto impl : implementations) {
239
987
      results.push_back(
240
987
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
987
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
987
      const bool validation2 =
245
987
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
987
                      src.data(), src.size());
247
987
      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
987
    }
258
259
329
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
329
    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
329
    } else {
273
329
      ret.implementations_agree = true;
274
329
    }
275
329
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
329
      return r.error == simdutf::SUCCESS;
277
329
    });
278
329
    return ret;
279
329
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
446
  validation_result verify_valid_input(FromSpan src) const {
231
446
    validation_result ret{};
232
233
446
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
446
    const auto implementations = get_supported_implementations();
235
446
    std::vector<simdutf::result> results;
236
446
    results.reserve(implementations.size());
237
238
1.33k
    for (auto impl : implementations) {
239
1.33k
      results.push_back(
240
1.33k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.33k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.33k
      const bool validation2 =
245
1.33k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.33k
                      src.data(), src.size());
247
1.33k
      if (validation1 != validation2) {
248
0
        std::cerr << "begin errormessage for verify_valid_input()\n";
249
0
        std::cerr << ValidationFunctionTrait<From>::ValidationWithErrorsName
250
0
                  << " gives " << validation1 << " while "
251
0
                  << ValidationFunctionTrait<From>::ValidationName << " gave "
252
0
                  << validation2 << " for implementation " << impl->name()
253
0
                  << '\n';
254
0
        std::cerr << "end errormessage\n";
255
0
        std::abort();
256
0
      }
257
1.33k
    }
258
259
446
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
446
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
261
0
      std::cerr << "begin errormessage for verify_valid_input()\n";
262
0
      std::cerr << "in fuzz case for "
263
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
264
0
                << " invoked with " << src.size() << " elements:\n";
265
0
      for (std::size_t i = 0; i < results.size(); ++i) {
266
0
        std::cerr << "got return " << std::dec << results[i]
267
0
                  << " from implementation " << implementations[i]->name()
268
0
                  << '\n';
269
0
      }
270
0
      std::cerr << "end errormessage\n";
271
0
      ret.implementations_agree = false;
272
446
    } else {
273
446
      ret.implementations_agree = true;
274
446
    }
275
446
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
446
      return r.error == simdutf::SUCCESS;
277
446
    });
278
446
    return ret;
279
446
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
250
  validation_result verify_valid_input(FromSpan src) const {
231
250
    validation_result ret{};
232
233
250
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
250
    const auto implementations = get_supported_implementations();
235
250
    std::vector<simdutf::result> results;
236
250
    results.reserve(implementations.size());
237
238
750
    for (auto impl : implementations) {
239
750
      results.push_back(
240
750
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
750
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
750
      const bool validation2 =
245
750
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
750
                      src.data(), src.size());
247
750
      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
750
    }
258
259
250
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
250
    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
250
    } else {
273
250
      ret.implementations_agree = true;
274
250
    }
275
250
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
250
      return r.error == simdutf::SUCCESS;
277
250
    });
278
250
    return ret;
279
250
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
379
  validation_result verify_valid_input(FromSpan src) const {
231
379
    validation_result ret{};
232
233
379
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
379
    const auto implementations = get_supported_implementations();
235
379
    std::vector<simdutf::result> results;
236
379
    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
379
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
379
    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
379
    } else {
273
379
      ret.implementations_agree = true;
274
379
    }
275
379
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
379
      return r.error == simdutf::SUCCESS;
277
379
    });
278
379
    return ret;
279
379
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDsEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
284
  validation_result verify_valid_input(FromSpan src) const {
231
284
    validation_result ret{};
232
233
284
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
284
    const auto implementations = get_supported_implementations();
235
284
    std::vector<simdutf::result> results;
236
284
    results.reserve(implementations.size());
237
238
852
    for (auto impl : implementations) {
239
852
      results.push_back(
240
852
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
852
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
852
      const bool validation2 =
245
852
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
852
                      src.data(), src.size());
247
852
      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
852
    }
258
259
284
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
284
    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
284
    } else {
273
284
      ret.implementations_agree = true;
274
284
    }
275
284
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
284
      return r.error == simdutf::SUCCESS;
277
284
    });
278
284
    return ret;
279
284
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE18verify_valid_inputIvQneT_LS0_4EEENSB_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
230
382
  validation_result verify_valid_input(FromSpan src) const {
231
382
    validation_result ret{};
232
233
382
    auto input_validation = ValidationFunctionTrait<From>::ValidationWithErrors;
234
382
    const auto implementations = get_supported_implementations();
235
382
    std::vector<simdutf::result> results;
236
382
    results.reserve(implementations.size());
237
238
1.14k
    for (auto impl : implementations) {
239
1.14k
      results.push_back(
240
1.14k
          std::invoke(input_validation, impl, src.data(), src.size()));
241
242
      // make sure the validation variant that returns a bool agrees
243
1.14k
      const bool validation1 = results.back().error == simdutf::SUCCESS;
244
1.14k
      const bool validation2 =
245
1.14k
          std::invoke(ValidationFunctionTrait<From>::Validation, impl,
246
1.14k
                      src.data(), src.size());
247
1.14k
      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.14k
    }
258
259
382
    auto neq = [](const auto& a, const auto& b) { return a != b; };
260
382
    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
382
    } else {
273
382
      ret.implementations_agree = true;
274
382
    }
275
382
    ret.valid = std::ranges::all_of(results, [](const simdutf::result& r) {
276
382
      return r.error == simdutf::SUCCESS;
277
382
    });
278
382
    return ret;
279
382
  }
280
281
  template <typename Dummy = void>
282
    requires(From == UtfEncodings::LATIN1)
283
464
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
464
    return validation_result{.valid = true, .implementations_agree = true};
287
464
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_3EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDiEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
63
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
63
    return validation_result{.valid = true, .implementations_agree = true};
287
63
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
50
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
50
    return validation_result{.valid = true, .implementations_agree = true};
287
50
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
283
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_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE18verify_valid_inputIvQeqT_LS0_4EEENSA_17validation_resultENSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
283
307
  validation_result verify_valid_input(FromSpan) const {
284
    // all latin1 input is valid. there is no simdutf validation function for
285
    // it.
286
307
    return validation_result{.valid = true, .implementations_agree = true};
287
307
  }
288
289
6.11k
  bool count_the_input(FromSpan src) const {
290
6.11k
    const auto implementations = get_supported_implementations();
291
6.11k
    std::vector<std::size_t> results;
292
6.11k
    results.reserve(implementations.size());
293
294
18.3k
    for (auto impl : implementations) {
295
18.3k
      std::size_t ret;
296
18.3k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
3.91k
        ret = impl->count_utf16be(src.data(), src.size());
298
4.17k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
4.17k
        ret = impl->count_utf16le(src.data(), src.size());
300
10.2k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
10.2k
        ret = impl->count_utf8(src.data(), src.size());
302
10.2k
      }
303
18.3k
      results.push_back(ret);
304
18.3k
    }
305
12.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>::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
416
    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
766
    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
426
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::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
856
    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.24k
    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.20k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
1.22k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)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
102
    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
132
    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
576
    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
248
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
305
362
    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
716
    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
282
    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
408
    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
678
    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
500
    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
758
    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
568
    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
764
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
6.11k
    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.11k
    return true;
321
6.11k
  }
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
208
  bool count_the_input(FromSpan src) const {
290
208
    const auto implementations = get_supported_implementations();
291
208
    std::vector<std::size_t> results;
292
208
    results.reserve(implementations.size());
293
294
624
    for (auto impl : implementations) {
295
624
      std::size_t ret;
296
624
      if constexpr (From == UtfEncodings::UTF16BE) {
297
624
        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
624
      results.push_back(ret);
304
624
    }
305
208
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
208
    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
208
    return true;
321
208
  }
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
383
  bool count_the_input(FromSpan src) const {
290
383
    const auto implementations = get_supported_implementations();
291
383
    std::vector<std::size_t> results;
292
383
    results.reserve(implementations.size());
293
294
1.14k
    for (auto impl : implementations) {
295
1.14k
      std::size_t ret;
296
1.14k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.14k
        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.14k
      results.push_back(ret);
304
1.14k
    }
305
383
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
383
    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
383
    return true;
321
383
  }
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
213
  bool count_the_input(FromSpan src) const {
290
213
    const auto implementations = get_supported_implementations();
291
213
    std::vector<std::size_t> results;
292
213
    results.reserve(implementations.size());
293
294
639
    for (auto impl : implementations) {
295
639
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
639
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
639
        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
639
      results.push_back(ret);
304
639
    }
305
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
213
    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
213
    return true;
321
213
  }
Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const
Line
Count
Source
289
428
  bool count_the_input(FromSpan src) const {
290
428
    const auto implementations = get_supported_implementations();
291
428
    std::vector<std::size_t> results;
292
428
    results.reserve(implementations.size());
293
294
1.28k
    for (auto impl : implementations) {
295
1.28k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
1.28k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
1.28k
        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.28k
      results.push_back(ret);
304
1.28k
    }
305
428
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
428
    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
428
    return true;
321
428
  }
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
623
  bool count_the_input(FromSpan src) const {
290
623
    const auto implementations = get_supported_implementations();
291
623
    std::vector<std::size_t> results;
292
623
    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
623
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
623
    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
623
    return true;
321
623
  }
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
603
  bool count_the_input(FromSpan src) const {
290
603
    const auto implementations = get_supported_implementations();
291
603
    std::vector<std::size_t> results;
292
603
    results.reserve(implementations.size());
293
294
1.80k
    for (auto impl : implementations) {
295
1.80k
      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.80k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.80k
        ret = impl->count_utf8(src.data(), src.size());
302
1.80k
      }
303
1.80k
      results.push_back(ret);
304
1.80k
    }
305
603
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
603
    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
603
    return true;
321
603
  }
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
613
  bool count_the_input(FromSpan src) const {
290
613
    const auto implementations = get_supported_implementations();
291
613
    std::vector<std::size_t> results;
292
613
    results.reserve(implementations.size());
293
294
1.83k
    for (auto impl : implementations) {
295
1.83k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
1.83k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.83k
        ret = impl->count_utf8(src.data(), src.size());
302
1.83k
      }
303
1.83k
      results.push_back(ret);
304
1.83k
    }
305
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
613
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
613
    return true;
321
613
  }
Conversion<(UtfEncodings)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
51
  bool count_the_input(FromSpan src) const {
290
51
    const auto implementations = get_supported_implementations();
291
51
    std::vector<std::size_t> results;
292
51
    results.reserve(implementations.size());
293
294
153
    for (auto impl : implementations) {
295
153
      std::size_t ret;
296
153
      if constexpr (From == UtfEncodings::UTF16BE) {
297
153
        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
153
      results.push_back(ret);
304
153
    }
305
51
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
51
    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
51
    return true;
321
51
  }
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
66
  bool count_the_input(FromSpan src) const {
290
66
    const auto implementations = get_supported_implementations();
291
66
    std::vector<std::size_t> results;
292
66
    results.reserve(implementations.size());
293
294
198
    for (auto impl : implementations) {
295
198
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
198
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
198
        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
198
      results.push_back(ret);
304
198
    }
305
66
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
66
    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
66
    return true;
321
66
  }
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
288
  bool count_the_input(FromSpan src) const {
290
288
    const auto implementations = get_supported_implementations();
291
288
    std::vector<std::size_t> results;
292
288
    results.reserve(implementations.size());
293
294
864
    for (auto impl : implementations) {
295
864
      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
864
      } else if constexpr (From == UtfEncodings::UTF8) {
301
864
        ret = impl->count_utf8(src.data(), src.size());
302
864
      }
303
864
      results.push_back(ret);
304
864
    }
305
288
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
288
    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
288
    return true;
321
288
  }
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const
Line
Count
Source
289
124
  bool count_the_input(FromSpan src) const {
290
124
    const auto implementations = get_supported_implementations();
291
124
    std::vector<std::size_t> results;
292
124
    results.reserve(implementations.size());
293
294
372
    for (auto impl : implementations) {
295
372
      std::size_t ret;
296
372
      if constexpr (From == UtfEncodings::UTF16BE) {
297
372
        ret = impl->count_utf16be(src.data(), src.size());
298
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
        ret = impl->count_utf16le(src.data(), src.size());
300
      } else if constexpr (From == UtfEncodings::UTF8) {
301
        ret = impl->count_utf8(src.data(), src.size());
302
      }
303
372
      results.push_back(ret);
304
372
    }
305
124
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
124
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
124
    return true;
321
124
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::count_the_input(std::__1::span<char16_t const, 18446744073709551615ul>) const
Line
Count
Source
289
181
  bool count_the_input(FromSpan src) const {
290
181
    const auto implementations = get_supported_implementations();
291
181
    std::vector<std::size_t> results;
292
181
    results.reserve(implementations.size());
293
294
543
    for (auto impl : implementations) {
295
543
      std::size_t ret;
296
543
      if constexpr (From == UtfEncodings::UTF16BE) {
297
543
        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
543
      results.push_back(ret);
304
543
    }
305
181
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
181
    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
181
    return true;
321
181
  }
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
358
  bool count_the_input(FromSpan src) const {
290
358
    const auto implementations = get_supported_implementations();
291
358
    std::vector<std::size_t> results;
292
358
    results.reserve(implementations.size());
293
294
1.07k
    for (auto impl : implementations) {
295
1.07k
      std::size_t ret;
296
1.07k
      if constexpr (From == UtfEncodings::UTF16BE) {
297
1.07k
        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.07k
      results.push_back(ret);
304
1.07k
    }
305
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
358
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
307
0
      std::cerr << "begin errormessage for count_the_input()\n";
308
0
      std::cerr << "in fuzz case for "
309
0
                << ValidationFunctionTrait<From>::ValidationWithErrorsName
310
0
                << " invoked with " << src.size() << " elements:\n";
311
0
      for (std::size_t i = 0; i < results.size(); ++i) {
312
0
        std::cerr << "got return " << std::dec << results[i]
313
0
                  << " from implementation " << implementations[i]->name()
314
0
                  << '\n';
315
0
      }
316
0
      std::cerr << "end errormessage\n";
317
0
      return false;
318
0
    }
319
320
358
    return true;
321
358
  }
Conversion<(UtfEncodings)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
141
  bool count_the_input(FromSpan src) const {
290
141
    const auto implementations = get_supported_implementations();
291
141
    std::vector<std::size_t> results;
292
141
    results.reserve(implementations.size());
293
294
423
    for (auto impl : implementations) {
295
423
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
423
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
423
        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
423
      results.push_back(ret);
304
423
    }
305
141
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
141
    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
141
    return true;
321
141
  }
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
204
  bool count_the_input(FromSpan src) const {
290
204
    const auto implementations = get_supported_implementations();
291
204
    std::vector<std::size_t> results;
292
204
    results.reserve(implementations.size());
293
294
612
    for (auto impl : implementations) {
295
612
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
612
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
612
        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
612
      results.push_back(ret);
304
612
    }
305
204
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
204
    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
204
    return true;
321
204
  }
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
339
  bool count_the_input(FromSpan src) const {
290
339
    const auto implementations = get_supported_implementations();
291
339
    std::vector<std::size_t> results;
292
339
    results.reserve(implementations.size());
293
294
1.01k
    for (auto impl : implementations) {
295
1.01k
      std::size_t ret;
296
      if constexpr (From == UtfEncodings::UTF16BE) {
297
        ret = impl->count_utf16be(src.data(), src.size());
298
1.01k
      } else if constexpr (From == UtfEncodings::UTF16LE) {
299
1.01k
        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.01k
      results.push_back(ret);
304
1.01k
    }
305
339
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
339
    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
339
    return true;
321
339
  }
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
250
  bool count_the_input(FromSpan src) const {
290
250
    const auto implementations = get_supported_implementations();
291
250
    std::vector<std::size_t> results;
292
250
    results.reserve(implementations.size());
293
294
750
    for (auto impl : implementations) {
295
750
      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
750
      } else if constexpr (From == UtfEncodings::UTF8) {
301
750
        ret = impl->count_utf8(src.data(), src.size());
302
750
      }
303
750
      results.push_back(ret);
304
750
    }
305
250
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
250
    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
250
    return true;
321
250
  }
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
379
  bool count_the_input(FromSpan src) const {
290
379
    const auto implementations = get_supported_implementations();
291
379
    std::vector<std::size_t> results;
292
379
    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
379
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
379
    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
379
    return true;
321
379
  }
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
284
  bool count_the_input(FromSpan src) const {
290
284
    const auto implementations = get_supported_implementations();
291
284
    std::vector<std::size_t> results;
292
284
    results.reserve(implementations.size());
293
294
852
    for (auto impl : implementations) {
295
852
      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
852
      } else if constexpr (From == UtfEncodings::UTF8) {
301
852
        ret = impl->count_utf8(src.data(), src.size());
302
852
      }
303
852
      results.push_back(ret);
304
852
    }
305
284
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
284
    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
284
    return true;
321
284
  }
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
382
  bool count_the_input(FromSpan src) const {
290
382
    const auto implementations = get_supported_implementations();
291
382
    std::vector<std::size_t> results;
292
382
    results.reserve(implementations.size());
293
294
1.14k
    for (auto impl : implementations) {
295
1.14k
      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.14k
      } else if constexpr (From == UtfEncodings::UTF8) {
301
1.14k
        ret = impl->count_utf8(src.data(), src.size());
302
1.14k
      }
303
1.14k
      results.push_back(ret);
304
1.14k
    }
305
382
    auto neq = [](const auto& a, const auto& b) { return a != b; };
306
382
    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
382
    return true;
321
382
  }
322
323
  // this quirk is needed because length calculations do not have consistent
324
  // signatures since some of them do not look at the input data, just the
325
  // length of it.
326
  template <typename Dummy = void>
327
    requires std::is_invocable_v<LengthFunction, const simdutf::implementation*,
328
                                 const FromType*, std::size_t>
329
  std::size_t invoke_lengthcalc(const simdutf::implementation* impl,
330
24.7k
                                FromSpan src) const {
331
24.7k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
24.7k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
624
                                FromSpan src) const {
331
624
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
624
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.14k
                                FromSpan src) const {
331
1.14k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.14k
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
639
                                FromSpan src) const {
331
639
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
639
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.28k
                                FromSpan src) const {
331
1.28k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.28k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
957
                                FromSpan src) const {
331
957
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
957
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.12k
                                FromSpan src) const {
331
1.12k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.12k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.31k
                                FromSpan src) const {
331
1.31k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.31k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_0EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_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_1EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.80k
                                FromSpan src) const {
331
1.80k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.80k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.83k
                                FromSpan src) const {
331
1.83k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.83k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
864
                                FromSpan src) const {
331
864
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
864
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
543
                                FromSpan src) const {
331
543
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
543
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.07k
                                FromSpan src) const {
331
1.07k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.07k
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_3EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
612
                                FromSpan src) const {
331
612
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
612
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_2EMN7simdutf14implementationEKDoFmPKDsmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.01k
                                FromSpan src) const {
331
1.01k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.01k
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_0EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
888
                                FromSpan src) const {
331
888
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
888
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_1EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
987
                                FromSpan src) const {
331
987
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
987
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_2EMN7simdutf14implementationEKDoFmPKDimEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.33k
                                FromSpan src) const {
331
1.33k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.33k
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_4EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
750
                                FromSpan src) const {
331
750
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
750
  }
_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
852
                                FromSpan src) const {
331
852
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
852
  }
_ZNK10ConversionIL12UtfEncodings2ELS0_3EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFNS1_6resultES4_mPDiEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSF_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
1.14k
                                FromSpan src) const {
331
1.14k
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
1.14k
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_2EMN7simdutf14implementationEKDoFmPKcmEMS2_KDoFmS4_mPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_PKN23ValidationFunctionTraitIXT_EE7RawTypeEmEEEmSE_NSt3__14spanIS3_Lm18446744073709551615EEE
Line
Count
Source
330
921
                                FromSpan src) const {
331
921
    return std::invoke(lengthcalc, impl, src.data(), src.size());
332
921
  }
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.49k
                                FromSpan src) const {
339
2.49k
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
2.49k
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
153
                                FromSpan src) const {
339
153
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
153
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
198
                                FromSpan src) const {
339
198
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
198
  }
_ZNK10ConversionIL12UtfEncodings3ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKDimPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
267
                                FromSpan src) const {
339
267
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
267
  }
_ZNK10ConversionIL12UtfEncodings0ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
372
                                FromSpan src) const {
339
372
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
372
  }
_ZNK10ConversionIL12UtfEncodings1ELS0_4EMN7simdutf14implementationEKDoFmmEMS2_KDoFNS1_6resultEPKDsmPcEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSF_NSt3__14spanIS6_Lm18446744073709551615EEE
Line
Count
Source
338
423
                                FromSpan src) const {
339
423
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
423
  }
_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
189
                                FromSpan src) const {
339
189
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
189
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_0EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
150
                                FromSpan src) const {
339
150
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
150
  }
_ZNK10ConversionIL12UtfEncodings4ELS0_1EMN7simdutf14implementationEKDoFmmEMS2_KDoFmPKcmPDsEE17invoke_lengthcalcIvQsr3stdE14is_invocable_vIT1_PKS2_mEEEmSE_NSt3__14spanIS5_Lm18446744073709551615EEE
Line
Count
Source
338
132
                                FromSpan src) const {
339
132
    return std::invoke(lengthcalc, impl, /*src.data(),*/ src.size());
340
132
  }
341
342
9.07k
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
9.07k
    length_result ret{};
344
345
9.07k
    const auto implementations = get_supported_implementations();
346
9.07k
    std::vector<std::size_t> results;
347
9.07k
    results.reserve(implementations.size());
348
349
27.2k
    for (auto impl : implementations) {
350
27.2k
      const auto len = invoke_lengthcalc(impl, src);
351
27.2k
      results.push_back(len);
352
27.2k
      ret.length.push_back(len);
353
27.2k
    }
354
355
18.1k
    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
416
    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
766
    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
426
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)1, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::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
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>::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
638
    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
752
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
876
    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.24k
    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.20k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
1.22k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)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
102
    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
132
    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
178
    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
576
    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
248
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
362
    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
716
    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
282
    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
408
    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
678
    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
592
    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
658
    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
892
    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
500
    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
758
    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
568
    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
764
    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
126
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<unsigned long, unsigned long>(unsigned long const&, unsigned long const&) const
Line
Count
Source
355
88
    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
614
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
9.07k
    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.07k
    } else {
375
9.07k
      ret.implementations_agree = true;
376
9.07k
    }
377
9.07k
    return ret;
378
9.07k
  }
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
208
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
208
    length_result ret{};
344
345
208
    const auto implementations = get_supported_implementations();
346
208
    std::vector<std::size_t> results;
347
208
    results.reserve(implementations.size());
348
349
624
    for (auto impl : implementations) {
350
624
      const auto len = invoke_lengthcalc(impl, src);
351
624
      results.push_back(len);
352
624
      ret.length.push_back(len);
353
624
    }
354
355
208
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
208
    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
208
    } else {
375
208
      ret.implementations_agree = true;
376
208
    }
377
208
    return ret;
378
208
  }
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
383
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
383
    length_result ret{};
344
345
383
    const auto implementations = get_supported_implementations();
346
383
    std::vector<std::size_t> results;
347
383
    results.reserve(implementations.size());
348
349
1.14k
    for (auto impl : implementations) {
350
1.14k
      const auto len = invoke_lengthcalc(impl, src);
351
1.14k
      results.push_back(len);
352
1.14k
      ret.length.push_back(len);
353
1.14k
    }
354
355
383
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
383
    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
383
    } else {
375
383
      ret.implementations_agree = true;
376
383
    }
377
383
    return ret;
378
383
  }
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
213
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
213
    length_result ret{};
344
345
213
    const auto implementations = get_supported_implementations();
346
213
    std::vector<std::size_t> results;
347
213
    results.reserve(implementations.size());
348
349
639
    for (auto impl : implementations) {
350
639
      const auto len = invoke_lengthcalc(impl, src);
351
639
      results.push_back(len);
352
639
      ret.length.push_back(len);
353
639
    }
354
355
213
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
213
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
213
    } else {
375
213
      ret.implementations_agree = true;
376
213
    }
377
213
    return ret;
378
213
  }
Conversion<(UtfEncodings)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
428
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
428
    length_result ret{};
344
345
428
    const auto implementations = get_supported_implementations();
346
428
    std::vector<std::size_t> results;
347
428
    results.reserve(implementations.size());
348
349
1.28k
    for (auto impl : implementations) {
350
1.28k
      const auto len = invoke_lengthcalc(impl, src);
351
1.28k
      results.push_back(len);
352
1.28k
      ret.length.push_back(len);
353
1.28k
    }
354
355
428
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
428
    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
428
    } else {
375
428
      ret.implementations_agree = true;
376
428
    }
377
428
    return ret;
378
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>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
319
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
319
    length_result ret{};
344
345
319
    const auto implementations = get_supported_implementations();
346
319
    std::vector<std::size_t> results;
347
319
    results.reserve(implementations.size());
348
349
957
    for (auto impl : implementations) {
350
957
      const auto len = invoke_lengthcalc(impl, src);
351
957
      results.push_back(len);
352
957
      ret.length.push_back(len);
353
957
    }
354
355
319
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
319
    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
319
    } else {
375
319
      ret.implementations_agree = true;
376
319
    }
377
319
    return ret;
378
319
  }
Conversion<(UtfEncodings)3, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
376
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
376
    length_result ret{};
344
345
376
    const auto implementations = get_supported_implementations();
346
376
    std::vector<std::size_t> results;
347
376
    results.reserve(implementations.size());
348
349
1.12k
    for (auto impl : implementations) {
350
1.12k
      const auto len = invoke_lengthcalc(impl, src);
351
1.12k
      results.push_back(len);
352
1.12k
      ret.length.push_back(len);
353
1.12k
    }
354
355
376
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
376
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
376
    } else {
375
376
      ret.implementations_agree = true;
376
376
    }
377
376
    return ret;
378
376
  }
Conversion<(UtfEncodings)3, (UtfEncodings)2, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char32_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char32_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
438
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
438
    length_result ret{};
344
345
438
    const auto implementations = get_supported_implementations();
346
438
    std::vector<std::size_t> results;
347
438
    results.reserve(implementations.size());
348
349
1.31k
    for (auto impl : implementations) {
350
1.31k
      const auto len = invoke_lengthcalc(impl, src);
351
1.31k
      results.push_back(len);
352
1.31k
      ret.length.push_back(len);
353
1.31k
    }
354
355
438
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
438
    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
438
    } else {
375
438
      ret.implementations_agree = true;
376
438
    }
377
438
    return ret;
378
438
  }
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
623
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
623
    length_result ret{};
344
345
623
    const auto implementations = get_supported_implementations();
346
623
    std::vector<std::size_t> results;
347
623
    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
623
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
623
    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
623
    } else {
375
623
      ret.implementations_agree = true;
376
623
    }
377
623
    return ret;
378
623
  }
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
603
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
603
    length_result ret{};
344
345
603
    const auto implementations = get_supported_implementations();
346
603
    std::vector<std::size_t> results;
347
603
    results.reserve(implementations.size());
348
349
1.80k
    for (auto impl : implementations) {
350
1.80k
      const auto len = invoke_lengthcalc(impl, src);
351
1.80k
      results.push_back(len);
352
1.80k
      ret.length.push_back(len);
353
1.80k
    }
354
355
603
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
603
    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
603
    } else {
375
603
      ret.implementations_agree = true;
376
603
    }
377
603
    return ret;
378
603
  }
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
613
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
613
    length_result ret{};
344
345
613
    const auto implementations = get_supported_implementations();
346
613
    std::vector<std::size_t> results;
347
613
    results.reserve(implementations.size());
348
349
1.83k
    for (auto impl : implementations) {
350
1.83k
      const auto len = invoke_lengthcalc(impl, src);
351
1.83k
      results.push_back(len);
352
1.83k
      ret.length.push_back(len);
353
1.83k
    }
354
355
613
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
613
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
613
    } else {
375
613
      ret.implementations_agree = true;
376
613
    }
377
613
    return ret;
378
613
  }
Conversion<(UtfEncodings)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
51
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
51
    length_result ret{};
344
345
51
    const auto implementations = get_supported_implementations();
346
51
    std::vector<std::size_t> results;
347
51
    results.reserve(implementations.size());
348
349
153
    for (auto impl : implementations) {
350
153
      const auto len = invoke_lengthcalc(impl, src);
351
153
      results.push_back(len);
352
153
      ret.length.push_back(len);
353
153
    }
354
355
51
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
51
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
51
    } else {
375
51
      ret.implementations_agree = true;
376
51
    }
377
51
    return ret;
378
51
  }
Conversion<(UtfEncodings)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
66
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
66
    length_result ret{};
344
345
66
    const auto implementations = get_supported_implementations();
346
66
    std::vector<std::size_t> results;
347
66
    results.reserve(implementations.size());
348
349
198
    for (auto impl : implementations) {
350
198
      const auto len = invoke_lengthcalc(impl, src);
351
198
      results.push_back(len);
352
198
      ret.length.push_back(len);
353
198
    }
354
355
66
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
66
    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
66
    } else {
375
66
      ret.implementations_agree = true;
376
66
    }
377
66
    return ret;
378
66
  }
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
89
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
89
    length_result ret{};
344
345
89
    const auto implementations = get_supported_implementations();
346
89
    std::vector<std::size_t> results;
347
89
    results.reserve(implementations.size());
348
349
267
    for (auto impl : implementations) {
350
267
      const auto len = invoke_lengthcalc(impl, src);
351
267
      results.push_back(len);
352
267
      ret.length.push_back(len);
353
267
    }
354
355
89
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
89
    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
89
    } else {
375
89
      ret.implementations_agree = true;
376
89
    }
377
89
    return ret;
378
89
  }
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
288
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
288
    length_result ret{};
344
345
288
    const auto implementations = get_supported_implementations();
346
288
    std::vector<std::size_t> results;
347
288
    results.reserve(implementations.size());
348
349
864
    for (auto impl : implementations) {
350
864
      const auto len = invoke_lengthcalc(impl, src);
351
864
      results.push_back(len);
352
864
      ret.length.push_back(len);
353
864
    }
354
355
288
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
288
    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
288
    } else {
375
288
      ret.implementations_agree = true;
376
288
    }
377
288
    return ret;
378
288
  }
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
124
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
124
    length_result ret{};
344
345
124
    const auto implementations = get_supported_implementations();
346
124
    std::vector<std::size_t> results;
347
124
    results.reserve(implementations.size());
348
349
372
    for (auto impl : implementations) {
350
372
      const auto len = invoke_lengthcalc(impl, src);
351
372
      results.push_back(len);
352
372
      ret.length.push_back(len);
353
372
    }
354
355
124
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
124
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
124
    } else {
375
124
      ret.implementations_agree = true;
376
124
    }
377
124
    return ret;
378
124
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::calculate_length(std::__1::span<char16_t const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
181
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
181
    length_result ret{};
344
345
181
    const auto implementations = get_supported_implementations();
346
181
    std::vector<std::size_t> results;
347
181
    results.reserve(implementations.size());
348
349
543
    for (auto impl : implementations) {
350
543
      const auto len = invoke_lengthcalc(impl, src);
351
543
      results.push_back(len);
352
543
      ret.length.push_back(len);
353
543
    }
354
355
181
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
181
    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
181
    } else {
375
181
      ret.implementations_agree = true;
376
181
    }
377
181
    return ret;
378
181
  }
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
358
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
358
    length_result ret{};
344
345
358
    const auto implementations = get_supported_implementations();
346
358
    std::vector<std::size_t> results;
347
358
    results.reserve(implementations.size());
348
349
1.07k
    for (auto impl : implementations) {
350
1.07k
      const auto len = invoke_lengthcalc(impl, src);
351
1.07k
      results.push_back(len);
352
1.07k
      ret.length.push_back(len);
353
1.07k
    }
354
355
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
358
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
358
    } else {
375
358
      ret.implementations_agree = true;
376
358
    }
377
358
    return ret;
378
358
  }
Conversion<(UtfEncodings)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
141
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
141
    length_result ret{};
344
345
141
    const auto implementations = get_supported_implementations();
346
141
    std::vector<std::size_t> results;
347
141
    results.reserve(implementations.size());
348
349
423
    for (auto impl : implementations) {
350
423
      const auto len = invoke_lengthcalc(impl, src);
351
423
      results.push_back(len);
352
423
      ret.length.push_back(len);
353
423
    }
354
355
141
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
141
    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
141
    } else {
375
141
      ret.implementations_agree = true;
376
141
    }
377
141
    return ret;
378
141
  }
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
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)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
339
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
339
    length_result ret{};
344
345
339
    const auto implementations = get_supported_implementations();
346
339
    std::vector<std::size_t> results;
347
339
    results.reserve(implementations.size());
348
349
1.01k
    for (auto impl : implementations) {
350
1.01k
      const auto len = invoke_lengthcalc(impl, src);
351
1.01k
      results.push_back(len);
352
1.01k
      ret.length.push_back(len);
353
1.01k
    }
354
355
339
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
339
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
339
    } else {
375
339
      ret.implementations_agree = true;
376
339
    }
377
339
    return ret;
378
339
  }
Conversion<(UtfEncodings)3, (UtfEncodings)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
296
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
296
    length_result ret{};
344
345
296
    const auto implementations = get_supported_implementations();
346
296
    std::vector<std::size_t> results;
347
296
    results.reserve(implementations.size());
348
349
888
    for (auto impl : implementations) {
350
888
      const auto len = invoke_lengthcalc(impl, src);
351
888
      results.push_back(len);
352
888
      ret.length.push_back(len);
353
888
    }
354
355
296
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
296
    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
296
    } else {
375
296
      ret.implementations_agree = true;
376
296
    }
377
296
    return ret;
378
296
  }
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
329
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
329
    length_result ret{};
344
345
329
    const auto implementations = get_supported_implementations();
346
329
    std::vector<std::size_t> results;
347
329
    results.reserve(implementations.size());
348
349
987
    for (auto impl : implementations) {
350
987
      const auto len = invoke_lengthcalc(impl, src);
351
987
      results.push_back(len);
352
987
      ret.length.push_back(len);
353
987
    }
354
355
329
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
329
    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
329
    } else {
375
329
      ret.implementations_agree = true;
376
329
    }
377
329
    return ret;
378
329
  }
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
446
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
446
    length_result ret{};
344
345
446
    const auto implementations = get_supported_implementations();
346
446
    std::vector<std::size_t> results;
347
446
    results.reserve(implementations.size());
348
349
1.33k
    for (auto impl : implementations) {
350
1.33k
      const auto len = invoke_lengthcalc(impl, src);
351
1.33k
      results.push_back(len);
352
1.33k
      ret.length.push_back(len);
353
1.33k
    }
354
355
446
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
446
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
446
    } else {
375
446
      ret.implementations_agree = true;
376
446
    }
377
446
    return ret;
378
446
  }
Conversion<(UtfEncodings)2, (UtfEncodings)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
250
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
250
    length_result ret{};
344
345
250
    const auto implementations = get_supported_implementations();
346
250
    std::vector<std::size_t> results;
347
250
    results.reserve(implementations.size());
348
349
750
    for (auto impl : implementations) {
350
750
      const auto len = invoke_lengthcalc(impl, src);
351
750
      results.push_back(len);
352
750
      ret.length.push_back(len);
353
750
    }
354
355
250
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
250
    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
250
    } else {
375
250
      ret.implementations_agree = true;
376
250
    }
377
250
    return ret;
378
250
  }
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
379
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
379
    length_result ret{};
344
345
379
    const auto implementations = get_supported_implementations();
346
379
    std::vector<std::size_t> results;
347
379
    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
379
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
379
    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
379
    } else {
375
379
      ret.implementations_agree = true;
376
379
    }
377
379
    return ret;
378
379
  }
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
284
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
284
    length_result ret{};
344
345
284
    const auto implementations = get_supported_implementations();
346
284
    std::vector<std::size_t> results;
347
284
    results.reserve(implementations.size());
348
349
852
    for (auto impl : implementations) {
350
852
      const auto len = invoke_lengthcalc(impl, src);
351
852
      results.push_back(len);
352
852
      ret.length.push_back(len);
353
852
    }
354
355
284
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
284
    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
284
    } else {
375
284
      ret.implementations_agree = true;
376
284
    }
377
284
    return ret;
378
284
  }
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
382
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
382
    length_result ret{};
344
345
382
    const auto implementations = get_supported_implementations();
346
382
    std::vector<std::size_t> results;
347
382
    results.reserve(implementations.size());
348
349
1.14k
    for (auto impl : implementations) {
350
1.14k
      const auto len = invoke_lengthcalc(impl, src);
351
1.14k
      results.push_back(len);
352
1.14k
      ret.length.push_back(len);
353
1.14k
    }
354
355
382
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
382
    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
382
    } else {
375
382
      ret.implementations_agree = true;
376
382
    }
377
382
    return ret;
378
382
  }
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
63
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
63
    length_result ret{};
344
345
63
    const auto implementations = get_supported_implementations();
346
63
    std::vector<std::size_t> results;
347
63
    results.reserve(implementations.size());
348
349
189
    for (auto impl : implementations) {
350
189
      const auto len = invoke_lengthcalc(impl, src);
351
189
      results.push_back(len);
352
189
      ret.length.push_back(len);
353
189
    }
354
355
63
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
63
    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
63
    } else {
375
63
      ret.implementations_agree = true;
376
63
    }
377
63
    return ret;
378
63
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
50
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
50
    length_result ret{};
344
345
50
    const auto implementations = get_supported_implementations();
346
50
    std::vector<std::size_t> results;
347
50
    results.reserve(implementations.size());
348
349
150
    for (auto impl : implementations) {
350
150
      const auto len = invoke_lengthcalc(impl, src);
351
150
      results.push_back(len);
352
150
      ret.length.push_back(len);
353
150
    }
354
355
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
357
0
      std::cerr << "begin errormessage for calculate_length\n";
358
0
      std::cerr << "in fuzz case invoking " << lengthcalcname << " with "
359
0
                << src.size() << " elements with valid input=" << inputisvalid
360
0
                << ":\n";
361
0
      for (std::size_t i = 0; i < results.size(); ++i) {
362
0
        std::cerr << "got return " << std::dec << results[i]
363
0
                  << " from implementation " << implementations[i]->name()
364
0
                  << '\n';
365
0
      }
366
0
      std::cerr << "end errormessage\n";
367
0
      if (inputisvalid) {
368
0
        ret.implementations_agree = false;
369
0
      } else {
370
0
        std::cerr
371
0
            << "implementations are allowed to disagree on invalid input\n";
372
0
        ret.implementations_agree = true;
373
0
      }
374
50
    } else {
375
50
      ret.implementations_agree = true;
376
50
    }
377
50
    return ret;
378
50
  }
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::calculate_length(std::__1::span<char const, 18446744073709551615ul>, bool) const
Line
Count
Source
342
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)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
307
  length_result calculate_length(FromSpan src, const bool inputisvalid) const {
343
307
    length_result ret{};
344
345
307
    const auto implementations = get_supported_implementations();
346
307
    std::vector<std::size_t> results;
347
307
    results.reserve(implementations.size());
348
349
921
    for (auto impl : implementations) {
350
921
      const auto len = invoke_lengthcalc(impl, src);
351
921
      results.push_back(len);
352
921
      ret.length.push_back(len);
353
921
    }
354
355
307
    auto neq = [](const auto& a, const auto& b) { return a != b; };
356
307
    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
307
    } else {
375
307
      ret.implementations_agree = true;
376
307
    }
377
307
    return ret;
378
307
  }
379
380
  conversion_result do_conversion(FromSpan src,
381
                                  const std::vector<std::size_t>& outlength,
382
8.98k
                                  const bool inputisvalid) const {
383
8.98k
    conversion_result ret{};
384
385
8.98k
    const auto implementations = get_supported_implementations();
386
387
8.98k
    std::vector<result<ConversionResult>> results;
388
8.98k
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
8.98k
    std::vector<std::vector<ToType>> outputbuffers;
393
8.98k
    outputbuffers.reserve(implementations.size());
394
35.9k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
26.9k
      auto impl = implementations[i];
396
26.9k
      const ToType canary1{42};
397
26.9k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
26.9k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
26.9k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
26.9k
      const auto success = [](const ConversionResult& r) -> bool {
402
26.9k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
15.2k
          return r != 0;
404
15.2k
        } else {
405
11.7k
          return r.error == simdutf::error_code::SUCCESS;
406
11.7k
        }
407
26.9k
      }(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
576
      const auto success = [](const ConversionResult& r) -> bool {
402
576
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
576
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
576
      }(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.11k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.11k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.11k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.11k
      }(implret1);
Conversion<(UtfEncodings)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
621
      const auto success = [](const ConversionResult& r) -> bool {
402
621
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
621
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
621
      }(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.25k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.25k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.25k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.25k
      }(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
951
      const auto success = [](const ConversionResult& r) -> bool {
402
951
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
951
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
951
      }(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.10k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.10k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.10k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.10k
      }(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.29k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.29k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.29k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.29k
      }(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.82k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.82k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.82k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.82k
      }(implret1);
Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
1.78k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.78k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.78k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.78k
      }(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.81k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.81k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.81k
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
1.81k
      }(implret1);
Conversion<(UtfEncodings)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
153
      const auto success = [](const ConversionResult& r) -> bool {
402
153
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
153
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
153
      }(implret1);
Conversion<(UtfEncodings)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
198
      const auto success = [](const ConversionResult& r) -> bool {
402
198
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
198
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
198
      }(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
267
      const auto success = [](const ConversionResult& r) -> bool {
402
267
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
267
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
267
      }(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
864
      const auto success = [](const ConversionResult& r) -> bool {
402
864
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
864
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
864
      }(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
372
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
372
        } else {
405
372
          return r.error == simdutf::error_code::SUCCESS;
406
372
        }
407
372
      }(implret1);
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(simdutf::result const&)#1}::operator()(simdutf::result const&) const
Line
Count
Source
401
543
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
543
        } else {
405
543
          return r.error == simdutf::error_code::SUCCESS;
406
543
        }
407
543
      }(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.07k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.07k
        } else {
405
1.07k
          return r.error == simdutf::error_code::SUCCESS;
406
1.07k
        }
407
1.07k
      }(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
423
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
423
        } else {
405
423
          return r.error == simdutf::error_code::SUCCESS;
406
423
        }
407
423
      }(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
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)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
1.01k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.01k
        } else {
405
1.01k
          return r.error == simdutf::error_code::SUCCESS;
406
1.01k
        }
407
1.01k
      }(implret1);
Conversion<(UtfEncodings)3, (UtfEncodings)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
888
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
888
        } else {
405
888
          return r.error == simdutf::error_code::SUCCESS;
406
888
        }
407
888
      }(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
987
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
987
        } else {
405
987
          return r.error == simdutf::error_code::SUCCESS;
406
987
        }
407
987
      }(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.33k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.33k
        } else {
405
1.33k
          return r.error == simdutf::error_code::SUCCESS;
406
1.33k
        }
407
1.33k
      }(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
750
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
750
        } else {
405
750
          return r.error == simdutf::error_code::SUCCESS;
406
750
        }
407
750
      }(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
852
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
852
        } else {
405
852
          return r.error == simdutf::error_code::SUCCESS;
406
852
        }
407
852
      }(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.14k
      const auto success = [](const ConversionResult& r) -> bool {
402
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
          return r != 0;
404
1.14k
        } else {
405
1.14k
          return r.error == simdutf::error_code::SUCCESS;
406
1.14k
        }
407
1.14k
      }(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
189
      const auto success = [](const ConversionResult& r) -> bool {
402
189
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
189
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
189
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
150
      }(implret1);
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(unsigned long const&)#1}::operator()(unsigned long const&) const
Line
Count
Source
401
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)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
921
      const auto success = [](const ConversionResult& r) -> bool {
402
921
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
921
          return r != 0;
404
        } else {
405
          return r.error == simdutf::error_code::SUCCESS;
406
        }
407
921
      }(implret1);
408
26.9k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
26.9k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
26.9k
        const ToType canary2{25};
414
26.9k
        const auto outputbuffer_first_run = outputbuffer;
415
26.9k
        std::ranges::fill(outputbuffer, canary2);
416
26.9k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
26.9k
                                          src.size(), outputbuffer.data());
418
419
26.9k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
26.9k
        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
26.9k
      }
441
26.9k
      results.emplace_back(implret1, success ? hash1 : "");
442
26.9k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
8.98k
    if (!inputisvalid) {
447
12.7k
      for (auto& e : results) {
448
12.7k
        e.outputhash.clear();
449
12.7k
      }
450
4.26k
    }
451
452
17.9k
    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
384
    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
742
    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
414
    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
838
    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
634
    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
738
    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
860
    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.21k
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)2, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(char const*, unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
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>::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.21k
    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
102
    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
132
    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
178
    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
576
    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
248
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<simdutf::result>, result>(result<simdutf::result> const&, result const&) const
Line
Count
Source
452
362
    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
716
    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
282
    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
408
    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
678
    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
592
    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
658
    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
892
    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
500
    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
758
    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
568
    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
764
    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
126
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
100
    auto neq = [](const auto& a, const auto& b) { return a != b; };
auto Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<result<unsigned long>, result>(result<unsigned long> const&, result const&) const
Line
Count
Source
452
88
    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
614
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
8.98k
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
8.98k
    } else {
474
8.98k
      ret.implementations_agree = true;
475
8.98k
    }
476
8.98k
    return ret;
477
8.98k
  }
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
192
                                  const bool inputisvalid) const {
383
192
    conversion_result ret{};
384
385
192
    const auto implementations = get_supported_implementations();
386
387
192
    std::vector<result<ConversionResult>> results;
388
192
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
192
    std::vector<std::vector<ToType>> outputbuffers;
393
192
    outputbuffers.reserve(implementations.size());
394
768
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
576
      auto impl = implementations[i];
396
576
      const ToType canary1{42};
397
576
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
576
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
576
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
576
      const auto success = [](const ConversionResult& r) -> bool {
402
576
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
576
          return r != 0;
404
576
        } else {
405
576
          return r.error == simdutf::error_code::SUCCESS;
406
576
        }
407
576
      }(implret1);
408
576
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
576
      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
576
        const ToType canary2{25};
414
576
        const auto outputbuffer_first_run = outputbuffer;
415
576
        std::ranges::fill(outputbuffer, canary2);
416
576
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
576
                                          src.size(), outputbuffer.data());
418
419
576
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
576
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
339
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
339
          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
339
        }
440
576
      }
441
576
      results.emplace_back(implret1, success ? hash1 : "");
442
576
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
192
    if (!inputisvalid) {
447
225
      for (auto& e : results) {
448
225
        e.outputhash.clear();
449
225
      }
450
75
    }
451
452
192
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
192
    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
192
    } else {
474
192
      ret.implementations_agree = true;
475
192
    }
476
192
    return ret;
477
192
  }
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
371
                                  const bool inputisvalid) const {
383
371
    conversion_result ret{};
384
385
371
    const auto implementations = get_supported_implementations();
386
387
371
    std::vector<result<ConversionResult>> results;
388
371
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
371
    std::vector<std::vector<ToType>> outputbuffers;
393
371
    outputbuffers.reserve(implementations.size());
394
1.48k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.11k
      auto impl = implementations[i];
396
1.11k
      const ToType canary1{42};
397
1.11k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.11k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.11k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.11k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.11k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.11k
          return r != 0;
404
1.11k
        } else {
405
1.11k
          return r.error == simdutf::error_code::SUCCESS;
406
1.11k
        }
407
1.11k
      }(implret1);
408
1.11k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.11k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.11k
        const ToType canary2{25};
414
1.11k
        const auto outputbuffer_first_run = outputbuffer;
415
1.11k
        std::ranges::fill(outputbuffer, canary2);
416
1.11k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.11k
                                          src.size(), outputbuffer.data());
418
419
1.11k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.11k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
870
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
870
          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
870
        }
440
1.11k
      }
441
1.11k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.11k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
371
    if (!inputisvalid) {
447
231
      for (auto& e : results) {
448
231
        e.outputhash.clear();
449
231
      }
450
77
    }
451
452
371
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
371
    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
371
    } else {
474
371
      ret.implementations_agree = true;
475
371
    }
476
371
    return ret;
477
371
  }
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
207
                                  const bool inputisvalid) const {
383
207
    conversion_result ret{};
384
385
207
    const auto implementations = get_supported_implementations();
386
387
207
    std::vector<result<ConversionResult>> results;
388
207
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
207
    std::vector<std::vector<ToType>> outputbuffers;
393
207
    outputbuffers.reserve(implementations.size());
394
828
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
621
      auto impl = implementations[i];
396
621
      const ToType canary1{42};
397
621
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
621
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
621
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
621
      const auto success = [](const ConversionResult& r) -> bool {
402
621
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
621
          return r != 0;
404
621
        } else {
405
621
          return r.error == simdutf::error_code::SUCCESS;
406
621
        }
407
621
      }(implret1);
408
621
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
621
      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
621
        const ToType canary2{25};
414
621
        const auto outputbuffer_first_run = outputbuffer;
415
621
        std::ranges::fill(outputbuffer, canary2);
416
621
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
621
                                          src.size(), outputbuffer.data());
418
419
621
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
621
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
345
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
345
          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
345
        }
440
621
      }
441
621
      results.emplace_back(implret1, success ? hash1 : "");
442
621
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
207
    if (!inputisvalid) {
447
264
      for (auto& e : results) {
448
264
        e.outputhash.clear();
449
264
      }
450
88
    }
451
452
207
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
207
    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
207
    } else {
474
207
      ret.implementations_agree = true;
475
207
    }
476
207
    return ret;
477
207
  }
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
419
                                  const bool inputisvalid) const {
383
419
    conversion_result ret{};
384
385
419
    const auto implementations = get_supported_implementations();
386
387
419
    std::vector<result<ConversionResult>> results;
388
419
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
419
    std::vector<std::vector<ToType>> outputbuffers;
393
419
    outputbuffers.reserve(implementations.size());
394
1.67k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.25k
      auto impl = implementations[i];
396
1.25k
      const ToType canary1{42};
397
1.25k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.25k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.25k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.25k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.25k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.25k
          return r != 0;
404
1.25k
        } else {
405
1.25k
          return r.error == simdutf::error_code::SUCCESS;
406
1.25k
        }
407
1.25k
      }(implret1);
408
1.25k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.25k
      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.25k
        const ToType canary2{25};
414
1.25k
        const auto outputbuffer_first_run = outputbuffer;
415
1.25k
        std::ranges::fill(outputbuffer, canary2);
416
1.25k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.25k
                                          src.size(), outputbuffer.data());
418
419
1.25k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.25k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
930
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
930
          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
930
        }
440
1.25k
      }
441
1.25k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.25k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
419
    if (!inputisvalid) {
447
318
      for (auto& e : results) {
448
318
        e.outputhash.clear();
449
318
      }
450
106
    }
451
452
419
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
419
    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
419
    } else {
474
419
      ret.implementations_agree = true;
475
419
    }
476
419
    return ret;
477
419
  }
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
317
                                  const bool inputisvalid) const {
383
317
    conversion_result ret{};
384
385
317
    const auto implementations = get_supported_implementations();
386
387
317
    std::vector<result<ConversionResult>> results;
388
317
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
317
    std::vector<std::vector<ToType>> outputbuffers;
393
317
    outputbuffers.reserve(implementations.size());
394
1.26k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
951
      auto impl = implementations[i];
396
951
      const ToType canary1{42};
397
951
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
951
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
951
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
951
      const auto success = [](const ConversionResult& r) -> bool {
402
951
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
951
          return r != 0;
404
951
        } else {
405
951
          return r.error == simdutf::error_code::SUCCESS;
406
951
        }
407
951
      }(implret1);
408
951
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
951
      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
951
        const ToType canary2{25};
414
951
        const auto outputbuffer_first_run = outputbuffer;
415
951
        std::ranges::fill(outputbuffer, canary2);
416
951
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
951
                                          src.size(), outputbuffer.data());
418
419
951
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
951
        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
951
      }
441
951
      results.emplace_back(implret1, success ? hash1 : "");
442
951
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
317
    if (!inputisvalid) {
447
555
      for (auto& e : results) {
448
555
        e.outputhash.clear();
449
555
      }
450
185
    }
451
452
317
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
317
    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
317
    } else {
474
317
      ret.implementations_agree = true;
475
317
    }
476
317
    return ret;
477
317
  }
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
369
                                  const bool inputisvalid) const {
383
369
    conversion_result ret{};
384
385
369
    const auto implementations = get_supported_implementations();
386
387
369
    std::vector<result<ConversionResult>> results;
388
369
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
369
    std::vector<std::vector<ToType>> outputbuffers;
393
369
    outputbuffers.reserve(implementations.size());
394
1.47k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.10k
      auto impl = implementations[i];
396
1.10k
      const ToType canary1{42};
397
1.10k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.10k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.10k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.10k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.10k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.10k
          return r != 0;
404
1.10k
        } else {
405
1.10k
          return r.error == simdutf::error_code::SUCCESS;
406
1.10k
        }
407
1.10k
      }(implret1);
408
1.10k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.10k
      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.10k
        const ToType canary2{25};
414
1.10k
        const auto outputbuffer_first_run = outputbuffer;
415
1.10k
        std::ranges::fill(outputbuffer, canary2);
416
1.10k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.10k
                                          src.size(), outputbuffer.data());
418
419
1.10k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.10k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
573
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
573
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
573
        }
440
1.10k
      }
441
1.10k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.10k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
369
    if (!inputisvalid) {
447
522
      for (auto& e : results) {
448
522
        e.outputhash.clear();
449
522
      }
450
174
    }
451
452
369
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
369
    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
369
    } else {
474
369
      ret.implementations_agree = true;
475
369
    }
476
369
    return ret;
477
369
  }
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
430
                                  const bool inputisvalid) const {
383
430
    conversion_result ret{};
384
385
430
    const auto implementations = get_supported_implementations();
386
387
430
    std::vector<result<ConversionResult>> results;
388
430
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
430
    std::vector<std::vector<ToType>> outputbuffers;
393
430
    outputbuffers.reserve(implementations.size());
394
1.72k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.29k
      auto impl = implementations[i];
396
1.29k
      const ToType canary1{42};
397
1.29k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.29k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.29k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.29k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.29k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.29k
          return r != 0;
404
1.29k
        } else {
405
1.29k
          return r.error == simdutf::error_code::SUCCESS;
406
1.29k
        }
407
1.29k
      }(implret1);
408
1.29k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.29k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.29k
        const ToType canary2{25};
414
1.29k
        const auto outputbuffer_first_run = outputbuffer;
415
1.29k
        std::ranges::fill(outputbuffer, canary2);
416
1.29k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.29k
                                          src.size(), outputbuffer.data());
418
419
1.29k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.29k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
483
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
483
          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
483
        }
440
1.29k
      }
441
1.29k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.29k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
430
    if (!inputisvalid) {
447
798
      for (auto& e : results) {
448
798
        e.outputhash.clear();
449
798
      }
450
266
    }
451
452
430
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
430
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
430
    } else {
474
430
      ret.implementations_agree = true;
475
430
    }
476
430
    return ret;
477
430
  }
Conversion<(UtfEncodings)2, (UtfEncodings)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
607
                                  const bool inputisvalid) const {
383
607
    conversion_result ret{};
384
385
607
    const auto implementations = get_supported_implementations();
386
387
607
    std::vector<result<ConversionResult>> results;
388
607
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
607
    std::vector<std::vector<ToType>> outputbuffers;
393
607
    outputbuffers.reserve(implementations.size());
394
2.42k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.82k
      auto impl = implementations[i];
396
1.82k
      const ToType canary1{42};
397
1.82k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.82k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.82k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.82k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.82k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.82k
          return r != 0;
404
1.82k
        } else {
405
1.82k
          return r.error == simdutf::error_code::SUCCESS;
406
1.82k
        }
407
1.82k
      }(implret1);
408
1.82k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.82k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.82k
        const ToType canary2{25};
414
1.82k
        const auto outputbuffer_first_run = outputbuffer;
415
1.82k
        std::ranges::fill(outputbuffer, canary2);
416
1.82k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.82k
                                          src.size(), outputbuffer.data());
418
419
1.82k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.82k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
966
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
966
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
966
        }
440
1.82k
      }
441
1.82k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.82k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
607
    if (!inputisvalid) {
447
849
      for (auto& e : results) {
448
849
        e.outputhash.clear();
449
849
      }
450
283
    }
451
452
607
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
607
    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
607
    } else {
474
607
      ret.implementations_agree = true;
475
607
    }
476
607
    return ret;
477
607
  }
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
596
                                  const bool inputisvalid) const {
383
596
    conversion_result ret{};
384
385
596
    const auto implementations = get_supported_implementations();
386
387
596
    std::vector<result<ConversionResult>> results;
388
596
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
596
    std::vector<std::vector<ToType>> outputbuffers;
393
596
    outputbuffers.reserve(implementations.size());
394
2.38k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.78k
      auto impl = implementations[i];
396
1.78k
      const ToType canary1{42};
397
1.78k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.78k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.78k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.78k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.78k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.78k
          return r != 0;
404
1.78k
        } else {
405
1.78k
          return r.error == simdutf::error_code::SUCCESS;
406
1.78k
        }
407
1.78k
      }(implret1);
408
1.78k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.78k
      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.78k
        const ToType canary2{25};
414
1.78k
        const auto outputbuffer_first_run = outputbuffer;
415
1.78k
        std::ranges::fill(outputbuffer, canary2);
416
1.78k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.78k
                                          src.size(), outputbuffer.data());
418
419
1.78k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.78k
        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.78k
      }
441
1.78k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.78k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
596
    if (!inputisvalid) {
447
777
      for (auto& e : results) {
448
777
        e.outputhash.clear();
449
777
      }
450
259
    }
451
452
596
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
596
    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
596
    } else {
474
596
      ret.implementations_agree = true;
475
596
    }
476
596
    return ret;
477
596
  }
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
606
                                  const bool inputisvalid) const {
383
606
    conversion_result ret{};
384
385
606
    const auto implementations = get_supported_implementations();
386
387
606
    std::vector<result<ConversionResult>> results;
388
606
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
606
    std::vector<std::vector<ToType>> outputbuffers;
393
606
    outputbuffers.reserve(implementations.size());
394
2.42k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.81k
      auto impl = implementations[i];
396
1.81k
      const ToType canary1{42};
397
1.81k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.81k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.81k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.81k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.81k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.81k
          return r != 0;
404
1.81k
        } else {
405
1.81k
          return r.error == simdutf::error_code::SUCCESS;
406
1.81k
        }
407
1.81k
      }(implret1);
408
1.81k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.81k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.81k
        const ToType canary2{25};
414
1.81k
        const auto outputbuffer_first_run = outputbuffer;
415
1.81k
        std::ranges::fill(outputbuffer, canary2);
416
1.81k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.81k
                                          src.size(), outputbuffer.data());
418
419
1.81k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.81k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
1.09k
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
1.09k
          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.09k
        }
440
1.81k
      }
441
1.81k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.81k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
606
    if (!inputisvalid) {
447
714
      for (auto& e : results) {
448
714
        e.outputhash.clear();
449
714
      }
450
238
    }
451
452
606
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
606
    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
606
    } else {
474
606
      ret.implementations_agree = true;
475
606
    }
476
606
    return ret;
477
606
  }
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
51
                                  const bool inputisvalid) const {
383
51
    conversion_result ret{};
384
385
51
    const auto implementations = get_supported_implementations();
386
387
51
    std::vector<result<ConversionResult>> results;
388
51
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
51
    std::vector<std::vector<ToType>> outputbuffers;
393
51
    outputbuffers.reserve(implementations.size());
394
204
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
153
      auto impl = implementations[i];
396
153
      const ToType canary1{42};
397
153
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
153
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
153
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
153
      const auto success = [](const ConversionResult& r) -> bool {
402
153
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
153
          return r != 0;
404
153
        } else {
405
153
          return r.error == simdutf::error_code::SUCCESS;
406
153
        }
407
153
      }(implret1);
408
153
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
153
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
153
        const ToType canary2{25};
414
153
        const auto outputbuffer_first_run = outputbuffer;
415
153
        std::ranges::fill(outputbuffer, canary2);
416
153
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
153
                                          src.size(), outputbuffer.data());
418
419
153
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
153
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
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
153
      }
441
153
      results.emplace_back(implret1, success ? hash1 : "");
442
153
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
51
    if (!inputisvalid) {
447
36
      for (auto& e : results) {
448
36
        e.outputhash.clear();
449
36
      }
450
12
    }
451
452
51
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
51
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
51
    } else {
474
51
      ret.implementations_agree = true;
475
51
    }
476
51
    return ret;
477
51
  }
Conversion<(UtfEncodings)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
66
                                  const bool inputisvalid) const {
383
66
    conversion_result ret{};
384
385
66
    const auto implementations = get_supported_implementations();
386
387
66
    std::vector<result<ConversionResult>> results;
388
66
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
66
    std::vector<std::vector<ToType>> outputbuffers;
393
66
    outputbuffers.reserve(implementations.size());
394
264
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
198
      auto impl = implementations[i];
396
198
      const ToType canary1{42};
397
198
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
198
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
198
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
198
      const auto success = [](const ConversionResult& r) -> bool {
402
198
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
198
          return r != 0;
404
198
        } else {
405
198
          return r.error == simdutf::error_code::SUCCESS;
406
198
        }
407
198
      }(implret1);
408
198
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
198
      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
198
        const ToType canary2{25};
414
198
        const auto outputbuffer_first_run = outputbuffer;
415
198
        std::ranges::fill(outputbuffer, canary2);
416
198
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
198
                                          src.size(), outputbuffer.data());
418
419
198
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
198
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
57
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
57
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
57
        }
440
198
      }
441
198
      results.emplace_back(implret1, success ? hash1 : "");
442
198
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
66
    if (!inputisvalid) {
447
66
      for (auto& e : results) {
448
66
        e.outputhash.clear();
449
66
      }
450
22
    }
451
452
66
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
66
    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
66
    } else {
474
66
      ret.implementations_agree = true;
475
66
    }
476
66
    return ret;
477
66
  }
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
89
                                  const bool inputisvalid) const {
383
89
    conversion_result ret{};
384
385
89
    const auto implementations = get_supported_implementations();
386
387
89
    std::vector<result<ConversionResult>> results;
388
89
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
89
    std::vector<std::vector<ToType>> outputbuffers;
393
89
    outputbuffers.reserve(implementations.size());
394
356
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
267
      auto impl = implementations[i];
396
267
      const ToType canary1{42};
397
267
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
267
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
267
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
267
      const auto success = [](const ConversionResult& r) -> bool {
402
267
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
267
          return r != 0;
404
267
        } else {
405
267
          return r.error == simdutf::error_code::SUCCESS;
406
267
        }
407
267
      }(implret1);
408
267
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
267
      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
267
        const ToType canary2{25};
414
267
        const auto outputbuffer_first_run = outputbuffer;
415
267
        std::ranges::fill(outputbuffer, canary2);
416
267
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
267
                                          src.size(), outputbuffer.data());
418
419
267
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
267
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
72
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
72
          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
72
        }
440
267
      }
441
267
      results.emplace_back(implret1, success ? hash1 : "");
442
267
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
89
    if (!inputisvalid) {
447
183
      for (auto& e : results) {
448
183
        e.outputhash.clear();
449
183
      }
450
61
    }
451
452
89
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
89
    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
89
    } else {
474
89
      ret.implementations_agree = true;
475
89
    }
476
89
    return ret;
477
89
  }
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
288
                                  const bool inputisvalid) const {
383
288
    conversion_result ret{};
384
385
288
    const auto implementations = get_supported_implementations();
386
387
288
    std::vector<result<ConversionResult>> results;
388
288
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
288
    std::vector<std::vector<ToType>> outputbuffers;
393
288
    outputbuffers.reserve(implementations.size());
394
1.15k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
864
      auto impl = implementations[i];
396
864
      const ToType canary1{42};
397
864
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
864
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
864
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
864
      const auto success = [](const ConversionResult& r) -> bool {
402
864
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
864
          return r != 0;
404
864
        } else {
405
864
          return r.error == simdutf::error_code::SUCCESS;
406
864
        }
407
864
      }(implret1);
408
864
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
864
      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
864
        const ToType canary2{25};
414
864
        const auto outputbuffer_first_run = outputbuffer;
415
864
        std::ranges::fill(outputbuffer, canary2);
416
864
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
864
                                          src.size(), outputbuffer.data());
418
419
864
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
864
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
276
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
276
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
276
        }
440
864
      }
441
864
      results.emplace_back(implret1, success ? hash1 : "");
442
864
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
288
    if (!inputisvalid) {
447
561
      for (auto& e : results) {
448
561
        e.outputhash.clear();
449
561
      }
450
187
    }
451
452
288
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
288
    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
288
    } else {
474
288
      ret.implementations_agree = true;
475
288
    }
476
288
    return ret;
477
288
  }
Conversion<(UtfEncodings)0, (UtfEncodings)4, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
124
                                  const bool inputisvalid) const {
383
124
    conversion_result ret{};
384
385
124
    const auto implementations = get_supported_implementations();
386
387
124
    std::vector<result<ConversionResult>> results;
388
124
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
124
    std::vector<std::vector<ToType>> outputbuffers;
393
124
    outputbuffers.reserve(implementations.size());
394
496
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
372
      auto impl = implementations[i];
396
372
      const ToType canary1{42};
397
372
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
372
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
372
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
372
      const auto success = [](const ConversionResult& r) -> bool {
402
372
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
372
          return r != 0;
404
372
        } else {
405
372
          return r.error == simdutf::error_code::SUCCESS;
406
372
        }
407
372
      }(implret1);
408
372
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
372
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
372
        const ToType canary2{25};
414
372
        const auto outputbuffer_first_run = outputbuffer;
415
372
        std::ranges::fill(outputbuffer, canary2);
416
372
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
372
                                          src.size(), outputbuffer.data());
418
419
372
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
372
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
132
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
132
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
132
        }
440
372
      }
441
372
      results.emplace_back(implret1, success ? hash1 : "");
442
372
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
124
    if (!inputisvalid) {
447
90
      for (auto& e : results) {
448
90
        e.outputhash.clear();
449
90
      }
450
30
    }
451
452
124
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
124
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
124
    } else {
474
124
      ret.implementations_agree = true;
475
124
    }
476
124
    return ret;
477
124
  }
Conversion<(UtfEncodings)0, (UtfEncodings)3, unsigned long (simdutf::implementation::*)(char16_t const*, unsigned long) noexcept const, simdutf::result (simdutf::implementation::*)(char16_t const*, unsigned long, char32_t*) noexcept const>::do_conversion(std::__1::span<char16_t const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
181
                                  const bool inputisvalid) const {
383
181
    conversion_result ret{};
384
385
181
    const auto implementations = get_supported_implementations();
386
387
181
    std::vector<result<ConversionResult>> results;
388
181
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
181
    std::vector<std::vector<ToType>> outputbuffers;
393
181
    outputbuffers.reserve(implementations.size());
394
724
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
543
      auto impl = implementations[i];
396
543
      const ToType canary1{42};
397
543
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
543
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
543
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
543
      const auto success = [](const ConversionResult& r) -> bool {
402
543
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
543
          return r != 0;
404
543
        } else {
405
543
          return r.error == simdutf::error_code::SUCCESS;
406
543
        }
407
543
      }(implret1);
408
543
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
543
      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
543
        const ToType canary2{25};
414
543
        const auto outputbuffer_first_run = outputbuffer;
415
543
        std::ranges::fill(outputbuffer, canary2);
416
543
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
543
                                          src.size(), outputbuffer.data());
418
419
543
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
543
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
261
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
261
          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
261
        }
440
543
      }
441
543
      results.emplace_back(implret1, success ? hash1 : "");
442
543
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
181
    if (!inputisvalid) {
447
282
      for (auto& e : results) {
448
282
        e.outputhash.clear();
449
282
      }
450
94
    }
451
452
181
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
181
    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
181
    } else {
474
181
      ret.implementations_agree = true;
475
181
    }
476
181
    return ret;
477
181
  }
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
358
                                  const bool inputisvalid) const {
383
358
    conversion_result ret{};
384
385
358
    const auto implementations = get_supported_implementations();
386
387
358
    std::vector<result<ConversionResult>> results;
388
358
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
358
    std::vector<std::vector<ToType>> outputbuffers;
393
358
    outputbuffers.reserve(implementations.size());
394
1.43k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.07k
      auto impl = implementations[i];
396
1.07k
      const ToType canary1{42};
397
1.07k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.07k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.07k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.07k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.07k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.07k
          return r != 0;
404
1.07k
        } else {
405
1.07k
          return r.error == simdutf::error_code::SUCCESS;
406
1.07k
        }
407
1.07k
      }(implret1);
408
1.07k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.07k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.07k
        const ToType canary2{25};
414
1.07k
        const auto outputbuffer_first_run = outputbuffer;
415
1.07k
        std::ranges::fill(outputbuffer, canary2);
416
1.07k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.07k
                                          src.size(), outputbuffer.data());
418
419
1.07k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.07k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
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.07k
      }
441
1.07k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.07k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
358
    if (!inputisvalid) {
447
441
      for (auto& e : results) {
448
441
        e.outputhash.clear();
449
441
      }
450
147
    }
451
452
358
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
358
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
358
    } else {
474
358
      ret.implementations_agree = true;
475
358
    }
476
358
    return ret;
477
358
  }
Conversion<(UtfEncodings)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
141
                                  const bool inputisvalid) const {
383
141
    conversion_result ret{};
384
385
141
    const auto implementations = get_supported_implementations();
386
387
141
    std::vector<result<ConversionResult>> results;
388
141
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
141
    std::vector<std::vector<ToType>> outputbuffers;
393
141
    outputbuffers.reserve(implementations.size());
394
564
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
423
      auto impl = implementations[i];
396
423
      const ToType canary1{42};
397
423
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
423
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
423
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
423
      const auto success = [](const ConversionResult& r) -> bool {
402
423
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
423
          return r != 0;
404
423
        } else {
405
423
          return r.error == simdutf::error_code::SUCCESS;
406
423
        }
407
423
      }(implret1);
408
423
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
423
      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
423
        const ToType canary2{25};
414
423
        const auto outputbuffer_first_run = outputbuffer;
415
423
        std::ranges::fill(outputbuffer, canary2);
416
423
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
423
                                          src.size(), outputbuffer.data());
418
419
423
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
423
        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
423
      }
441
423
      results.emplace_back(implret1, success ? hash1 : "");
442
423
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
141
    if (!inputisvalid) {
447
129
      for (auto& e : results) {
448
129
        e.outputhash.clear();
449
129
      }
450
43
    }
451
452
141
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
141
    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
141
    } else {
474
141
      ret.implementations_agree = true;
475
141
    }
476
141
    return ret;
477
141
  }
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
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
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
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
345
      for (auto& e : results) {
448
345
        e.outputhash.clear();
449
345
      }
450
115
    }
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)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
339
                                  const bool inputisvalid) const {
383
339
    conversion_result ret{};
384
385
339
    const auto implementations = get_supported_implementations();
386
387
339
    std::vector<result<ConversionResult>> results;
388
339
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
339
    std::vector<std::vector<ToType>> outputbuffers;
393
339
    outputbuffers.reserve(implementations.size());
394
1.35k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.01k
      auto impl = implementations[i];
396
1.01k
      const ToType canary1{42};
397
1.01k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.01k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.01k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.01k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.01k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.01k
          return r != 0;
404
1.01k
        } else {
405
1.01k
          return r.error == simdutf::error_code::SUCCESS;
406
1.01k
        }
407
1.01k
      }(implret1);
408
1.01k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.01k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.01k
        const ToType canary2{25};
414
1.01k
        const auto outputbuffer_first_run = outputbuffer;
415
1.01k
        std::ranges::fill(outputbuffer, canary2);
416
1.01k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.01k
                                          src.size(), outputbuffer.data());
418
419
1.01k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.01k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
594
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
594
          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
594
        }
440
1.01k
      }
441
1.01k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.01k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
339
    if (!inputisvalid) {
447
423
      for (auto& e : results) {
448
423
        e.outputhash.clear();
449
423
      }
450
141
    }
451
452
339
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
339
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
339
    } else {
474
339
      ret.implementations_agree = true;
475
339
    }
476
339
    return ret;
477
339
  }
Conversion<(UtfEncodings)3, (UtfEncodings)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
66
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
66
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
66
        }
440
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
522
      for (auto& e : results) {
448
522
        e.outputhash.clear();
449
522
      }
450
174
    }
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
296
                                  const bool inputisvalid) const {
383
296
    conversion_result ret{};
384
385
296
    const auto implementations = get_supported_implementations();
386
387
296
    std::vector<result<ConversionResult>> results;
388
296
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
296
    std::vector<std::vector<ToType>> outputbuffers;
393
296
    outputbuffers.reserve(implementations.size());
394
1.18k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
888
      auto impl = implementations[i];
396
888
      const ToType canary1{42};
397
888
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
888
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
888
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
888
      const auto success = [](const ConversionResult& r) -> bool {
402
888
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
888
          return r != 0;
404
888
        } else {
405
888
          return r.error == simdutf::error_code::SUCCESS;
406
888
        }
407
888
      }(implret1);
408
888
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
888
      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
888
        const ToType canary2{25};
414
888
        const auto outputbuffer_first_run = outputbuffer;
415
888
        std::ranges::fill(outputbuffer, canary2);
416
888
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
888
                                          src.size(), outputbuffer.data());
418
419
888
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
888
        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
888
      }
441
888
      results.emplace_back(implret1, success ? hash1 : "");
442
888
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
296
    if (!inputisvalid) {
447
621
      for (auto& e : results) {
448
621
        e.outputhash.clear();
449
621
      }
450
207
    }
451
452
296
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
296
    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
296
    } else {
474
296
      ret.implementations_agree = true;
475
296
    }
476
296
    return ret;
477
296
  }
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
329
                                  const bool inputisvalid) const {
383
329
    conversion_result ret{};
384
385
329
    const auto implementations = get_supported_implementations();
386
387
329
    std::vector<result<ConversionResult>> results;
388
329
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
329
    std::vector<std::vector<ToType>> outputbuffers;
393
329
    outputbuffers.reserve(implementations.size());
394
1.31k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
987
      auto impl = implementations[i];
396
987
      const ToType canary1{42};
397
987
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
987
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
987
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
987
      const auto success = [](const ConversionResult& r) -> bool {
402
987
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
987
          return r != 0;
404
987
        } else {
405
987
          return r.error == simdutf::error_code::SUCCESS;
406
987
        }
407
987
      }(implret1);
408
987
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
987
      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
987
        const ToType canary2{25};
414
987
        const auto outputbuffer_first_run = outputbuffer;
415
987
        std::ranges::fill(outputbuffer, canary2);
416
987
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
987
                                          src.size(), outputbuffer.data());
418
419
987
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
987
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
264
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
264
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
264
        }
440
987
      }
441
987
      results.emplace_back(implret1, success ? hash1 : "");
442
987
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
329
    if (!inputisvalid) {
447
723
      for (auto& e : results) {
448
723
        e.outputhash.clear();
449
723
      }
450
241
    }
451
452
329
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
329
    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
329
    } else {
474
329
      ret.implementations_agree = true;
475
329
    }
476
329
    return ret;
477
329
  }
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
446
                                  const bool inputisvalid) const {
383
446
    conversion_result ret{};
384
385
446
    const auto implementations = get_supported_implementations();
386
387
446
    std::vector<result<ConversionResult>> results;
388
446
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
446
    std::vector<std::vector<ToType>> outputbuffers;
393
446
    outputbuffers.reserve(implementations.size());
394
1.78k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.33k
      auto impl = implementations[i];
396
1.33k
      const ToType canary1{42};
397
1.33k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.33k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.33k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.33k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.33k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.33k
          return r != 0;
404
1.33k
        } else {
405
1.33k
          return r.error == simdutf::error_code::SUCCESS;
406
1.33k
        }
407
1.33k
      }(implret1);
408
1.33k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.33k
      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.33k
        const ToType canary2{25};
414
1.33k
        const auto outputbuffer_first_run = outputbuffer;
415
1.33k
        std::ranges::fill(outputbuffer, canary2);
416
1.33k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.33k
                                          src.size(), outputbuffer.data());
418
419
1.33k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.33k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
333
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
333
          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
333
        }
440
1.33k
      }
441
1.33k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.33k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
446
    if (!inputisvalid) {
447
1.00k
      for (auto& e : results) {
448
1.00k
        e.outputhash.clear();
449
1.00k
      }
450
335
    }
451
452
446
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
446
    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
446
    } else {
474
446
      ret.implementations_agree = true;
475
446
    }
476
446
    return ret;
477
446
  }
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
250
                                  const bool inputisvalid) const {
383
250
    conversion_result ret{};
384
385
250
    const auto implementations = get_supported_implementations();
386
387
250
    std::vector<result<ConversionResult>> results;
388
250
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
250
    std::vector<std::vector<ToType>> outputbuffers;
393
250
    outputbuffers.reserve(implementations.size());
394
1.00k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
750
      auto impl = implementations[i];
396
750
      const ToType canary1{42};
397
750
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
750
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
750
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
750
      const auto success = [](const ConversionResult& r) -> bool {
402
750
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
750
          return r != 0;
404
750
        } else {
405
750
          return r.error == simdutf::error_code::SUCCESS;
406
750
        }
407
750
      }(implret1);
408
750
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
750
      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
750
        const ToType canary2{25};
414
750
        const auto outputbuffer_first_run = outputbuffer;
415
750
        std::ranges::fill(outputbuffer, canary2);
416
750
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
750
                                          src.size(), outputbuffer.data());
418
419
750
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
750
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
345
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
345
          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
345
        }
440
750
      }
441
750
      results.emplace_back(implret1, success ? hash1 : "");
442
750
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
250
    if (!inputisvalid) {
447
393
      for (auto& e : results) {
448
393
        e.outputhash.clear();
449
393
      }
450
131
    }
451
452
250
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
250
    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
250
    } else {
474
250
      ret.implementations_agree = true;
475
250
    }
476
250
    return ret;
477
250
  }
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
379
                                  const bool inputisvalid) const {
383
379
    conversion_result ret{};
384
385
379
    const auto implementations = get_supported_implementations();
386
387
379
    std::vector<result<ConversionResult>> results;
388
379
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
379
    std::vector<std::vector<ToType>> outputbuffers;
393
379
    outputbuffers.reserve(implementations.size());
394
1.51k
    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
507
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
507
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
507
        }
440
1.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
379
    if (!inputisvalid) {
447
630
      for (auto& e : results) {
448
630
        e.outputhash.clear();
449
630
      }
450
210
    }
451
452
379
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
379
    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
379
    } else {
474
379
      ret.implementations_agree = true;
475
379
    }
476
379
    return ret;
477
379
  }
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
284
                                  const bool inputisvalid) const {
383
284
    conversion_result ret{};
384
385
284
    const auto implementations = get_supported_implementations();
386
387
284
    std::vector<result<ConversionResult>> results;
388
284
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
284
    std::vector<std::vector<ToType>> outputbuffers;
393
284
    outputbuffers.reserve(implementations.size());
394
1.13k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
852
      auto impl = implementations[i];
396
852
      const ToType canary1{42};
397
852
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
852
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
852
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
852
      const auto success = [](const ConversionResult& r) -> bool {
402
852
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
852
          return r != 0;
404
852
        } else {
405
852
          return r.error == simdutf::error_code::SUCCESS;
406
852
        }
407
852
      }(implret1);
408
852
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
852
      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
852
        const ToType canary2{25};
414
852
        const auto outputbuffer_first_run = outputbuffer;
415
852
        std::ranges::fill(outputbuffer, canary2);
416
852
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
852
                                          src.size(), outputbuffer.data());
418
419
852
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
852
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
378
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
378
          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
378
        }
440
852
      }
441
852
      results.emplace_back(implret1, success ? hash1 : "");
442
852
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
284
    if (!inputisvalid) {
447
474
      for (auto& e : results) {
448
474
        e.outputhash.clear();
449
474
      }
450
158
    }
451
452
284
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
284
    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
284
    } else {
474
284
      ret.implementations_agree = true;
475
284
    }
476
284
    return ret;
477
284
  }
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
382
                                  const bool inputisvalid) const {
383
382
    conversion_result ret{};
384
385
382
    const auto implementations = get_supported_implementations();
386
387
382
    std::vector<result<ConversionResult>> results;
388
382
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
382
    std::vector<std::vector<ToType>> outputbuffers;
393
382
    outputbuffers.reserve(implementations.size());
394
1.52k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
1.14k
      auto impl = implementations[i];
396
1.14k
      const ToType canary1{42};
397
1.14k
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
1.14k
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
1.14k
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
1.14k
      const auto success = [](const ConversionResult& r) -> bool {
402
1.14k
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
1.14k
          return r != 0;
404
1.14k
        } else {
405
1.14k
          return r.error == simdutf::error_code::SUCCESS;
406
1.14k
        }
407
1.14k
      }(implret1);
408
1.14k
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
1.14k
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
1.14k
        const ToType canary2{25};
414
1.14k
        const auto outputbuffer_first_run = outputbuffer;
415
1.14k
        std::ranges::fill(outputbuffer, canary2);
416
1.14k
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
1.14k
                                          src.size(), outputbuffer.data());
418
419
1.14k
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
1.14k
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
528
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
528
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
528
        }
440
1.14k
      }
441
1.14k
      results.emplace_back(implret1, success ? hash1 : "");
442
1.14k
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
382
    if (!inputisvalid) {
447
618
      for (auto& e : results) {
448
618
        e.outputhash.clear();
449
618
      }
450
206
    }
451
452
382
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
382
    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
382
    } else {
474
382
      ret.implementations_agree = true;
475
382
    }
476
382
    return ret;
477
382
  }
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
63
                                  const bool inputisvalid) const {
383
63
    conversion_result ret{};
384
385
63
    const auto implementations = get_supported_implementations();
386
387
63
    std::vector<result<ConversionResult>> results;
388
63
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
63
    std::vector<std::vector<ToType>> outputbuffers;
393
63
    outputbuffers.reserve(implementations.size());
394
252
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
189
      auto impl = implementations[i];
396
189
      const ToType canary1{42};
397
189
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
189
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
189
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
189
      const auto success = [](const ConversionResult& r) -> bool {
402
189
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
189
          return r != 0;
404
189
        } else {
405
189
          return r.error == simdutf::error_code::SUCCESS;
406
189
        }
407
189
      }(implret1);
408
189
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
189
      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
189
        const ToType canary2{25};
414
189
        const auto outputbuffer_first_run = outputbuffer;
415
189
        std::ranges::fill(outputbuffer, canary2);
416
189
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
189
                                          src.size(), outputbuffer.data());
418
419
189
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
189
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
183
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
183
          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
183
        }
440
189
      }
441
189
      results.emplace_back(implret1, success ? hash1 : "");
442
189
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
63
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
63
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
63
    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
63
    } else {
474
63
      ret.implementations_agree = true;
475
63
    }
476
63
    return ret;
477
63
  }
Conversion<(UtfEncodings)4, (UtfEncodings)0, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
50
                                  const bool inputisvalid) const {
383
50
    conversion_result ret{};
384
385
50
    const auto implementations = get_supported_implementations();
386
387
50
    std::vector<result<ConversionResult>> results;
388
50
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
50
    std::vector<std::vector<ToType>> outputbuffers;
393
50
    outputbuffers.reserve(implementations.size());
394
200
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
150
      auto impl = implementations[i];
396
150
      const ToType canary1{42};
397
150
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
150
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
150
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
150
      const auto success = [](const ConversionResult& r) -> bool {
402
150
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
150
          return r != 0;
404
150
        } else {
405
150
          return r.error == simdutf::error_code::SUCCESS;
406
150
        }
407
150
      }(implret1);
408
150
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
150
      if constexpr (use_canary_in_output) {
410
        // optionally convert again, this time with the buffer filled with
411
        // a different value. if the output differs, it means some of the buffer
412
        // was not written to by the conversion function.
413
150
        const ToType canary2{25};
414
150
        const auto outputbuffer_first_run = outputbuffer;
415
150
        std::ranges::fill(outputbuffer, canary2);
416
150
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
150
                                          src.size(), outputbuffer.data());
418
419
150
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
150
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
144
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
144
          if (hash1 != hash2) {
427
0
            std::cerr << "different output the second time!\n";
428
0
            std::cerr << "implementation " << impl->name() << " " << name
429
0
                      << '\n';
430
0
            std::cerr << "input is valid=" << inputisvalid << '\n';
431
0
            std::cerr << "output length=" << outputbuffer.size() << '\n';
432
0
            std::cerr << "conversion was a success? " << success << '\n';
433
0
            for (std::size_t j = 0; j < outputbuffer.size(); ++j) {
434
0
              std::cerr << "output[" << j << "]\t" << +outputbuffer_first_run[j]
435
0
                        << '\t' << +outputbuffer[j] << '\n';
436
0
            }
437
0
            std::abort();
438
0
          }
439
144
        }
440
150
      }
441
150
      results.emplace_back(implret1, success ? hash1 : "");
442
150
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
50
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
50
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
50
    if (std::ranges::adjacent_find(results, neq) != results.end()) {
454
0
      std::cerr << "begin errormessage for do_conversion\n";
455
0
      std::cerr << "in fuzz case for " << name << " invoked with " << src.size()
456
0
                << " elements:\n";
457
0
      std::cerr << "input data is valid ? " << inputisvalid << '\n';
458
0
      for (std::size_t i = 0; i < results.size(); ++i) {
459
0
        std::cerr << "got return " << std::dec << results[i]
460
0
                  << " from implementation " << implementations[i]->name()
461
0
                  << " using outlen=" << outlength.at(i) << '\n';
462
0
      }
463
0
      for (std::size_t i = 0; i < results.size(); ++i) {
464
0
        std::cerr << "implementation " << implementations[i]->name()
465
0
                  << " out: ";
466
0
        for (const auto e : outputbuffers.at(i)) {
467
0
          std::cerr << +e << ", ";
468
0
        }
469
0
        std::cerr << '\n';
470
0
      }
471
0
      std::cerr << "end errormessage\n";
472
0
      ret.implementations_agree = false;
473
50
    } else {
474
50
      ret.implementations_agree = true;
475
50
    }
476
50
    return ret;
477
50
  }
Conversion<(UtfEncodings)4, (UtfEncodings)1, unsigned long (simdutf::implementation::*)(unsigned long) noexcept const, unsigned long (simdutf::implementation::*)(char const*, unsigned long, char16_t*) noexcept const>::do_conversion(std::__1::span<char const, 18446744073709551615ul>, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, bool) const
Line
Count
Source
382
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)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
307
                                  const bool inputisvalid) const {
383
307
    conversion_result ret{};
384
385
307
    const auto implementations = get_supported_implementations();
386
387
307
    std::vector<result<ConversionResult>> results;
388
307
    results.reserve(implementations.size());
389
390
    // put the output in a separate allocation to make access violations easier
391
    // to catch
392
307
    std::vector<std::vector<ToType>> outputbuffers;
393
307
    outputbuffers.reserve(implementations.size());
394
1.22k
    for (std::size_t i = 0; i < implementations.size(); ++i) {
395
921
      auto impl = implementations[i];
396
921
      const ToType canary1{42};
397
921
      auto& outputbuffer = outputbuffers.emplace_back(outlength.at(i), canary1);
398
921
      const auto implret1 = std::invoke(conversion, impl, src.data(),
399
921
                                        src.size(), outputbuffer.data());
400
      // was the conversion successful?
401
921
      const auto success = [](const ConversionResult& r) -> bool {
402
921
        if constexpr (std::is_same_v<ConversionResult, std::size_t>) {
403
921
          return r != 0;
404
921
        } else {
405
921
          return r.error == simdutf::error_code::SUCCESS;
406
921
        }
407
921
      }(implret1);
408
921
      const auto hash1 = FNV1A_hash::as_str(outputbuffer);
409
921
      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
921
        const ToType canary2{25};
414
921
        const auto outputbuffer_first_run = outputbuffer;
415
921
        std::ranges::fill(outputbuffer, canary2);
416
921
        const auto implret2 = std::invoke(conversion, impl, src.data(),
417
921
                                          src.size(), outputbuffer.data());
418
419
921
        if (implret1 != implret2) {
420
0
          std::cerr << "different return value the second time!\n";
421
0
          std::abort();
422
0
        }
423
921
        if (inputisvalid && success) {
424
          // only care about the output if the input is valid
425
915
          const auto hash2 = FNV1A_hash::as_str(outputbuffer);
426
915
          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
915
        }
440
921
      }
441
921
      results.emplace_back(implret1, success ? hash1 : "");
442
921
    }
443
444
    // do not require implementations to give the same output if
445
    // the input is not valid.
446
307
    if (!inputisvalid) {
447
0
      for (auto& e : results) {
448
0
        e.outputhash.clear();
449
0
      }
450
0
    }
451
452
307
    auto neq = [](const auto& a, const auto& b) { return a != b; };
453
307
    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
307
    } else {
474
307
      ret.implementations_agree = true;
475
307
    }
476
307
    return ret;
477
307
  }
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.07k
    +[](std::span<const char> chardata) {                                      \
555
9.07k
      const auto c =                                                           \
556
9.07k
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
9.07k
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
9.07k
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
9.07k
              &I::lenfunc, &I::conversionfunc,                                 \
560
9.07k
              std::string{NAMEOF(&I::lenfunc)},                                \
561
9.07k
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
9.07k
      c.fuzz(chardata);                                                        \
563
9.07k
    }                                                                          \
conversion.cpp:populate_functions()::$_0::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
89
    +[](std::span<const char> chardata) {                                      \
555
89
      const auto c =                                                           \
556
89
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
89
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
89
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
89
              &I::lenfunc, &I::conversionfunc,                                 \
560
89
              std::string{NAMEOF(&I::lenfunc)},                                \
561
89
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
89
      c.fuzz(chardata);                                                        \
563
89
    }                                                                          \
conversion.cpp:populate_functions()::$_1::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
212
    +[](std::span<const char> chardata) {                                      \
555
212
      const auto c =                                                           \
556
212
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
212
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
212
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
212
              &I::lenfunc, &I::conversionfunc,                                 \
560
212
              std::string{NAMEOF(&I::lenfunc)},                                \
561
212
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
212
      c.fuzz(chardata);                                                        \
563
212
    }                                                                          \
conversion.cpp:populate_functions()::$_2::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
66
    +[](std::span<const char> chardata) {                                      \
555
66
      const auto c =                                                           \
556
66
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
66
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
66
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
66
              &I::lenfunc, &I::conversionfunc,                                 \
560
66
              std::string{NAMEOF(&I::lenfunc)},                                \
561
66
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
66
      c.fuzz(chardata);                                                        \
563
66
    }                                                                          \
conversion.cpp:populate_functions()::$_3::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
223
    +[](std::span<const char> chardata) {                                      \
555
223
      const auto c =                                                           \
556
223
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
223
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
223
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
223
              &I::lenfunc, &I::conversionfunc,                                 \
560
223
              std::string{NAMEOF(&I::lenfunc)},                                \
561
223
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
223
      c.fuzz(chardata);                                                        \
563
223
    }                                                                          \
conversion.cpp:populate_functions()::$_4::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
65
    +[](std::span<const char> chardata) {                                      \
555
65
      const auto c =                                                           \
556
65
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
65
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
65
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
65
              &I::lenfunc, &I::conversionfunc,                                 \
560
65
              std::string{NAMEOF(&I::lenfunc)},                                \
561
65
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
65
      c.fuzz(chardata);                                                        \
563
65
    }                                                                          \
conversion.cpp:populate_functions()::$_5::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
128
    +[](std::span<const char> chardata) {                                      \
555
128
      const auto c =                                                           \
556
128
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
128
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
128
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
128
              &I::lenfunc, &I::conversionfunc,                                 \
560
128
              std::string{NAMEOF(&I::lenfunc)},                                \
561
128
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
128
      c.fuzz(chardata);                                                        \
563
128
    }                                                                          \
conversion.cpp:populate_functions()::$_6::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
120
    +[](std::span<const char> chardata) {                                      \
555
120
      const auto c =                                                           \
556
120
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
120
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
120
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
120
              &I::lenfunc, &I::conversionfunc,                                 \
560
120
              std::string{NAMEOF(&I::lenfunc)},                                \
561
120
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
120
      c.fuzz(chardata);                                                        \
563
120
    }                                                                          \
conversion.cpp:populate_functions()::$_7::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
244
    +[](std::span<const char> chardata) {                                      \
555
244
      const auto c =                                                           \
556
244
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
244
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
244
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
244
              &I::lenfunc, &I::conversionfunc,                                 \
560
244
              std::string{NAMEOF(&I::lenfunc)},                                \
561
244
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
244
      c.fuzz(chardata);                                                        \
563
244
    }                                                                          \
conversion.cpp:populate_functions()::$_8::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
226
    +[](std::span<const char> chardata) {                                      \
555
226
      const auto c =                                                           \
556
226
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
226
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
226
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
226
              &I::lenfunc, &I::conversionfunc,                                 \
560
226
              std::string{NAMEOF(&I::lenfunc)},                                \
561
226
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
226
      c.fuzz(chardata);                                                        \
563
226
    }                                                                          \
conversion.cpp:populate_functions()::$_9::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
234
    +[](std::span<const char> chardata) {                                      \
555
234
      const auto c =                                                           \
556
234
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
234
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
234
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
234
              &I::lenfunc, &I::conversionfunc,                                 \
560
234
              std::string{NAMEOF(&I::lenfunc)},                                \
561
234
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
234
      c.fuzz(chardata);                                                        \
563
234
    }                                                                          \
conversion.cpp:populate_functions()::$_10::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
51
    +[](std::span<const char> chardata) {                                      \
555
51
      const auto c =                                                           \
556
51
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
51
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
51
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
51
              &I::lenfunc, &I::conversionfunc,                                 \
560
51
              std::string{NAMEOF(&I::lenfunc)},                                \
561
51
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
51
      c.fuzz(chardata);                                                        \
563
51
    }                                                                          \
conversion.cpp:populate_functions()::$_11::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
119
    +[](std::span<const char> chardata) {                                      \
555
119
      const auto c =                                                           \
556
119
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
119
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
119
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
119
              &I::lenfunc, &I::conversionfunc,                                 \
560
119
              std::string{NAMEOF(&I::lenfunc)},                                \
561
119
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
119
      c.fuzz(chardata);                                                        \
563
119
    }                                                                          \
conversion.cpp:populate_functions()::$_12::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
171
    +[](std::span<const char> chardata) {                                      \
555
171
      const auto c =                                                           \
556
171
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
171
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
171
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
171
              &I::lenfunc, &I::conversionfunc,                                 \
560
171
              std::string{NAMEOF(&I::lenfunc)},                                \
561
171
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
171
      c.fuzz(chardata);                                                        \
563
171
    }                                                                          \
conversion.cpp:populate_functions()::$_13::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()::$_14::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
147
    +[](std::span<const char> chardata) {                                      \
555
147
      const auto c =                                                           \
556
147
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
147
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
147
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
147
              &I::lenfunc, &I::conversionfunc,                                 \
560
147
              std::string{NAMEOF(&I::lenfunc)},                                \
561
147
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
147
      c.fuzz(chardata);                                                        \
563
147
    }                                                                          \
conversion.cpp:populate_functions()::$_15::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
205
    +[](std::span<const char> chardata) {                                      \
555
205
      const auto c =                                                           \
556
205
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
205
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
205
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
205
              &I::lenfunc, &I::conversionfunc,                                 \
560
205
              std::string{NAMEOF(&I::lenfunc)},                                \
561
205
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
205
      c.fuzz(chardata);                                                        \
563
205
    }                                                                          \
conversion.cpp:populate_functions()::$_16::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
89
    +[](std::span<const char> chardata) {                                      \
555
89
      const auto c =                                                           \
556
89
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
89
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
89
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
89
              &I::lenfunc, &I::conversionfunc,                                 \
560
89
              std::string{NAMEOF(&I::lenfunc)},                                \
561
89
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
89
      c.fuzz(chardata);                                                        \
563
89
    }                                                                          \
conversion.cpp:populate_functions()::$_17::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
254
    +[](std::span<const char> chardata) {                                      \
555
254
      const auto c =                                                           \
556
254
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
254
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
254
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
254
              &I::lenfunc, &I::conversionfunc,                                 \
560
254
              std::string{NAMEOF(&I::lenfunc)},                                \
561
254
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
254
      c.fuzz(chardata);                                                        \
563
254
    }                                                                          \
conversion.cpp:populate_functions()::$_18::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()::$_19::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
318
    +[](std::span<const char> chardata) {                                      \
555
318
      const auto c =                                                           \
556
318
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
318
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
318
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
318
              &I::lenfunc, &I::conversionfunc,                                 \
560
318
              std::string{NAMEOF(&I::lenfunc)},                                \
561
318
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
318
      c.fuzz(chardata);                                                        \
563
318
    }                                                                          \
conversion.cpp:populate_functions()::$_20::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
288
    +[](std::span<const char> chardata) {                                      \
555
288
      const auto c =                                                           \
556
288
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
288
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
288
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
288
              &I::lenfunc, &I::conversionfunc,                                 \
560
288
              std::string{NAMEOF(&I::lenfunc)},                                \
561
288
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
288
      c.fuzz(chardata);                                                        \
563
288
    }                                                                          \
conversion.cpp:populate_functions()::$_21::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
379
    +[](std::span<const char> chardata) {                                      \
555
379
      const auto c =                                                           \
556
379
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
379
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
379
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
379
              &I::lenfunc, &I::conversionfunc,                                 \
560
379
              std::string{NAMEOF(&I::lenfunc)},                                \
561
379
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
379
      c.fuzz(chardata);                                                        \
563
379
    }                                                                          \
conversion.cpp:populate_functions()::$_22::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()::$_23::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
379
    +[](std::span<const char> chardata) {                                      \
555
379
      const auto c =                                                           \
556
379
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
379
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
379
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
379
              &I::lenfunc, &I::conversionfunc,                                 \
560
379
              std::string{NAMEOF(&I::lenfunc)},                                \
561
379
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
379
      c.fuzz(chardata);                                                        \
563
379
    }                                                                          \
conversion.cpp:populate_functions()::$_24::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
124
    +[](std::span<const char> chardata) {                                      \
555
124
      const auto c =                                                           \
556
124
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
124
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
124
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
124
              &I::lenfunc, &I::conversionfunc,                                 \
560
124
              std::string{NAMEOF(&I::lenfunc)},                                \
561
124
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
124
      c.fuzz(chardata);                                                        \
563
124
    }                                                                          \
conversion.cpp:populate_functions()::$_25::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
181
    +[](std::span<const char> chardata) {                                      \
555
181
      const auto c =                                                           \
556
181
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
181
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
181
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
181
              &I::lenfunc, &I::conversionfunc,                                 \
560
181
              std::string{NAMEOF(&I::lenfunc)},                                \
561
181
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
181
      c.fuzz(chardata);                                                        \
563
181
    }                                                                          \
conversion.cpp:populate_functions()::$_26::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
358
    +[](std::span<const char> chardata) {                                      \
555
358
      const auto c =                                                           \
556
358
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
358
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
358
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
358
              &I::lenfunc, &I::conversionfunc,                                 \
560
358
              std::string{NAMEOF(&I::lenfunc)},                                \
561
358
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
358
      c.fuzz(chardata);                                                        \
563
358
    }                                                                          \
conversion.cpp:populate_functions()::$_27::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
141
    +[](std::span<const char> chardata) {                                      \
555
141
      const auto c =                                                           \
556
141
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
141
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
141
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
141
              &I::lenfunc, &I::conversionfunc,                                 \
560
141
              std::string{NAMEOF(&I::lenfunc)},                                \
561
141
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
141
      c.fuzz(chardata);                                                        \
563
141
    }                                                                          \
conversion.cpp:populate_functions()::$_28::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()::$_29::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
339
    +[](std::span<const char> chardata) {                                      \
555
339
      const auto c =                                                           \
556
339
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
339
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
339
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
339
              &I::lenfunc, &I::conversionfunc,                                 \
560
339
              std::string{NAMEOF(&I::lenfunc)},                                \
561
339
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
339
      c.fuzz(chardata);                                                        \
563
339
    }                                                                          \
conversion.cpp:populate_functions()::$_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
296
    +[](std::span<const char> chardata) {                                      \
555
296
      const auto c =                                                           \
556
296
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
296
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
296
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
296
              &I::lenfunc, &I::conversionfunc,                                 \
560
296
              std::string{NAMEOF(&I::lenfunc)},                                \
561
296
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
296
      c.fuzz(chardata);                                                        \
563
296
    }                                                                          \
conversion.cpp:populate_functions()::$_32::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
329
    +[](std::span<const char> chardata) {                                      \
555
329
      const auto c =                                                           \
556
329
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
329
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
329
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
329
              &I::lenfunc, &I::conversionfunc,                                 \
560
329
              std::string{NAMEOF(&I::lenfunc)},                                \
561
329
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
329
      c.fuzz(chardata);                                                        \
563
329
    }                                                                          \
conversion.cpp:populate_functions()::$_33::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
446
    +[](std::span<const char> chardata) {                                      \
555
446
      const auto c =                                                           \
556
446
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
446
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
446
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
446
              &I::lenfunc, &I::conversionfunc,                                 \
560
446
              std::string{NAMEOF(&I::lenfunc)},                                \
561
446
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
446
      c.fuzz(chardata);                                                        \
563
446
    }                                                                          \
conversion.cpp:populate_functions()::$_34::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
250
    +[](std::span<const char> chardata) {                                      \
555
250
      const auto c =                                                           \
556
250
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
250
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
250
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
250
              &I::lenfunc, &I::conversionfunc,                                 \
560
250
              std::string{NAMEOF(&I::lenfunc)},                                \
561
250
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
250
      c.fuzz(chardata);                                                        \
563
250
    }                                                                          \
conversion.cpp:populate_functions()::$_35::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
379
    +[](std::span<const char> chardata) {                                      \
555
379
      const auto c =                                                           \
556
379
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
379
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
379
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
379
              &I::lenfunc, &I::conversionfunc,                                 \
560
379
              std::string{NAMEOF(&I::lenfunc)},                                \
561
379
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
379
      c.fuzz(chardata);                                                        \
563
379
    }                                                                          \
conversion.cpp:populate_functions()::$_36::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
284
    +[](std::span<const char> chardata) {                                      \
555
284
      const auto c =                                                           \
556
284
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
284
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
284
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
284
              &I::lenfunc, &I::conversionfunc,                                 \
560
284
              std::string{NAMEOF(&I::lenfunc)},                                \
561
284
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
284
      c.fuzz(chardata);                                                        \
563
284
    }                                                                          \
conversion.cpp:populate_functions()::$_37::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
382
    +[](std::span<const char> chardata) {                                      \
555
382
      const auto c =                                                           \
556
382
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
382
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
382
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
382
              &I::lenfunc, &I::conversionfunc,                                 \
560
382
              std::string{NAMEOF(&I::lenfunc)},                                \
561
382
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
382
      c.fuzz(chardata);                                                        \
563
382
    }                                                                          \
conversion.cpp:populate_functions()::$_38::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
63
    +[](std::span<const char> chardata) {                                      \
555
63
      const auto c =                                                           \
556
63
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
63
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
63
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
63
              &I::lenfunc, &I::conversionfunc,                                 \
560
63
              std::string{NAMEOF(&I::lenfunc)},                                \
561
63
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
63
      c.fuzz(chardata);                                                        \
563
63
    }                                                                          \
conversion.cpp:populate_functions()::$_39::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
50
    +[](std::span<const char> chardata) {                                      \
555
50
      const auto c =                                                           \
556
50
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
50
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
50
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
50
              &I::lenfunc, &I::conversionfunc,                                 \
560
50
              std::string{NAMEOF(&I::lenfunc)},                                \
561
50
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
50
      c.fuzz(chardata);                                                        \
563
50
    }                                                                          \
conversion.cpp:populate_functions()::$_40::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
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()::$_41::operator()(std::__1::span<char const, 18446744073709551615ul>) const
Line
Count
Source
554
307
    +[](std::span<const char> chardata) {                                      \
555
307
      const auto c =                                                           \
556
307
          Conversion<ENCODING_FROM_CONVERSION_NAME(&I::conversionfunc),        \
557
307
                     ENCODING_TO_CONVERSION_NAME(&I::conversionfunc),          \
558
307
                     decltype(&I::lenfunc), decltype(&I::conversionfunc)>{     \
559
307
              &I::lenfunc, &I::conversionfunc,                                 \
560
307
              std::string{NAMEOF(&I::lenfunc)},                                \
561
307
              std::string{NAMEOF(&I::conversionfunc)}};                        \
562
307
      c.fuzz(chardata);                                                        \
563
307
    }                                                                          \
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.08k
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
640
9.08k
  static const auto fptrs = populate_functions();
641
9.08k
  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.08k
  if (size < 4) {
647
3
    return 0;
648
3
  }
649
650
9.08k
  constexpr auto actionmask = std::bit_ceil(Ncases) - 1;
651
9.08k
  const auto action = data[0] & actionmask;
652
9.08k
  data += 4;
653
9.08k
  size -= 4;
654
655
9.08k
  if (action >= Ncases) {
656
1
    return 0;
657
1
  }
658
659
9.07k
  if constexpr (use_separate_allocation) {
660
    // this is better at exercising null input and catch buffer underflows
661
9.07k
    const std::vector<char> separate{data, data + size};
662
9.07k
    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.07k
  return 0;
669
9.08k
}