conversion toward standard testing method

This commit is contained in:
bunnie 2022-04-22 15:10:51 +08:00
parent d06c6dcb32
commit bac6c25bfe
2 changed files with 10 additions and 14 deletions

View file

@ -34,6 +34,16 @@ pub(crate) fn spawn_test() {
let modals = modals::Modals::new(&xns).unwrap();
let tt = ticktimer_server::Ticktimer::new().unwrap();
// 0. multi-modal test
log::info!("modal data: {:#?}",
modals.alert_builder("Four items with maybe defaults. Press select to close.")
.field(Some("first".to_string()), None)
.field(Some("second".to_string()), None)
.field(None, None)
.field(Some("fourth".to_string()), None)
.build()
);
// 1. test progress bar
// The start and end items are deliberately structured to be not zero-indexed; the use of PDDB_LOC is just a
// convenient global constant.

View file

@ -5,25 +5,11 @@ use xous_ipc::String;
pub struct Ver {
}
// TODO: remove me
impl Ver {
fn modal(&self, env: &mut CommonEnv) {
log::info!("modal data: {:#?}",
env.modals.alert_builder("Get Text")
.field(Some("first".to_string()), None)
.field(Some("second".to_string()), None)
.field(None, None)
.field(Some("fourth".to_string()), None)
.build()
);
}
}
impl<'a> ShellCmdApi<'a> for Ver {
cmd_api!(ver); // inserts boilerplate for command API
fn process(&mut self, args: String::<1024>, env: &mut CommonEnv) -> Result<Option<String::<1024>>, xous::Error> {
self.modal(env);
use core::fmt::Write;
let mut ret = String::<1024>::new();
let helpstring = "ver options: ec, wf200, soc, dna, xous";