Chromium Code Reviews| Index: fuzz/fuzz.cpp |
| diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp |
| index 40f48175e274141dd81ccf3bd4d403db388c3ec8..8617dfe7b1a3e3cb3ee935fe564cfff8fd079036 100644 |
| --- a/fuzz/fuzz.cpp |
| +++ b/fuzz/fuzz.cpp |
| @@ -378,8 +378,8 @@ int fuzz_skp(SkData* bytes) { |
| Fuzz::Fuzz(SkData* bytes) : fBytes(SkSafeRef(bytes)), fNextByte(0) {} |
| -void Fuzz::signalBug () { raise(SIGSEGV); } |
| -void Fuzz::signalBoring() { exit(0); } |
| +void Fuzz::signalBug () { SkDebugf("Signal bug\n"); raise(SIGSEGV); } |
| +void Fuzz::signalBoring() { SkDebugf("Signal boring\n"); exit(0); } |
| template <typename T> |
| T Fuzz::nextT() { |
| @@ -398,6 +398,11 @@ bool Fuzz::nextBool() { return nextB()&1; } |
| uint32_t Fuzz::nextU() { return this->nextT<uint32_t>(); } |
| float Fuzz::nextF() { return this->nextT<float >(); } |
| +float Fuzz::nextF1() { |
| + unsigned int floatint = 0x3f800000 | (this->nextU() >> 9); |
|
jcgregorio
2016/04/05 19:31:14
Maybe just me, but I think this deserves a comment
kjlubick
2016/04/05 19:34:49
Done. I just copy-pasted it from SkRandom
|
| + float f = SkBits2Float(floatint) - 1.0f; |
| + return f; |
| +} |
| uint32_t Fuzz::nextRangeU(uint32_t min, uint32_t max) { |
| if (min > max) { |