aboutsummaryrefslogtreecommitdiffhomepage
path: root/fuzz/Fuzz.h
diff options
context:
space:
mode:
authorGravatar kjlubick <kjlubick@google.com>2016-02-18 06:27:38 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-18 06:27:39 -0800
commit5bd98a244bb1ab1b3cad945e2fa1ce3dfd62d8cf (patch)
treea00629eab90a2698fb7d9d3bbba64ab7773d0038 /fuzz/Fuzz.h
parenta7b16858d51b5d9b7981087cadb1ff764632bf14 (diff)
Create ParsePath API fuzz
Diffstat (limited to 'fuzz/Fuzz.h')
-rw-r--r--fuzz/Fuzz.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fuzz/Fuzz.h b/fuzz/Fuzz.h
index 0f34ef4b3e..26a8d429b3 100644
--- a/fuzz/Fuzz.h
+++ b/fuzz/Fuzz.h
@@ -16,10 +16,20 @@ class Fuzz : SkNoncopyable {
public:
explicit Fuzz(SkData*);
+ bool nextBool();
uint8_t nextB();
uint32_t nextU();
+ // This can be nan, +- infinity, 0, anything.
float nextF();
+ // Return the next fuzzed value [min, max) as an unsigned 32bit integer.
+ uint32_t nextRangeU(uint32_t min, uint32_t max);
+ /**
+ * Returns next fuzzed value [min...max) as a float.
+ * Will not be Infinity or NaN.
+ */
+ float nextRangeF(float min, float max);
+
void signalBug (); // Tell afl-fuzz these inputs found a bug.
void signalBoring(); // Tell afl-fuzz these inputs are not worth testing.