From 64bd9053a25297f7a442ca831c7da5b44bd33f84 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 12 Jun 2024 17:54:40 +1000 Subject: Update LVGL to v9.1.0 --- lib/lvgl/tests/unity/unity_support.h | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'lib/lvgl/tests/unity/unity_support.h') diff --git a/lib/lvgl/tests/unity/unity_support.h b/lib/lvgl/tests/unity/unity_support.h index 0d30cee1..6bd025d9 100644 --- a/lib/lvgl/tests/unity/unity_support.h +++ b/lib/lvgl/tests/unity/unity_support.h @@ -8,8 +8,9 @@ extern "C" { #include #include "../../lvgl.h" +#include "../src/lv_test_helpers.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 @@ -18,25 +19,30 @@ bool lv_test_assert_img_eq(const char * fn_ref); #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)); \ - } + TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \ + } else { \ + 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_PRINTF(msg); \ + TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \ + } else { \ + TEST_ASSERT_MESSAGE(lv_test_assert_image_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) +# define TEST_ASSERT_EQUAL_COLOR(c1, c2) TEST_ASSERT_TRUE(lv_color_eq(c1, c2)) +# define TEST_ASSERT_EQUAL_COLOR_MESSAGE(c1, c2, msg) TEST_ASSERT_TRUE(lv_color_eq(c1, c2), msg) + +# define TEST_ASSERT_EQUAL_COLOR32(c1, c2) TEST_ASSERT_TRUE(lv_color32_eq(c1, c2)) +# define TEST_ASSERT_EQUAL_COLOR32_MESSAGE(c1, c2, msg) TEST_ASSERT_TRUE(lv_color32_eq(c1, c2), msg) + + +# define TEST_ASSERT_MEM_LEAK_LESS_THAN(prev_usage, threshold) TEST_ASSERT_LESS_OR_EQUAL(threshold, LV_ABS((int64_t)(prev_usage) - (int64_t)lv_test_get_free_mem())); #ifdef __cplusplus } /*extern "C"*/ #endif #endif /*LV_UNITY_SUPPORT_H*/ - -- cgit v1.2.3