Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/test/window.c

    r6828a56 rdd7df1c  
    11091109        PCUT_ASSERT_EQUALS(wnd->display->cursor[dcurs_arrow], wnd->cursor);
    11101110
     1111        // Check that invalid cursors cannot be set: ignore enum conversions
     1112        // as we are out-of-bounds
     1113#pragma GCC diagnostic push
     1114#if defined(__GNUC__) && (__GNUC__ >= 10)
     1115#pragma GCC diagnostic ignored "-Wenum-conversion"
     1116#endif
    11111117        rc = ds_window_set_cursor(wnd, dcurs_limit);
    11121118        PCUT_ASSERT_ERRNO_VAL(EINVAL, rc);
     
    11161122        PCUT_ASSERT_ERRNO_VAL(EINVAL, rc);
    11171123        PCUT_ASSERT_EQUALS(wnd->display->cursor[dcurs_arrow], wnd->cursor);
     1124#pragma GCC diagnostic pop
    11181125
    11191126        rc = ds_window_set_cursor(wnd, dcurs_size_lr);
     
    11691176}
    11701177
    1171 /** ds_window_find_alt() finds alternate window by flags */
    1172 PCUT_TEST(window_find_alt)
     1178/** ds_window_find_next() finds next window by flags */
     1179PCUT_TEST(window_find_next)
    11731180{
    11741181        gfx_context_t *gc;
     
    12101217        w2->flags |= wndf_system;
    12111218
    1212         wnd = ds_window_find_alt(w0, wndf_minimized);
     1219        wnd = ds_window_find_next(w0, wndf_minimized);
    12131220        PCUT_ASSERT_EQUALS(w1, wnd);
    12141221
    1215         wnd = ds_window_find_alt(w0, wndf_system);
     1222        wnd = ds_window_find_next(w0, wndf_system);
    12161223        PCUT_ASSERT_EQUALS(w2, wnd);
    12171224
    1218         wnd = ds_window_find_alt(w0, wndf_maximized);
     1225        wnd = ds_window_find_next(w0, wndf_maximized);
     1226        PCUT_ASSERT_NULL(wnd);
     1227
     1228        ds_window_destroy(w0);
     1229        ds_window_destroy(w1);
     1230        ds_window_destroy(w2);
     1231        ds_seat_destroy(seat);
     1232        ds_client_destroy(client);
     1233        ds_display_destroy(disp);
     1234}
     1235
     1236/** ds_window_find_prev() finds previous window by flags */
     1237PCUT_TEST(window_find_prev)
     1238{
     1239        gfx_context_t *gc;
     1240        ds_display_t *disp;
     1241        ds_client_t *client;
     1242        ds_seat_t *seat;
     1243        ds_window_t *w0;
     1244        ds_window_t *w1;
     1245        ds_window_t *w2;
     1246        ds_window_t *wnd;
     1247        display_wnd_params_t params;
     1248        errno_t rc;
     1249
     1250        rc = gfx_context_new(&dummy_ops, NULL, &gc);
     1251        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1252
     1253        rc = ds_display_create(gc, df_none, &disp);
     1254        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1255
     1256        rc = ds_client_create(disp, NULL, NULL, &client);
     1257        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1258
     1259        rc = ds_seat_create(disp, "Alice", &seat);
     1260        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1261
     1262        display_wnd_params_init(&params);
     1263        params.rect.p0.x = params.rect.p0.y = 0;
     1264        params.rect.p1.x = params.rect.p1.y = 1;
     1265
     1266        rc = ds_window_create(client, &params, &w2);
     1267        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1268        w2->flags |= wndf_system;
     1269
     1270        rc = ds_window_create(client, &params, &w1);
     1271        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1272        w1->flags |= wndf_minimized;
     1273
     1274        rc = ds_window_create(client, &params, &w0);
     1275        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1276
     1277        wnd = ds_window_find_prev(w0, wndf_minimized);
     1278        PCUT_ASSERT_EQUALS(w1, wnd);
     1279
     1280        wnd = ds_window_find_prev(w0, wndf_system);
     1281        PCUT_ASSERT_EQUALS(w2, wnd);
     1282
     1283        wnd = ds_window_find_prev(w0, wndf_maximized);
    12191284        PCUT_ASSERT_NULL(wnd);
    12201285
Note: See TracChangeset for help on using the changeset viewer.