mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-18 09:23:13 +00:00
Set up fuzz infrastructure
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user