1 #if LV_BUILD_TEST
2 #include "../lvgl.h"
3
4 #include "unity/unity.h"
5
setUp(void)6 void setUp(void)
7 {
8 /* Function run before every test */
9 }
10
tearDown(void)11 void tearDown(void)
12 {
13 /* Function run after every test */
14 lv_obj_clean(lv_screen_active());
15 }
16
test_xml_tabview_with_attrs(void)17 void test_xml_tabview_with_attrs(void)
18 {
19 LV_IMAGE_DECLARE(test_img_lvgl_logo_png);
20 lv_xml_register_image("logo", &test_img_lvgl_logo_png);
21 lv_obj_t * scr = lv_screen_active();
22
23 const char * image1_attrs[] = {
24 "src", "logo",
25 "rotation", "300",
26 "scale_x", "300",
27 "scale_y", "500",
28 "x", "50",
29 "y", "50",
30 NULL, NULL,
31 };
32
33 lv_xml_create(scr, "lv_image", image1_attrs);
34
35 const char * image2_attrs[] = {
36 "src", "logo",
37 "inner_align", "bottom_right",
38 "style_bg_color", "0xff0000",
39 "style_bg_opa", "100",
40 "x", "200",
41 "y", "10",
42 "width", "150",
43 "height", "100",
44 NULL, NULL,
45 };
46
47 lv_xml_create(scr, "lv_image", image2_attrs);
48
49
50 TEST_ASSERT_EQUAL_SCREENSHOT("xml/lv_image.png");
51 }
52
53 #endif
54