Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/test/window.c

    rcde067e r09b01ed0  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    5555static void test_window_pos(ui_window_t *, void *, pos_event_t *);
    5656static void test_window_unfocus(ui_window_t *, void *, unsigned);
    57 static void test_window_resize(ui_window_t *, void *);
    5857
    5958static ui_window_cb_t test_window_cb = {
     
    6766        .paint = test_window_paint,
    6867        .pos = test_window_pos,
    69         .unfocus = test_window_unfocus,
    70         .resize = test_window_resize
     68        .unfocus = test_window_unfocus
    7169};
    7270
     
    10199        bool unfocus;
    102100        unsigned unfocus_nfocus;
    103         bool resize;
    104101} test_cb_resp_t;
    105102
     
    939936}
    940937
    941 /** ui_window_send_resize() calls resize callback set via ui_window_set_cb() */
    942 PCUT_TEST(send_resize)
    943 {
    944         errno_t rc;
    945         ui_t *ui = NULL;
    946         ui_wnd_params_t params;
    947         ui_window_t *window = NULL;
    948         test_cb_resp_t resp;
    949 
    950         rc = ui_create_disp(NULL, &ui);
    951         PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    952 
    953         ui_wnd_params_init(&params);
    954         params.caption = "Hello";
    955 
    956         rc = ui_window_create(ui, &params, &window);
    957         PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    958         PCUT_ASSERT_NOT_NULL(window);
    959 
    960         /* Resize callback with no callbacks set */
    961         ui_window_send_resize(window);
    962 
    963         /* Resize callback with resize callback not implemented */
    964         ui_window_set_cb(window, &dummy_window_cb, NULL);
    965         ui_window_send_resize(window);
    966 
    967         /* Resize callback with real callback set */
    968         resp.close = false;
    969         ui_window_set_cb(window, &test_window_cb, &resp);
    970         ui_window_send_resize(window);
    971         PCUT_ASSERT_TRUE(resp.resize);
    972 
    973         ui_window_destroy(window);
    974         ui_destroy(ui);
    975 }
    976 
    977938static void test_window_sysmenu(ui_window_t *window, void *arg, sysarg_t idev_id)
    978939{
     
    10531014}
    10541015
    1055 static void test_window_resize(ui_window_t *window, void *arg)
    1056 {
    1057         test_cb_resp_t *resp = (test_cb_resp_t *) arg;
    1058 
    1059         resp->resize = true;
    1060 }
    1061 
    10621016static errno_t test_ctl_paint(void *arg)
    10631017{
Note: See TracChangeset for help on using the changeset viewer.