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_obj_t * scr = lv_screen_active();
20
21 const char * dropdown_attrs[] = {
22 "options", "First\nSecond\nThird",
23 "text", "Select",
24 "selected", "1",
25 "style_bg_color", "0xaaaaff",
26 NULL, NULL,
27 };
28
29 lv_obj_t * dropdown = lv_xml_create(scr, "lv_dropdown", dropdown_attrs);
30 lv_obj_center(dropdown);
31 lv_dropdown_open(dropdown);
32
33 const char * list_attrs[] = {
34 "style_bg_color", "0xffaaaa",
35 NULL, NULL,
36 };
37 lv_xml_create(dropdown, "lv_dropdown-list", list_attrs);
38
39
40 TEST_ASSERT_EQUAL_SCREENSHOT("xml/lv_dropdown.png");
41 }
42
43 #endif
44