(f *testing.F)
| 12 | ) |
| 13 | |
| 14 | func FuzzQuery(f *testing.F) { |
| 15 | f.Add([]byte("values f1\x00")) |
| 16 | f.Add([]byte("values f1, f2\x00")) |
| 17 | f.Add([]byte("f1 == null\x00")) |
| 18 | f.Add([]byte("f1 == null | values f2\x00")) |
| 19 | f.Fuzz(func(t *testing.T, b []byte) { |
| 20 | bytesReader := bytes.NewReader(b) |
| 21 | querySource := fuzz.GenAscii(bytesReader) |
| 22 | context := super.NewContext() |
| 23 | types := fuzz.GenTypes(bytesReader, context, 3) |
| 24 | values := fuzz.GenValues(bytesReader, context, types) |
| 25 | |
| 26 | // Debug |
| 27 | //for i := range values { |
| 28 | // t.Logf("value: in[%v].Bytes()=%v", i, values[i].Bytes()) |
| 29 | // t.Logf("value: in[%v]=%v", i, sup.String(&values[i])) |
| 30 | //} |
| 31 | |
| 32 | var bsupBuf bytes.Buffer |
| 33 | fuzz.WriteBSUP(t, values, &bsupBuf) |
| 34 | resultBSUP := fuzz.RunQueryBSUP(t, &bsupBuf, querySource) |
| 35 | |
| 36 | var csupBuf bytes.Buffer |
| 37 | fuzz.WriteCSUP(t, values, &csupBuf) |
| 38 | resultCSUP := fuzz.RunQueryCSUP(t, &csupBuf, querySource) |
| 39 | |
| 40 | fuzz.CompareValues(t, resultBSUP, resultCSUP) |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | const N = 10000000 |
| 45 |
nothing calls this directly
no test coverage detected