From 5f6a21bff1940e928971b64ac51c73a87996af80 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 29 Mar 2022 01:49:47 +0800 Subject: [PATCH] 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. --- services/shellchat/src/cmds/pddb_cmd.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/shellchat/src/cmds/pddb_cmd.rs b/services/shellchat/src/cmds/pddb_cmd.rs index d89b92377..bb810796f 100644 --- a/services/shellchat/src/cmds/pddb_cmd.rs +++ b/services/shellchat/src/cmds/pddb_cmd.rs @@ -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:: ).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(); }