Changeset 1eaead4 in mainline for uspace/lib/ui/test/paint.c
- Timestamp:
- 2023-02-07T16:11:53Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0366d09d
- Parents:
- 7c5320c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/paint.c
r7c5320c r1eaead4 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 75 75 } testgc_bitmap_t; 76 76 77 /** Test box characters */ 78 static ui_box_chars_t test_box_chars = { 79 { 80 { "A", "B", "C" }, 81 { "D", " ", "E" }, 82 { "F", "G", "H" } 83 } 84 }; 85 77 86 /** Paint bevel */ 78 87 PCUT_TEST(bevel) … … 466 475 /* Paint text box */ 467 476 rc = ui_paint_text_box(resource, &rect, ui_box_single, color); 477 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 478 479 gfx_color_delete(color); 480 ui_resource_destroy(resource); 481 rc = gfx_context_delete(gc); 482 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 483 } 484 485 /** Paint custom text box */ 486 PCUT_TEST(text_box_custom) 487 { 488 errno_t rc; 489 gfx_context_t *gc = NULL; 490 ui_resource_t *resource = NULL; 491 gfx_color_t *color = NULL; 492 test_gc_t tgc; 493 gfx_rect_t rect; 494 495 memset(&tgc, 0, sizeof(tgc)); 496 rc = gfx_context_new(&ops, &tgc, &gc); 497 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 498 499 rc = ui_resource_create(gc, false, &resource); 500 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 501 PCUT_ASSERT_NOT_NULL(resource); 502 503 rc = gfx_color_new_rgb_i16(1, 2, 3, &color); 504 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 505 506 rect.p0.x = 10; 507 rect.p0.y = 20; 508 rect.p1.x = 30; 509 rect.p1.y = 40; 510 511 /* Paint text box */ 512 rc = ui_paint_text_box_custom(resource, &rect, &test_box_chars, color); 468 513 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 469 514
Note:
See TracChangeset
for help on using the changeset viewer.