--------------------------------------------------------------------------- Property: every public surface is panic-free on random bytes (universal) --------------------------------------------------------------------------- This is the universal OSS-Fuzz invariant asserted across the entire parser
(t *testing.T)
| 899 | // reqproof:proptest Get |
| 900 | // Verifies: SYS-REQ-035 [property] |
| 901 | func TestPropertyNoPanicOnArbitraryBytes(t *testing.T) { |
| 902 | r := newRNG(jsonSeed + 15) |
| 903 | const iterations = 3000 |
| 904 | for i := 0; i < iterations; i++ { |
| 905 | raw := randomBytes(r, 64) |
| 906 | keys := []string{randKey(r)} |
| 907 | _ = recoverNoPanic(func() { _, _, _, _ = Get(raw, keys...) }) |
| 908 | _ = recoverNoPanic(func() { _, _, _, _ = Get(raw) }) |
| 909 | _ = recoverNoPanic(func() { _, _ = GetString(raw, keys...) }) |
| 910 | _ = recoverNoPanic(func() { _, _ = GetInt(raw, keys...) }) |
| 911 | _ = recoverNoPanic(func() { _, _ = GetFloat(raw, keys...) }) |
| 912 | _ = recoverNoPanic(func() { _, _ = GetBoolean(raw, keys...) }) |
| 913 | _ = recoverNoPanic(func() { _, _ = GetUnsafeString(raw, keys...) }) |
| 914 | _ = recoverNoPanic(func() { |
| 915 | ArrayEach(raw, func(value []byte, dataType ValueType, offset int, err error) {}) |
| 916 | }) |
| 917 | _ = recoverNoPanic(func() { |
| 918 | ObjectEach(raw, func(key, value []byte, dataType ValueType, offset int) error { return nil }) |
| 919 | }) |
| 920 | _ = recoverNoPanic(func() { |
| 921 | EachKey(raw, func(idx int, value []byte, vt ValueType, err error) {}, keys) |
| 922 | }) |
| 923 | _ = recoverNoPanic(func() { _ = Delete(raw, keys...) }) |
| 924 | _ = recoverNoPanic(func() { _, _ = Set(raw, []byte(`"x"`), keys...) }) |
| 925 | _ = recoverNoPanic(func() { _, _ = ParseInt(raw) }) |
| 926 | _ = recoverNoPanic(func() { _, _ = ParseFloat(raw) }) |
| 927 | _ = recoverNoPanic(func() { _, _ = ParseBoolean(raw) }) |
| 928 | _ = recoverNoPanic(func() { _, _ = ParseString(raw) }) |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | // --------------------------------------------------------------------------- |
| 933 | // Property: thread-safety — concurrent reads are panic-free and deterministic |
nothing calls this directly
no test coverage detected