diff options
author | Hal Canary <halcanary@google.com> | 2018-04-06 10:25:12 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-06 16:37:23 +0000 |
commit | 13872ddc56c4ab128569428b3ea8c722e7494df5 (patch) | |
tree | 9cc10636ced3893c720ebc08ef8b600a06bd34f2 /fuzz/FuzzRegionOp.cpp | |
parent | 4c2393493ad6d5f72eecd1190fee20cce732b959 (diff) |
Region Op Fuzzer
Also: assert Region IRects don't contain Sentinel value.
Also: Region fuzzer can't produce Sentinel value.
Change-Id: Ia33c7eeb9ef2c46b3da4a025d85de8a0406c3c0c
Reviewed-on: https://skia-review.googlesource.com/119011
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'fuzz/FuzzRegionOp.cpp')
-rw-r--r-- | fuzz/FuzzRegionOp.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fuzz/FuzzRegionOp.cpp b/fuzz/FuzzRegionOp.cpp new file mode 100644 index 0000000000..7f8bbbefba --- /dev/null +++ b/fuzz/FuzzRegionOp.cpp @@ -0,0 +1,18 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "Fuzz.h" +#include "FuzzCommon.h" + +DEF_FUZZ(RegionOp, fuzz) { // `fuzz -t api -n RegionOp` + SkRegion regionA, regionB, regionC; + fuzz_region(fuzz, ®ionA, 2000); + fuzz_region(fuzz, ®ionB, 2000); + SkRegion::Op op; + fuzz_enum_range(fuzz, &op, (SkRegion::Op)0, SkRegion::kLastOp); + regionC.op(regionA, regionB, op); +} |