BIN
tests/ref_imgs/snapshot_0.png
Normal file
BIN
tests/ref_imgs/snapshot_0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
tests/ref_imgs/snapshot_1.png
Normal file
BIN
tests/ref_imgs/snapshot_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -34,6 +34,27 @@ void test_snapshot_should_not_leak_memory(void)
|
||||
TEST_ASSERT_EQUAL(initial_available_memory, final_available_memory);
|
||||
}
|
||||
|
||||
void test_snapshot_take_snapshot_immidiately_after_obj_create(void)
|
||||
{
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_obj_set_style_text_font(label, &lv_font_montserrat_28, 0);
|
||||
lv_label_set_text(label, "Wubba lubba dub dub!");
|
||||
|
||||
lv_image_dsc_t * draw_dsc = lv_snapshot_take(label, LV_COLOR_FORMAT_ARGB8888);
|
||||
lv_obj_t * img_obj = lv_image_create(lv_screen_active());
|
||||
lv_image_set_src(img_obj, draw_dsc);
|
||||
|
||||
lv_obj_delete(label);
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("snapshot_0.png");
|
||||
|
||||
lv_obj_center(img_obj);
|
||||
lv_image_set_align(img_obj, LV_IMAGE_ALIGN_CENTER);
|
||||
lv_image_set_rotation(img_obj, 450);
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("snapshot_1.png");
|
||||
}
|
||||
|
||||
#else /*LV_USE_SNAPSHOT*/
|
||||
|
||||
void test_snapshot_should_not_leak_memory(void)
|
||||
|
||||
Reference in New Issue
Block a user