Verifies: SYS-REQ-007 [fuzz] MCDC SYS-REQ-007: N/A
(t *testing.T)
| 72 | // Verifies: SYS-REQ-007 [fuzz] |
| 73 | // MCDC SYS-REQ-007: N/A |
| 74 | func TestFuzzObjectEachHarnessCoverage(t *testing.T) { |
| 75 | // FuzzObjectEach calls ObjectEach with a no-op callback and returns 1. |
| 76 | // Exercise it with various inputs covering both branches. |
| 77 | |
| 78 | // Case 1: well-formed JSON object with entries |
| 79 | data := []byte(`{"key1":"value1","key2":42}`) |
| 80 | if got := FuzzObjectEach(data); got != 1 { |
| 81 | t.Fatalf("FuzzObjectEach with valid object = %d, want 1", got) |
| 82 | } |
| 83 | |
| 84 | // Case 2: empty JSON object -- ObjectEach returns nil immediately |
| 85 | if got := FuzzObjectEach([]byte(`{}`)); got != 1 { |
| 86 | t.Fatalf("FuzzObjectEach with empty object = %d, want 1", got) |
| 87 | } |
| 88 | |
| 89 | // Case 3: malformed input -- ObjectEach returns an error, but |
| 90 | // the fuzz harness ignores the return value of ObjectEach |
| 91 | if got := FuzzObjectEach([]byte(`not json`)); got != 1 { |
| 92 | t.Fatalf("FuzzObjectEach with malformed input = %d, want 1", got) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // ============================================================================= |
| 97 | // MC/DC witness row closure for SYS-REQ-010 |
nothing calls this directly
no test coverage detected
searching dependent graphs…