diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
| commit | dd27c3530432ea0b09f01e604bf577f31d8ef841 (patch) | |
| tree | bbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/tests/unity/unity_support.h | |
| parent | 6fd588e970470b15936187980829916d0dbe77bb (diff) | |
| download | tangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz | |
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/tests/unity/unity_support.h')
| m--------- | lib/lvgl | 0 | ||||
| -rw-r--r-- | lib/lvgl/tests/unity/unity_support.h | 42 |
2 files changed, 42 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 -Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a diff --git a/lib/lvgl/tests/unity/unity_support.h b/lib/lvgl/tests/unity/unity_support.h new file mode 100644 index 00000000..0d30cee1 --- /dev/null +++ b/lib/lvgl/tests/unity/unity_support.h @@ -0,0 +1,42 @@ + +#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*/ + |
