Changeset 806d761 in mainline for uspace/lib/ui/test/checkbox.c


Ignore:
Timestamp:
2024-02-07T23:44:59Z (6 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
242e3c3
Parents:
74cb6610
Message:

Start menu should have 'open in terminal' functionality

Makes it easier for the user and if we are running in console mode,
we correctly start the application, instead of failing to start a
terminal.

File:
1 edited

Legend:

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

    r74cb6610 r806d761  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    151151}
    152152
     153/** Get check box checked returns internal field */
     154PCUT_TEST(get_checked)
     155{
     156        ui_checkbox_t *checkbox;
     157        errno_t rc;
     158
     159        rc = ui_checkbox_create(NULL, "Hello", &checkbox);
     160        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     161
     162        checkbox->checked = false;
     163        PCUT_ASSERT_FALSE(ui_checkbox_get_checked(checkbox));
     164        checkbox->checked = true;
     165        PCUT_ASSERT_TRUE(ui_checkbox_get_checked(checkbox));
     166
     167        ui_checkbox_destroy(checkbox);
     168}
     169
     170/** Set check box checked sets internal field */
     171PCUT_TEST(set_checked)
     172{
     173        ui_checkbox_t *checkbox;
     174        errno_t rc;
     175
     176        rc = ui_checkbox_create(NULL, "Hello", &checkbox);
     177        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     178
     179        ui_checkbox_set_checked(checkbox, true);
     180        PCUT_ASSERT_TRUE(checkbox->checked);
     181        ui_checkbox_set_checked(checkbox, false);
     182        PCUT_ASSERT_FALSE(checkbox->checked);
     183
     184        ui_checkbox_destroy(checkbox);
     185}
     186
    153187/** Paint check box in graphics mode */
    154188PCUT_TEST(paint_gfx)
Note: See TracChangeset for help on using the changeset viewer.