add some manual test cases that run in hosted mode for pddb

these are helpful for debugging "real" use cases, instead of
the synthetic CI benches that don't fully exercise the file-like
API.
This commit is contained in:
bunnie 2022-03-29 01:49:47 +08:00
parent 55b05cfd80
commit 5f6a21bff1

View file

@ -170,15 +170,18 @@ impl<'a> ShellCmdApi<'a> for PddbCmd {
// note that this feature only works in hosted mode
#[cfg(feature="pddbtest")]
"test" => {
// zero-length key test
let mut test_handle = pddb::Pddb::new();
let test_key = test_handle.get(
// build a key, but don't write to it.
let _ = test_handle.get(
"test",
"zerolength",
None, true, true,
Some(8),
None::<fn()>
).expect("couldn't build empty key");
// test_handle.sync().expect("couldn't sync");
self.pddb.sync().unwrap();
self.pddb.dbg_remount().unwrap();
self.pddb.dbg_dump("std_test1").unwrap();
write!(ret, "dumped std_test1").unwrap();
}