Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset bef51cf in mainline


Ignore:
Timestamp:
2019-10-05T09:19:15Z (13 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
159776f
Parents:
6af4b4f
Message:

Need a few more tests for ds_display_t/ds_window_t

Location:
uspace/srv/hid/display
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/meson.build

    r6af4b4f rbef51cf  
    3838        'display.c',
    3939        'window.c',
     40        'test/display.c',
    4041        'test/main.c',
    41         'test/display.c',
     42        'test/window.c',
    4243)
  • uspace/srv/hid/display/test/display.c

    r6af4b4f rbef51cf  
    3333
    3434#include "../display.h"
     35#include "../window.h"
    3536
    3637PCUT_INIT;
     
    3940
    4041/** Display creation and destruction. */
    41 PCUT_TEST(display_basic)
     42PCUT_TEST(display_create_destroy)
    4243{
    4344        ds_display_t *disp;
     
    5051}
    5152
     53/** Basic window operation. */
     54PCUT_TEST(display_window)
     55{
     56        ds_display_t *disp;
     57        ds_window_t *wnd;
     58        ds_window_t *w0, *w1, *w2;
     59        errno_t rc;
     60
     61        rc = ds_display_create(&disp);
     62        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     63
     64        rc = ds_window_create(disp, &wnd);
     65        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     66
     67        w0 = ds_display_first_window(disp);
     68        PCUT_ASSERT_EQUALS(w0, wnd);
     69
     70        w1 = ds_display_next_window(w0);
     71        PCUT_ASSERT_NULL(w1);
     72
     73        w2 = ds_display_find_window(disp, wnd->id);
     74        PCUT_ASSERT_EQUALS(w2, wnd);
     75
     76        ds_window_delete(wnd);
     77        ds_display_destroy(disp);
     78}
     79
    5280PCUT_EXPORT(display);
  • uspace/srv/hid/display/test/main.c

    r6af4b4f rbef51cf  
    3232
    3333PCUT_IMPORT(display);
     34PCUT_IMPORT(window);
    3435
    3536PCUT_MAIN();
  • uspace/srv/hid/display/window.c

    r6af4b4f rbef51cf  
    131131        errno_t rc;
    132132
     133        ds_display_remove_window(wnd);
     134
    133135        rc = gfx_context_delete(wnd->gc);
    134136        if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.