PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/font_desc_test.c

http://ftk.googlecode.com/
C | 27 lines | 19 code | 8 blank | 0 comment | 7 complexity | 462a461def245e56fc7a6cad3c486b20 MD5 | raw file
 1#include "ftk.h"
 2
 3int main(int argc, char* argv[])
 4{
 5	FtkFontDesc* font_desc1 = NULL;
 6	FtkFontDesc* font_desc2 = NULL;
 7	ftk_set_allocator(ftk_allocator_default_create());
 8
 9	font_desc1 = ftk_font_desc_create("size:16 bold:0 italic:0");
10	font_desc2 = ftk_font_desc_create("size:24 bold:1 italic:1");
11
12	assert(ftk_font_desc_get_size(font_desc1) == 16);
13	assert(ftk_font_desc_get_size(font_desc2) == 24);
14
15	assert(ftk_font_desc_is_bold(font_desc1) == 0);
16	assert(ftk_font_desc_is_bold(font_desc2) == 1);
17
18	assert(ftk_font_desc_is_italic(font_desc1) == 0);
19	assert(ftk_font_desc_is_italic(font_desc2) == 1);
20	
21	assert(ftk_font_desc_is_equal(font_desc1, font_desc2) == 0);
22
23	ftk_font_desc_unref(font_desc1);
24	ftk_font_desc_unref(font_desc2);
25
26	return 0;
27}