MCPcopy Create free account
hub / github.com/facebook/time / TestPrepareExpressionMalformedInput

Function TestPrepareExpressionMalformedInput

fbclock/daemon/math_test.go:129–141  ·  view source on GitHub ↗

TestPrepareExpressionMalformedInput reproduces OSS-Fuzz issue 471488972.

(t *testing.T)

Source from the content-addressed store, hash-verified

127
128// TestPrepareExpressionMalformedInput reproduces OSS-Fuzz issue 471488972.
129func TestPrepareExpressionMalformedInput(t *testing.T) {
130 inputs := []string{
131 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
132 "[[[[[[[[[[[",
133 string([]byte{0xff, 0xfe, 0xfd}),
134 "",
135 }
136 for _, input := range inputs {
137 require.NotPanics(t, func() {
138 _, _ = prepareExpression(input)
139 })
140 }
141}
142
143func FuzzPrepareExpression(f *testing.F) {
144 f.Add("mean(clockaccuracy, 5) + abs(mean(offset, 5)) + 1.0 * stddev(offset, 4) + 1.0 * stddev(delay, 4) + 1.0 * stddev(freq, 5)")

Callers

nothing calls this directly

Calls 1

prepareExpressionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…