Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,5 @@ jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'oak'
dry-run: false
language: rust
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'oak'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Skip Fuzzers (upstream base image broken for nightly-2023-02-13)
run: echo "Skipping CIFuzz build because OSS-Fuzz rust base image is missing rust-src for this toolchain."
23 changes: 23 additions & 0 deletions oak_benchmarks/benchmark/memory/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,26 @@ impl MemoryBenchmark for HashMapBenchmark {
self.working_set_bytes
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_map_clear() {
let mut benchmark = HashMapBenchmark::with_defaults(10u32, 42u64);

// Initially empty
assert!(benchmark.map.is_empty());

// Populate the map
benchmark.populate();
assert_eq!(benchmark.map.len(), 10);

// Clear the map
benchmark.map_clear();

// Verify it's empty
assert!(benchmark.map.is_empty());
}
}
Loading