Coverage Report

Created: 2025-11-24 06:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/glaze/fuzzing/json_prettify.cpp
Line
Count
Source
1
#include <cstddef>
2
#include <cstdint>
3
#include <glaze/glaze.hpp>
4
#include <vector>
5
6
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
7
11.7k
{
8
   // use a vector with null termination instead of a std::string to avoid
9
   // small string optimization to hide bounds problems
10
11.7k
   std::vector<char> buffer{Data, Data + Size};
11
12
   // non-null terminated
13
11.7k
   {
14
11.7k
      const auto& input = buffer;
15
11.7k
      [[maybe_unused]] auto beautiful = glz::prettify_json(input);
16
11.7k
   }
17
18
   // null terminated
19
11.7k
   {
20
11.7k
      buffer.push_back('\0');
21
11.7k
      const auto& input = buffer;
22
11.7k
      [[maybe_unused]] auto beautiful = glz::prettify_json(input);
23
11.7k
   }
24
25
11.7k
   return 0;
26
11.7k
}