Ai
1 Star 2 Fork 0

Zephyr RTOS/lvgl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
unity_support.h 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
kisvegabor 提交于 2021-06-03 22:38 +08:00 . feat(test) add assert for screenshot compare
#ifndef LV_UNITY_SUPPORT_H
#define LV_UNITY_SUPPORT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include "../../lvgl.h"
bool lv_test_assert_img_eq(const char * fn_ref);
#if LV_COLOR_DEPTH != 32
# define TEST_ASSERT_EQUAL_SCREENSHOT(path) TEST_IGNORE_MESSAGE("Requires LV_COLOR_DEPTH 32");
# define TEST_ASSERT_EQUAL_SCREENSHOT_MESSAGE(path, msg) TEST_PRINTF(msg); TEST_IGNORE_MESSAGE("Requires LV_COLOR_DEPTH 32");
#else
# define TEST_ASSERT_EQUAL_SCREENSHOT(path) if(LV_HOR_RES != 800 || LV_VER_RES != 480) { \
TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \
} else { \
TEST_ASSERT(lv_test_assert_img_eq(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); \
}
#endif
# define TEST_ASSERT_EQUAL_COLOR(c1, c2) TEST_ASSERT_EQUAL_UINT32(c1.full, c2.full)
# define TEST_ASSERT_EQUAL_COLOR_MESSAGE(c1, c2, msg) TEST_ASSERT_EQUAL_UINT32_MESSAGE(c1.full, c2.full, msg)
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_UNITY_SUPPORT_H*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/zephyr-rtos/lvgl.git
git@gitee.com:zephyr-rtos/lvgl.git
zephyr-rtos
lvgl
lvgl
zephyr

搜索帮助