From 5bd98a244bb1ab1b3cad945e2fa1ce3dfd62d8cf Mon Sep 17 00:00:00 2001 From: kjlubick Date: Thu, 18 Feb 2016 06:27:38 -0800 Subject: Create ParsePath API fuzz This is based on https://codereview.chromium.org/1675053002 BUG=skia:4438 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1702383003 Review URL: https://codereview.chromium.org/1702383003 --- fuzz/Fuzz.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fuzz/Fuzz.h') 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. -- cgit v1.2.3