Changeset fe5c7a1 in mainline for uspace/app/nav/test/nav.c


Ignore:
Timestamp:
2021-10-14T10:41:07Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
03c4b23
Parents:
b9d689b
git-author:
Jiri Svoboda <jiri@…> (2021-10-13 18:40:48)
git-committer:
Jiri Svoboda <jiri@…> (2021-10-14 10:41:07)
Message:

Panel activation

Active panel can be switched using the Tab key. Mouse activation is
not implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/test/nav.c

    rb9d689b rfe5c7a1  
    4747}
    4848
     49/** navigator_get_active_panel() returns the active panel */
     50PCUT_TEST(get_active_panel)
     51{
     52        navigator_t *nav;
     53        panel_t *panel;
     54        errno_t rc;
     55
     56        rc = navigator_create(UI_DISPLAY_NULL, &nav);
     57        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     58
     59        /* First panel should be active at the beginning */
     60        panel = navigator_get_active_panel(nav);
     61        PCUT_ASSERT_EQUALS(nav->panel[0], panel);
     62
     63        navigator_destroy(nav);
     64}
     65
     66/** navigator_switch_panel() switches to a different panel */
     67PCUT_TEST(switch_panel)
     68{
     69        navigator_t *nav;
     70        panel_t *panel;
     71        errno_t rc;
     72
     73        rc = navigator_create(UI_DISPLAY_NULL, &nav);
     74        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     75
     76        /* First panel should be active at the beginning */
     77        panel = navigator_get_active_panel(nav);
     78        PCUT_ASSERT_EQUALS(nav->panel[0], panel);
     79
     80        navigator_switch_panel(nav);
     81
     82        /* Second panel should be active now */
     83        panel = navigator_get_active_panel(nav);
     84        PCUT_ASSERT_EQUALS(nav->panel[1], panel);
     85
     86        navigator_switch_panel(nav);
     87
     88        /* First panel should be active again */
     89        panel = navigator_get_active_panel(nav);
     90        PCUT_ASSERT_EQUALS(nav->panel[0], panel);
     91
     92        navigator_destroy(nav);
     93}
     94
    4995PCUT_EXPORT(nav);
Note: See TracChangeset for help on using the changeset viewer.