Changeset 2ab8ab3 in mainline for uspace/lib/gfx/test/render.c
- Timestamp:
- 2021-02-16T18:12:05Z (3 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68a552f
- Parents:
- ef734b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfx/test/render.c
ref734b7 r2ab8ab3 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 32 32 #include <pcut/pcut.h> 33 33 #include <mem.h> 34 #include <stdbool.h> 34 35 35 36 PCUT_INIT; … … 39 40 static errno_t testgc_set_color(void *, gfx_color_t *); 40 41 static errno_t testgc_fill_rect(void *, gfx_rect_t *); 42 static errno_t testgc_update(void *); 41 43 42 44 static gfx_context_ops_t ops = { 43 45 .set_color = testgc_set_color, 44 .fill_rect = testgc_fill_rect 46 .fill_rect = testgc_fill_rect, 47 .update = testgc_update 45 48 }; 46 49 … … 49 52 gfx_color_t *dclr; 50 53 gfx_rect_t *rect; 54 bool updated; 51 55 } test_gc_t; 52 56 … … 107 111 } 108 112 113 PCUT_TEST(update) 114 { 115 errno_t rc; 116 gfx_context_t *gc = NULL; 117 test_gc_t tgc; 118 119 memset(&tgc, 0, sizeof(tgc)); 120 121 rc = gfx_context_new(&ops, &tgc, &gc); 122 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 123 124 PCUT_ASSERT_FALSE(tgc.updated); 125 gfx_update(gc); 126 PCUT_ASSERT_TRUE(tgc.updated); 127 128 rc = gfx_context_delete(gc); 129 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 130 } 131 109 132 static errno_t testgc_set_color(void *arg, gfx_color_t *color) 110 133 { … … 125 148 } 126 149 150 static errno_t testgc_update(void *arg) 151 { 152 test_gc_t *tgc = (test_gc_t *) arg; 153 154 tgc->updated = true; 155 return EOK; 156 } 157 127 158 PCUT_EXPORT(render);
Note:
See TracChangeset
for help on using the changeset viewer.