MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / fuzzJSONStructure

Function fuzzJSONStructure

src/Storages/StorageFuzzJSON.cpp:306–310  ·  view source on GitHub ↗

Randomly modify structural characters (e.g. '{', '}', '[', ']', ':', '"') to generate output that cannot be parsed as JSON.

Source from the content-addressed store, hash-verified

304
305// Randomly modify structural characters (e.g. '{', '}', '[', ']', ':', '"') to generate output that cannot be parsed as JSON.
306String fuzzJSONStructure(const StorageFuzzJSON::Configuration & config, pcg64 & rnd, const String & s)
307{
308 return config.should_malform_output ? fuzzString(/*min_length*/ 0, /*max_length*/ s.size(), rnd, s, generateRandomStringValueCharacter)
309 : s;
310}
311
312std::shared_ptr<JSONNode>
313generateRandomJSONNode(const StorageFuzzJSON::Configuration & config, pcg64 & rnd, bool with_key, JSONValue::Type type)

Callers 1

fuzzJSONObjectFunction · 0.85

Calls 2

fuzzStringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected