Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfxfont/test/font.c

    rd884672 r7470d97  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3939PCUT_TEST_SUITE(font);
    4040
     41static errno_t testgc_set_clip_rect(void *, gfx_rect_t *);
    4142static errno_t testgc_set_color(void *, gfx_color_t *);
    4243static errno_t testgc_fill_rect(void *, gfx_rect_t *);
     
    4849
    4950static gfx_context_ops_t test_ops = {
     51        .set_clip_rect = testgc_set_clip_rect,
    5052        .set_color = testgc_set_color,
    5153        .fill_rect = testgc_fill_rect,
     
    98100}
    99101
     102/** Test creating and destroying text-mode font */
     103PCUT_TEST(create_textmode_destroy)
     104{
     105        gfx_typeface_t *tface;
     106        gfx_font_t *font;
     107        gfx_context_t *gc;
     108        test_gc_t tgc;
     109        errno_t rc;
     110
     111        rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
     112        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     113
     114        rc = gfx_typeface_create(gc, &tface);
     115        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     116
     117        rc = gfx_font_create_textmode(tface, &font);
     118        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     119
     120        gfx_font_close(font);
     121        gfx_typeface_destroy(tface);
     122
     123        rc = gfx_context_delete(gc);
     124        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     125}
     126
    100127/** Test gfx_font_get_metrics() */
    101128PCUT_TEST(get_metrics)
     
    543570                }
    544571        }
     572}
     573
     574static errno_t testgc_set_clip_rect(void *arg, gfx_rect_t *rect)
     575{
     576        return EOK;
    545577}
    546578
Note: See TracChangeset for help on using the changeset viewer.