From 12bc5560fce41890d54f2422b21bc0806965a392 Mon Sep 17 00:00:00 2001 From: Lukas Bielesch Date: Thu, 27 Feb 2025 11:39:33 +0100 Subject: [PATCH] core(eckhart): Fix failing unit test and warnings --- core/embed/rust/src/ui/layout_eckhart/component/hint.rs | 3 +-- .../src/ui/layout_eckhart/component/keyboard/keypad.rs | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/embed/rust/src/ui/layout_eckhart/component/hint.rs b/core/embed/rust/src/ui/layout_eckhart/component/hint.rs index 9bcab497f0..fc56158c1f 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/hint.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/hint.rs @@ -338,8 +338,7 @@ impl<'a> crate::trace::Trace for Hint<'a> { #[cfg(test)] mod tests { - use super::{super::constant, *}; - use crate::strutil::TString; + use super::*; #[test] fn test_instruction_hint_height() { diff --git a/core/embed/rust/src/ui/layout_eckhart/component/keyboard/keypad.rs b/core/embed/rust/src/ui/layout_eckhart/component/keyboard/keypad.rs index 86642e75db..81860bd9ee 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/keyboard/keypad.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/keyboard/keypad.rs @@ -502,7 +502,10 @@ impl KeypadGrid { mod tests { use super::{ - super::{super::constant::SCREEN, common::INPUT_TOUCH_HEIGHT}, + super::{ + super::constant::SCREEN, + common::{INPUT_TOUCH_HEIGHT, KEYPAD_VISIBLE_HEIGHT}, + }, *, }; @@ -516,8 +519,7 @@ mod tests { assert_eq!( (ROWS as i16) * KeypadGrid::BUTTON_HEIGHT, - KeypadGrid::KEYPAD_TOUCH_HEIGHT - + (ROWS as i16 - 1) * KeypadGrid::VERTICAL_BUTTON_SPACING, + KEYPAD_VISIBLE_HEIGHT + (ROWS as i16 - 1) * KeypadGrid::VERTICAL_BUTTON_SPACING, "Keypad height does not match expected layout constraints" );