Skip to content

Commit

Permalink
WIP: Add testcases to show implementation weakness
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh3Rm4n committed Dec 21, 2020
1 parent 4909e34 commit 378c19a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions firmware/qemu/src/bin/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,23 @@ fn main() -> ! {
}

let bytes: &[u8; 2] = b"Hi";
let bytes_u16: &[u16; 2] = &[0xAF_FE, 0xC0_FE];

defmt::info!("{=[u8]:a}", *bytes);
defmt::info!("{=[?]:a}", *bytes);
defmt::info!("{:a}", *bytes);
defmt::info!("{=[?]:a}", *bytes_u16);

{
#[derive(Format)]
struct Data<'a> {
name: &'a [u8],
value: bool,
}

let data = &[Data { name: b"Hi", value: true }];
defmt::info!("{=[?]:a}", *data)
}

defmt::info!("QEMU test finished!");

Expand Down

0 comments on commit 378c19a

Please sign in to comment.