Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: fuzz/FuzzPaeth.cpp

Issue 1711753002: Remove FuzzPaeth now that we have some real Fuzzes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzz/FuzzPaeth.cpp
diff --git a/fuzz/FuzzPaeth.cpp b/fuzz/FuzzPaeth.cpp
deleted file mode 100644
index dee9ee99143d30dd48d22c2c67198c7bc93c0836..0000000000000000000000000000000000000000
--- a/fuzz/FuzzPaeth.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2016 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 <stdlib.h>
-
-// This really is just an example Fuzz*.cpp file.
-// It tests that two different ways of calculating the Paeth predictor function are equivalent.
-
-static uint8_t paeth_std(uint8_t a, uint8_t b, uint8_t c) {
- int p = a+b-c;
-
- int pa = abs(p-a),
- pb = abs(p-b),
- pc = abs(p-c);
-
- if (pb < pa) { pa = pb; a = b; }
- if (pc < pa) { a = c; }
- return a;
-}
-
-static uint8_t paeth_alt(uint8_t a, uint8_t b, uint8_t c) {
- int min = SkTMin(a,b),
- max = SkTMax(a,b);
- int delta = (max-min)/3;
-
- if (c <= min+delta) return max;
- if (c >= max-delta) return min;
- return c;
-}
-
-DEF_FUZZ(Paeth, fuzz) {
- auto a = fuzz->nextB(),
- b = fuzz->nextB(),
- c = fuzz->nextB();
- SkDebugf("Paeth(%d,%d,%d)\n", a,b,c);
-
- if (a == b && b == c) {
- fuzz->signalBoring(); // Not really boring, just demoing signalBoring().
- }
-
- if (paeth_alt(a,b,c) != paeth_std(a,b,c)) {
- fuzz->signalBug();
- }
-}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698