snapshot
This commit is contained in:
@@ -20,8 +20,6 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
#define LV_USE_TINY_TTF 1
|
||||
|
||||
void lv_test_assert_fail(void);
|
||||
#define LV_ASSERT_HANDLER lv_test_assert_fail();
|
||||
|
||||
|
||||
@@ -158,53 +158,6 @@ void test_arc_click_area_with_adv_hittest(void)
|
||||
TEST_ASSERT_EQUAL_UINT32(0, event_cnt);
|
||||
}
|
||||
|
||||
/* Check value doesn't go to max when clicking on the other side of the arc */
|
||||
void test_arc_click_sustained_from_start_to_end_does_not_set_value_to_max(void)
|
||||
{
|
||||
arc = lv_arc_create(lv_scr_act());
|
||||
lv_arc_set_value(arc, 0);
|
||||
|
||||
lv_obj_set_size(arc, 100, 100);
|
||||
lv_obj_center(arc);
|
||||
lv_obj_add_event_cb(arc, dummy_event_cb, LV_EVENT_PRESSED, NULL);
|
||||
event_cnt = 0;
|
||||
|
||||
/* Click close to start angle */
|
||||
event_cnt = 0;
|
||||
lv_test_mouse_move_to(376, 285);
|
||||
lv_test_mouse_press();
|
||||
lv_test_indev_wait(50);
|
||||
lv_test_mouse_release();
|
||||
lv_test_indev_wait(50);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT32(1, event_cnt);
|
||||
TEST_ASSERT_EQUAL_UINT32(lv_arc_get_value(arc), lv_arc_get_min_value(arc));
|
||||
|
||||
/* Click close to end angle */
|
||||
event_cnt = 0;
|
||||
|
||||
lv_test_mouse_move_to(376, 285);
|
||||
lv_test_mouse_press();
|
||||
lv_test_indev_wait(50);
|
||||
lv_test_mouse_move_to(415, 281);
|
||||
lv_test_indev_wait(50);
|
||||
lv_test_mouse_release();
|
||||
lv_test_indev_wait(50);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT32(1, event_cnt);
|
||||
TEST_ASSERT_NOT_EQUAL_UINT32(lv_arc_get_value(arc), lv_arc_get_max_value(arc));
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("arc_2.png");
|
||||
}
|
||||
|
||||
void test_arc_basic_render(void)
|
||||
{
|
||||
arc = lv_arc_create(lv_scr_act());
|
||||
lv_obj_set_size(arc, 100, 100);
|
||||
lv_obj_center(arc);
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("arc_1.png");
|
||||
}
|
||||
|
||||
static void dummy_event_cb(lv_event_t * e)
|
||||
{
|
||||
LV_UNUSED(e);
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#if LV_BUILD_TEST
|
||||
#include "../lvgl.h"
|
||||
|
||||
#include "unity/unity.h"
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
/* Function run before every test */
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
/* Function run after every test */
|
||||
}
|
||||
|
||||
void test_tiny_ttf_rendering_test(void)
|
||||
{
|
||||
#if LV_USE_TINY_TTF
|
||||
/*Create a font*/
|
||||
extern const uint8_t ubuntu_font[];
|
||||
extern size_t ubuntu_font_size;
|
||||
lv_font_t * font = lv_tiny_ttf_create_data(ubuntu_font, ubuntu_font_size, 30);
|
||||
|
||||
/*Create style with the new font*/
|
||||
static lv_style_t style;
|
||||
lv_style_init(&style);
|
||||
lv_style_set_text_font(&style, font);
|
||||
lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, lv_color_hex(0xffaaaa));
|
||||
|
||||
/*Create a label with the new style*/
|
||||
lv_obj_t * label = lv_label_create(lv_scr_act());
|
||||
lv_obj_add_style(label, &style, 0);
|
||||
lv_label_set_text(label, "Hello world\n"
|
||||
"I'm a font created with Tiny TTF\n"
|
||||
"Accents: ÁÉÍÓÖŐÜŰ áéíóöőüű");
|
||||
lv_obj_center(label);
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("tiny_ttf_1.png");
|
||||
|
||||
lv_obj_del(label);
|
||||
lv_tiny_ttf_destroy(font);
|
||||
#else
|
||||
TEST_PASS();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user