Created
January 2, 2019 06:37
-
-
Save fuzz-ai/f053f0be7c38715c6f9c32735d1409bf to your computer and use it in GitHub Desktop.
fuzzed version of testStress()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while (!std::cin.eof() ) | |
| { | |
| // pick a random ledger history | |
| std::string curr = ""; | |
| char depth = getBits( maxDepth ); | |
| char offset = 0; | |
| for(char d = 0; d < depth; ++d) | |
| { | |
| char a = offset + getBits( maxWidth ); | |
| curr += a; | |
| offset = (a + 1) * maxWidth; | |
| } | |
| // 50-50 to add remove | |
| if(getBits(2) == 0) | |
| t.insert(h[curr]); | |
| else | |
| t.remove(h[curr]); | |
| assert( t.checkInvariants() ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment