refactor(btn, img): rename btn to button and img to image
This commit is contained in:
@@ -42,14 +42,14 @@ typedef struct {
|
||||
png_infop info_ptr;
|
||||
int number_of_passes;
|
||||
png_bytep * row_pointers;
|
||||
} png_img_t;
|
||||
} png_image_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static int read_png_file(png_img_t * p, const char * file_name);
|
||||
static int read_png_file(png_image_t * p, const char * file_name);
|
||||
static int write_png_file(void * raw_img, uint32_t width, uint32_t height, char * file_name);
|
||||
static void png_release(png_img_t * p);
|
||||
static void png_release(png_image_t * p);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -63,7 +63,7 @@ static void png_release(png_img_t * p);
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
bool lv_test_assert_img_eq(const char * fn_ref)
|
||||
bool lv_test_assert_image_eq(const char * fn_ref)
|
||||
{
|
||||
char fn_ref_full[512];
|
||||
sprintf(fn_ref_full, "%s%s", REF_IMGS_PATH, fn_ref);
|
||||
@@ -75,7 +75,7 @@ bool lv_test_assert_img_eq(const char * fn_ref)
|
||||
extern uint8_t * last_flushed_buf;
|
||||
uint8_t * screen_buf = last_flushed_buf;
|
||||
|
||||
png_img_t p;
|
||||
png_image_t p;
|
||||
int res = read_png_file(&p, fn_ref_full);
|
||||
if(res == ERR_FILE_NOT_FOUND) {
|
||||
TEST_PRINTF("%s%s", fn_ref_full, " was not found, creating is now from the rendered screen");
|
||||
@@ -138,7 +138,7 @@ bool lv_test_assert_img_eq(const char * fn_ref)
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
static int read_png_file(png_img_t * p, const char * file_name)
|
||||
static int read_png_file(png_image_t * p, const char * file_name)
|
||||
{
|
||||
char header[8]; // 8 is the maximum size that can be checked
|
||||
|
||||
@@ -290,7 +290,7 @@ static int write_png_file(void * raw_img, uint32_t width, uint32_t height, char
|
||||
}
|
||||
|
||||
|
||||
static void png_release(png_img_t * p)
|
||||
static void png_release(png_image_t * p)
|
||||
{
|
||||
int y;
|
||||
for(y = 0; y < p->height; y++) free(p->row_pointers[y]);
|
||||
|
||||
@@ -9,7 +9,7 @@ extern "C" {
|
||||
#include <stdbool.h>
|
||||
#include "../../lvgl.h"
|
||||
|
||||
bool lv_test_assert_img_eq(const char * fn_ref);
|
||||
bool lv_test_assert_image_eq(const char * fn_ref);
|
||||
|
||||
|
||||
#if LV_COLOR_DEPTH != 32
|
||||
@@ -20,14 +20,14 @@ bool lv_test_assert_img_eq(const char * fn_ref);
|
||||
# define TEST_ASSERT_EQUAL_SCREENSHOT(path) if(LV_HOR_RES != 800 || LV_VER_RES != 480) { \
|
||||
TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \
|
||||
} else { \
|
||||
TEST_ASSERT_MESSAGE(lv_test_assert_img_eq(path), path); \
|
||||
TEST_ASSERT_MESSAGE(lv_test_assert_image_eq(path), path); \
|
||||
}
|
||||
|
||||
# define TEST_ASSERT_EQUAL_SCREENSHOT_MESSAGE(path, msg) if(LV_HOR_RES != 800 || LV_VER_RES != 480) { \
|
||||
TEST_PRINTF(msg); \
|
||||
TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \
|
||||
} else { \
|
||||
TEST_ASSERT_MESSAGE(lv_test_assert_img_eq(path), msg); \
|
||||
TEST_ASSERT_MESSAGE(lv_test_assert_image_eq(path), msg); \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user