Changeset 4583015 in mainline for uspace/lib/gfxfont/test/text.c
- Timestamp:
- 2022-03-07T16:10:44Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca2680d
- Parents:
- 5c27e77
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfxfont/test/text.c
r5c27e77 r4583015 135 135 136 136 gfx_text_fmt_init(&fmt); 137 fmt.font = font; 137 138 fmt.color = color; 138 139 pos.x = 0; 139 140 pos.y = 0; 140 141 141 rc = gfx_puttext( font,&pos, &fmt, "Hello world!");142 rc = gfx_puttext(&pos, &fmt, "Hello world!"); 142 143 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 143 144 … … 181 182 182 183 gfx_text_fmt_init(&fmt); 184 fmt.font = font; 183 185 fmt.color = color; 184 186 pos.x = 0; 185 187 pos.y = 0; 186 188 187 rc = gfx_puttext( font,&pos, &fmt, "Hello world!");189 rc = gfx_puttext(&pos, &fmt, "Hello world!"); 188 190 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 189 191 … … 245 247 246 248 gfx_text_fmt_init(&fmt); 249 fmt.font = font; 247 250 anchor.x = 10; 248 251 anchor.y = 0; … … 250 253 fpos.x = 9; 251 254 fpos.y = 0; 252 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);255 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 253 256 PCUT_ASSERT_INT_EQUALS(0, off); 254 257 255 258 fpos.x = 10; 256 259 fpos.y = 0; 257 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);260 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 258 261 PCUT_ASSERT_INT_EQUALS(0, off); 259 262 260 263 fpos.x = 11; 261 264 fpos.y = 0; 262 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);265 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 263 266 PCUT_ASSERT_INT_EQUALS(0, off); 264 267 265 268 fpos.x = 19; 266 269 fpos.y = 0; 267 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);270 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 268 271 PCUT_ASSERT_INT_EQUALS(1, off); 269 272 270 273 fpos.x = 20; 271 274 fpos.y = 0; 272 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);275 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 273 276 PCUT_ASSERT_INT_EQUALS(2, off); 274 277 275 278 fpos.x = 21; 276 279 fpos.y = 0; 277 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);280 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 278 281 PCUT_ASSERT_INT_EQUALS(3, off); 279 282 280 283 fpos.x = 22; 281 284 fpos.y = 0; 282 off = gfx_text_find_pos( font,&anchor, &fmt, "Aii", &fpos);285 off = gfx_text_find_pos(&anchor, &fmt, "Aii", &fpos); 283 286 PCUT_ASSERT_INT_EQUALS(3, off); 284 287 … … 318 321 anchor.y = 0; 319 322 gfx_text_fmt_init(&fmt); 323 fmt.font = font; 320 324 321 325 fpos.x = 9; 322 326 fpos.y = 0; 323 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);327 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 324 328 PCUT_ASSERT_INT_EQUALS(0, off); 325 329 326 330 fpos.x = 10; 327 331 fpos.y = 0; 328 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);332 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 329 333 PCUT_ASSERT_INT_EQUALS(0, off); 330 334 331 335 fpos.x = 11; 332 336 fpos.y = 0; 333 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);337 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 334 338 PCUT_ASSERT_INT_EQUALS(1, off); 335 339 336 340 fpos.x = 12; 337 341 fpos.y = 0; 338 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);342 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 339 343 PCUT_ASSERT_INT_EQUALS(2, off); 340 344 341 345 fpos.x = 13; 342 346 fpos.y = 0; 343 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);347 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 344 348 PCUT_ASSERT_INT_EQUALS(3, off); 345 349 346 350 fpos.x = 14; 347 351 fpos.y = 0; 348 off = gfx_text_find_pos( font,&anchor, &fmt, "Abc", &fpos);352 off = gfx_text_find_pos(&anchor, &fmt, "Abc", &fpos); 349 353 PCUT_ASSERT_INT_EQUALS(3, off); 350 354 … … 385 389 anchor.y = 20; 386 390 gfx_text_fmt_init(&fmt); 391 fmt.font = font; 387 392 fmt.color = color; 388 393 389 gfx_text_cont( font,&anchor, &fmt, "Abc", &cpos, &cfmt);394 gfx_text_cont(&anchor, &fmt, "Abc", &cpos, &cfmt); 390 395 391 396 PCUT_ASSERT_INT_EQUALS(13, cpos.x); … … 431 436 anchor.y = 20; 432 437 gfx_text_fmt_init(&fmt); 438 fmt.font = font; 433 439 fmt.color = color; 434 440 435 gfx_text_rect( font,&anchor, &fmt, "Abc", &rect);441 gfx_text_rect(&anchor, &fmt, "Abc", &rect); 436 442 437 443 PCUT_ASSERT_INT_EQUALS(10, rect.p0.x);
Note:
See TracChangeset
for help on using the changeset viewer.