Add basic debug printing

This commit is contained in:
2024-05-16 21:41:18 -07:00
parent 2bc827f767
commit ba9db0ddae

View File

@@ -39,6 +39,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
switch (gArbitrary.bounded(3)) {
case 0: {
// Add mutations
#if DEBUG
printf("Add mutations\n");
#endif
const int numKeys = gArbitrary.bounded(10);
std::set<weaselab::VersionedMap::Key, KeyComp> keySet;
@@ -81,6 +84,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
} break;
case 1: {
// Set oldest version
#if DEBUG
printf("Set oldest version\n");
#endif
const int64_t newOldestVersion =
facade.getOldestVersion() +
@@ -93,6 +99,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
case 2: {
// Check range read
#if DEBUG
printf("Check range read\n");
#endif
const int64_t version = facade.getOldestVersion() +
gArbitrary.bounded(facade.getVersion() -
facade.getOldestVersion() + 1);