Set up fuzz infrastructure

This commit is contained in:
Arthur Carcano
2026-04-28 15:46:17 +02:00
committed by Alex
parent 0a5282d918
commit ade4d07bb5
8 changed files with 78 additions and 0 deletions
+2
View File
@@ -21,6 +21,7 @@ garage_block.workspace = true
garage_util.workspace = true
garage_net.workspace = true
arbitrary = { optional = true, workspace = true }
argon2.workspace = true
async-trait.workspace = true
blake2.workspace = true
@@ -46,6 +47,7 @@ k2v = ["garage_util/k2v"]
lmdb = ["garage_db/lmdb"]
sqlite = ["garage_db/sqlite"]
fjall = ["garage_db/fjall"]
arbitrary = ["dep:arbitrary","garage_util/arbitrary"]
[lints]
workspace = true
+2
View File
@@ -17,6 +17,7 @@ path = "lib.rs"
garage_db.workspace = true
garage_net.workspace = true
arbitrary = { optional = true, workspace = true }
arc-swap.workspace = true
async-trait.workspace = true
blake2.workspace = true
@@ -52,6 +53,7 @@ mktemp.workspace = true
[features]
k2v = []
arbitrary = ["dep:arbitrary"]
[lints]
workspace = true
+5
View File
@@ -84,6 +84,11 @@ where
self.v = new_value;
}
pub fn update2(&mut self, f: impl FnOnce(&mut T), time: u64) {
self.ts = std::cmp::max(self.ts + 1, time);
f(&mut self.v)
}
/// Get the timestamp currently associated with the value
pub fn timestamp(&self) -> u64 {
self.ts
+1
View File
@@ -6,6 +6,7 @@ use std::fmt;
/// An array of 32 bytes
#[derive(Default, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Copy)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub struct FixedBytes32([u8; 32]);
impl From<[u8; 32]> for FixedBytes32 {