From 95fd6ae836ab5fee7387f4df46b727165a05b723 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 25 Jun 2026 04:42:23 +0200 Subject: Adds v1 unit tests and fixes bugs found by them --- ui/curses/ui.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ui/curses/ui.c') diff --git a/ui/curses/ui.c b/ui/curses/ui.c index 9d253a3..ace7bf9 100644 --- a/ui/curses/ui.c +++ b/ui/curses/ui.c @@ -255,7 +255,10 @@ void gfx_render_mbst(const struct Core *core, uint64_t pos, uint64_t zoom) { uint64_t mb1a = arch_proc_mb1_addr(core, pix); gfx_accumulate_pixel(pos, zoom, mb0a, g_gfx_mbst); - gfx_accumulate_pixel(pos, zoom, mb1a, g_gfx_mbst); + + if (arch_proc_mb1_size(core, pix)) { + gfx_accumulate_pixel(pos, zoom, mb1a, g_gfx_mbst); + } } } @@ -418,12 +421,6 @@ void tui_uld_field(int l, const char *label, uint64_t value) { tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %#18ld", label, value); } -void tui_float_field(int l, const char *label, float value) { - assert(label); - assert(strlen(label) <= 4); - tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %18.1f", label, value); -} - void tui_print_core(int l) { tui_line(false, ++l, PAIR_HEADER, A_BOLD, "CORE [%d]", g_core); tui_ulx_field(++l, "cycl", g_cores[g_core].cycl); @@ -928,7 +925,7 @@ void tui_print(void) { tui_ulx_field(l++, "step", g_steps); tui_ulx_field(l++, "sync", g_syncs); tui_ulx_field(l++, "step", g_step_block); - tui_float_field(l++, "stps", g_steps_per_sec); + tui_ulx_field(l++, "stps", (uint64_t)g_steps_per_sec); switch (g_page) { case PAGE_CORE: -- cgit v1.2.1