fix tests

This commit is contained in:
Gabor Kiss-Vamosi
2020-08-12 14:29:50 +02:00
parent 8d89bf9ed0
commit d321e0e4fc
2 changed files with 11 additions and 3 deletions

View File

@@ -28,7 +28,9 @@
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
#if LV_USE_FILESYSTEM
static int compare_fonts(lv_font_t * f1, lv_font_t * f2); static int compare_fonts(lv_font_t * f1, lv_font_t * f2);
#endif
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
@@ -48,6 +50,7 @@ extern lv_font_t font_3;
void lv_test_font_loader(void) void lv_test_font_loader(void)
{ {
#if LV_USE_FILESYSTEM
lv_font_t * font_1_bin = lv_font_load("f:font_1.fnt"); lv_font_t * font_1_bin = lv_font_load("f:font_1.fnt");
lv_font_t * font_2_bin = lv_font_load("f:font_2.fnt"); lv_font_t * font_2_bin = lv_font_load("f:font_2.fnt");
lv_font_t * font_3_bin = lv_font_load("f:font_3.fnt"); lv_font_t * font_3_bin = lv_font_load("f:font_3.fnt");
@@ -59,8 +62,10 @@ void lv_test_font_loader(void)
lv_font_free(font_1_bin); lv_font_free(font_1_bin);
lv_font_free(font_2_bin); lv_font_free(font_2_bin);
lv_font_free(font_3_bin); lv_font_free(font_3_bin);
#endif
} }
#if LV_USE_FILESYSTEM
static int compare_fonts(lv_font_t * f1, lv_font_t * f2) static int compare_fonts(lv_font_t * f1, lv_font_t * f2)
{ {
lv_test_assert_true(f1 != NULL && f2 != NULL, "font not null"); lv_test_assert_true(f1 != NULL && f2 != NULL, "font not null");
@@ -198,7 +203,7 @@ static int compare_fonts(lv_font_t * f1, lv_font_t * f2)
LV_LOG_INFO("No differences found!"); LV_LOG_INFO("No differences found!");
return 0; return 0;
} }
#endif
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS

View File

@@ -23,6 +23,7 @@ int main(void)
} }
#if LV_USE_FILESYSTEM
static lv_fs_res_t open_cb(struct _lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) static lv_fs_res_t open_cb(struct _lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode)
{ {
(void) drv; (void) drv;
@@ -77,6 +78,7 @@ static bool ready_cb(struct _lv_fs_drv_t * drv)
(void) drv; (void) drv;
return true; return true;
} }
#endif
static void hal_init(void) static void hal_init(void)
{ {
@@ -91,6 +93,7 @@ static void hal_init(void)
disp_drv.flush_cb = dummy_flush_cb; disp_drv.flush_cb = dummy_flush_cb;
lv_disp_drv_register(&disp_drv); lv_disp_drv_register(&disp_drv);
#if LV_USE_FILESYSTEM
lv_fs_drv_t drv; lv_fs_drv_t drv;
lv_fs_drv_init(&drv); /*Basic initialization*/ lv_fs_drv_init(&drv); /*Basic initialization*/
@@ -103,10 +106,10 @@ static void hal_init(void)
drv.seek_cb = seek_cb; /*Callback to seek in a file (Move cursor) */ drv.seek_cb = seek_cb; /*Callback to seek in a file (Move cursor) */
drv.tell_cb = tell_cb; /*Callback to tell the cursor position */ drv.tell_cb = tell_cb; /*Callback to tell the cursor position */
lv_fs_drv_register(&drv); /*Finally register the drive*/ lv_fs_drv_register(&drv); /*Finally register the drive*/
#endif
} }
static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{ {
LV_UNUSED(area); LV_UNUSED(area);