MCPcopy Create free account
hub / github.com/buger/jsonparser / runOpNoPanic

Function runOpNoPanic

json_fuzz_test.go:1420–1429  ·  view source on GitHub ↗

runOpNoPanic runs fn and fails the test on panic (the NO-PANIC gate). The panic value and stack are included in the failure message so the fuzz engine's minimizing reproducer carries full diagnostic context.

(t *testing.T, opName string, data []byte, path []string, fn func())

Source from the content-addressed store, hash-verified

1418// The panic value and stack are included in the failure message so the
1419// fuzz engine's minimizing reproducer carries full diagnostic context.
1420func runOpNoPanic(t *testing.T, opName string, data []byte, path []string, fn func()) {
1421 t.Helper()
1422 defer func() {
1423 if r := recover(); r != nil {
1424 t.Errorf("PANIC in %s (NO-PANIC violation): %v\n%s\ndata=%q path=%v",
1425 opName, r, debug.Stack(), data, path)
1426 }
1427 }()
1428 fn()
1429}
1430
1431// checkNumericOracle cross-checks jsonparser's ParseInt/ParseFloat against
1432// the strconv reference (the NUMERIC-ORACLE gate). strconv is the reference

Callers 1

runStructureAwareGatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected