Skip to content

Commit

Permalink
fixup! SFT-2271: Use foundation-rs crates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandudey committed Jul 17, 2023
1 parent 4afb758 commit 6bc2da0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions extmod/foundation-rust/src/ur/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ pub mod registry;
pub mod tests {
use super::*;

use crate::ur::decoder::UR_DECODER_MAX_FRAGMENT_LEN;
use crate::ur::encoder::{
UR_ENCODER_MAX_FRAGMENT_LEN, UR_ENCODER_MIN_FRAGMENT_LEN,
};

#[test]
fn sanity_test() {
const fn is_power_of_2(x: usize) -> bool {
Expand All @@ -89,7 +94,10 @@ pub mod tests {

assert!(is_power_of_2(decoder::UR_DECODER_MAX_SEQUENCE_COUNT));
assert!(is_power_of_2(encoder::UR_ENCODER_MAX_SEQUENCE_COUNT));
assert!(max_fragment_len(decoder::UR_DECODER_MAX_STRING) > 0);
assert!(max_fragment_len(encoder::UR_ENCODER_MAX_STRING) > 0);

assert_ne!(UR_DECODER_MAX_FRAGMENT_LEN, 0);

assert_ne!(UR_ENCODER_MIN_FRAGMENT_LEN, 0);
assert_ne!(UR_ENCODER_MAX_FRAGMENT_LEN, 0);
}
}

0 comments on commit 6bc2da0

Please sign in to comment.