Skip to content

Commit 55ba772

Browse files
fix qed bot fuzz coverage issue
1 parent d1c5f1b commit 55ba772

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

storage/fuzz/fuzz_targets/ordered_index_operations.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,15 @@ fn fuzz(input: FuzzInput) {
162162
}
163163

164164
IndexOperation::CursorInsert { key, value } => {
165-
// Just use regular insert - simpler and avoids borrow issues
166-
index.insert(key, *value);
165+
if index.get(key).next().is_some() {
166+
let mut cursor = index.get_mut(key).unwrap();
167+
if cursor.next().is_some() {
168+
cursor.insert(*value);
169+
let _ = cursor.next();
170+
}
171+
} else {
172+
index.insert(key, *value);
173+
}
167174
}
168175
}
169176
}

storage/fuzz/fuzz_targets/unordered_index_operations.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,15 @@ fn fuzz(input: FuzzInput) {
162162
}
163163

164164
IndexOperation::CursorInsert { key, value } => {
165-
// Just use regular insert - simpler and avoids borrow issues
166-
index.insert(key, *value);
165+
if index.get(key).next().is_some() {
166+
let mut cursor = index.get_mut(key).unwrap();
167+
if cursor.next().is_some() {
168+
cursor.insert(*value);
169+
let _ = cursor.next();
170+
}
171+
} else {
172+
index.insert(key, *value);
173+
}
167174
}
168175
}
169176
}

0 commit comments

Comments
 (0)