summaryrefslogtreecommitdiff
path: root/lib/lvgl/tests/unity/unity_support.h
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-06-12 17:54:40 +1000
committerjacqueline <me@jacqueline.id.au>2024-06-12 17:54:40 +1000
commit64bd9053a25297f7a442ca831c7da5b44bd33f84 (patch)
treea90c6cad25a12028302ab1a5334510fba0229bae /lib/lvgl/tests/unity/unity_support.h
parent611176ed667c4ed7ee9f609e958f9404f4aee91d (diff)
downloadtangara-fw-64bd9053a25297f7a442ca831c7da5b44bd33f84.tar.gz
Update LVGL to v9.1.0
Diffstat (limited to 'lib/lvgl/tests/unity/unity_support.h')
-rw-r--r--lib/lvgl/tests/unity/unity_support.h32
1 files changed, 19 insertions, 13 deletions
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 <stdbool.h>
#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*/
-