Skip to content

Commit

Permalink
fixup! fixup! feat: DPI awareness
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Sep 10, 2024
1 parent ce24f86 commit 4c4cd71
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/cases/test_mainloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@

static void handle_refresh(void *arg)
{
logger_error("OnRefreshScreen\n");
ui_refresh_style();
}

static void handle_quit(void *arg)
{
logger_error("OnQuit\n");
lcui_quit();
}

static void handle_btn_click(ui_widget_t* w, ui_event_t* ui_event, void *arg)
{
logger_error("handle_btn_click\n");
lcui_set_timeout(0, handle_refresh, NULL);
lcui_set_timeout(1, handle_quit, NULL);
lcui_process_events(APP_PROCESS_EVENTS_UNTIL_QUIT);
Expand All @@ -45,18 +42,17 @@ static void handle_trigger_btn_click(void *arg)
app_post_event(&e);
e.type = APP_EVENT_MOUSEUP;
app_post_event(&e);
logger_error("handle_trigger_btn_click\n");
}

static void observer_thread(void *arg)
{
int i;
bool *exited = arg;

for (i = 0; i < 1000 && !*exited; ++i) {
for (i = 0; i < 100 && !*exited; ++i) {
sleep_ms(1);
}
ctest_equal_bool("main loop should exit within 1000ms", *exited, true);
ctest_equal_bool("main loop should exit within 100ms", *exited, true);
if (!*exited) {
exit(-ctest_finish());
return;
Expand Down

0 comments on commit 4c4cd71

Please sign in to comment.