Changeset 3c54869 in mainline for uspace/app/taskbar/test/wndlist.c
- Timestamp:
- 2023-01-04T20:24:44Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d86797
- Parents:
- cdd6fc9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/test/wndlist.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 208 208 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 209 209 210 rc = wndlist_append(wndlist, 123, "Foo", true );210 rc = wndlist_append(wndlist, 123, "Foo", true, true); 211 211 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 212 212 … … 214 214 PCUT_ASSERT_INT_EQUALS(123, entry->wnd_id); 215 215 PCUT_ASSERT_NOT_NULL(entry->button); 216 PCUT_ASSERT_TRUE(ui_pbutton_get_light(entry->button)); 216 217 217 218 wndlist_destroy(wndlist); … … 248 249 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 249 250 250 rc = wndlist_append(wndlist, 1, "Foo", true );251 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 252 253 rc = wndlist_append(wndlist, 2, "Bar", true);251 rc = wndlist_append(wndlist, 1, "Foo", true, true); 252 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 253 254 rc = wndlist_append(wndlist, 2, "Bar", false, true); 254 255 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 255 256 … … 269 270 } 270 271 272 /** Test updating entry */ 273 PCUT_TEST(update) 274 { 275 errno_t rc; 276 ui_t *ui = NULL; 277 ui_wnd_params_t params; 278 ui_window_t *window = NULL; 279 ui_fixed_t *fixed = NULL; 280 wndlist_t *wndlist; 281 wndlist_entry_t *entry; 282 283 rc = ui_create_disp(NULL, &ui); 284 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 285 286 ui_wnd_params_init(¶ms); 287 params.caption = "Hello"; 288 289 rc = ui_window_create(ui, ¶ms, &window); 290 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 291 PCUT_ASSERT_NOT_NULL(window); 292 293 rc = ui_fixed_create(&fixed); 294 ui_window_add(window, ui_fixed_ctl(fixed)); 295 296 rc = wndlist_create(window, fixed, &wndlist); 297 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 298 299 rc = wndlist_append(wndlist, 1, "Foo", true, true); 300 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 301 302 entry = wndlist_first(wndlist); 303 PCUT_ASSERT_INT_EQUALS(1, entry->wnd_id); 304 PCUT_ASSERT_NOT_NULL(entry->button); 305 PCUT_ASSERT_TRUE(ui_pbutton_get_light(entry->button)); 306 307 rc = wndlist_update(wndlist, entry, "Bar", false); 308 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 309 310 PCUT_ASSERT_INT_EQUALS(1, entry->wnd_id); 311 PCUT_ASSERT_NOT_NULL(entry->button); 312 PCUT_ASSERT_FALSE(ui_pbutton_get_light(entry->button)); 313 314 wndlist_destroy(wndlist); 315 316 ui_window_destroy(window); 317 ui_destroy(ui); 318 } 319 271 320 /** Test setting entry rectangle */ 272 321 PCUT_TEST(set_entry_rect) … … 296 345 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 297 346 298 rc = wndlist_append(wndlist, 123, "Foo", true );347 rc = wndlist_append(wndlist, 123, "Foo", true, true); 299 348 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 300 349 … … 337 386 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 338 387 339 rc = wndlist_append(wndlist, 1, "Foo", true );340 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 341 342 rc = wndlist_append(wndlist, 2, "Bar", true);388 rc = wndlist_append(wndlist, 1, "Foo", true, true); 389 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 390 391 rc = wndlist_append(wndlist, 2, "Bar", false, true); 343 392 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 344 393 … … 384 433 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 385 434 386 rc = wndlist_append(wndlist, 1, "Foo", true );387 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 388 389 rc = wndlist_append(wndlist, 2, "Bar", true);435 rc = wndlist_append(wndlist, 1, "Foo", true, true); 436 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 437 438 rc = wndlist_append(wndlist, 2, "Bar", false, true); 390 439 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 391 440 … … 434 483 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 435 484 436 rc = wndlist_append(wndlist, 1, "Foo", true );437 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 438 439 rc = wndlist_append(wndlist, 2, "Bar", true);485 rc = wndlist_append(wndlist, 1, "Foo", true, true); 486 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 487 488 rc = wndlist_append(wndlist, 2, "Bar", false, true); 440 489 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 441 490 … … 480 529 PCUT_ASSERT_INT_EQUALS(0, count); 481 530 482 rc = wndlist_append(wndlist, 1, "Foo", true );531 rc = wndlist_append(wndlist, 1, "Foo", true, true); 483 532 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 484 533 … … 486 535 PCUT_ASSERT_INT_EQUALS(1, count); 487 536 488 rc = wndlist_append(wndlist, 2, "Bar", true);537 rc = wndlist_append(wndlist, 2, "Bar", false, true); 489 538 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 490 539 … … 524 573 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 525 574 526 rc = wndlist_append(wndlist, 1, "Foo", true );527 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 528 529 rc = wndlist_append(wndlist, 2, "Bar", true);575 rc = wndlist_append(wndlist, 1, "Foo", true, true); 576 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 577 578 rc = wndlist_append(wndlist, 2, "Bar", false, true); 530 579 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 531 580
Note:
See TracChangeset
for help on using the changeset viewer.