Helper to generate random string
| 1887 | |
| 1888 | // Helper to generate random string |
| 1889 | static std::string random_string(std::mt19937 & rng, size_t max_len) { |
| 1890 | static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; |
| 1891 | std::uniform_int_distribution<size_t> len_dist(0, max_len); |
| 1892 | std::uniform_int_distribution<size_t> char_dist(0, sizeof(charset) - 2); |
| 1893 | size_t len = len_dist(rng); |
| 1894 | std::string result; |
| 1895 | result.reserve(len); |
| 1896 | for (size_t i = 0; i < len; ++i) { |
| 1897 | result += charset[char_dist(rng)]; |
| 1898 | } |
| 1899 | return result; |
| 1900 | } |
| 1901 | |
| 1902 | // Helper to execute a fuzz test case - returns true if no crash occurred |
| 1903 | static bool fuzz_test_template(const std::string & tmpl, const json & vars) { |