1 #if LV_BUILD_TEST 2 #include "../lvgl.h" 3 4 #include "unity/unity.h" 5 6 void test_obj_tree_1(void); 7 void test_obj_tree_2(void); 8 test_obj_tree_1(void)9void test_obj_tree_1(void) 10 { 11 TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); 12 } 13 test_obj_tree_2(void)14void test_obj_tree_2(void) 15 { 16 17 lv_obj_create(lv_scr_act()); 18 lv_obj_t * o2 = lv_obj_create(lv_scr_act()); 19 lv_obj_create(lv_scr_act()); 20 TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 3); 21 22 lv_obj_del(o2); 23 TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 2); 24 25 lv_obj_clean(lv_scr_act()); 26 TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); 27 28 lv_color_t c1 = lv_color_hex(0x444444); 29 lv_color_t c2 = lv_color_hex3(0x444); 30 TEST_ASSERT_EQUAL_COLOR(c1, c2); 31 32 lv_obj_remove_style_all(lv_scr_act()); 33 lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x112233), 0); 34 lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, 0); 35 36 //TEST_ASSERT_EQUAL_SCREENSHOT("scr1.png") 37 } 38 39 #endif 40