From dd27c3530432ea0b09f01e604bf577f31d8ef841 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 1 Jun 2023 15:41:47 +1000 Subject: convert lvgl from submodule to a plain old directory --- lib/lvgl | 1 - lib/lvgl/tests/.gitignore | 2 + lib/lvgl/tests/CMakeLists.txt | 376 ++++ lib/lvgl/tests/README.md | 57 + lib/lvgl/tests/config.yml | 5 + lib/lvgl/tests/main.py | 208 ++ lib/lvgl/tests/makefile/Makefile | 9 + lib/lvgl/tests/makefile/test.c | 9 + lib/lvgl/tests/ref_imgs/dropdown_1.png | Bin 0 -> 12395 bytes lib/lvgl/tests/ref_imgs/dropdown_2.png | Bin 0 -> 18279 bytes lib/lvgl/tests/ref_imgs/scr1.png | Bin 0 -> 1950 bytes lib/lvgl/tests/ref_imgs/table_1.png | Bin 0 -> 10656 bytes lib/lvgl/tests/src/lv_test_conf.h | 47 + lib/lvgl/tests/src/lv_test_helpers.h | 23 + lib/lvgl/tests/src/lv_test_indev.c | 140 ++ lib/lvgl/tests/src/lv_test_indev.h | 54 + lib/lvgl/tests/src/lv_test_init.c | 100 + lib/lvgl/tests/src/lv_test_init.h | 20 + lib/lvgl/tests/src/test_cases/_test_template.c | 21 + lib/lvgl/tests/src/test_cases/test_arc.c | 167 ++ lib/lvgl/tests/src/test_cases/test_bar.c | 253 +++ lib/lvgl/tests/src/test_cases/test_checkbox.c | 96 + lib/lvgl/tests/src/test_cases/test_config.c | 19 + lib/lvgl/tests/src/test_cases/test_demo_stress.c | 32 + lib/lvgl/tests/src/test_cases/test_demo_widgets.c | 18 + lib/lvgl/tests/src/test_cases/test_dropdown.c | 445 +++++ lib/lvgl/tests/src/test_cases/test_event.c | 27 + lib/lvgl/tests/src/test_cases/test_font_loader.c | 220 +++ lib/lvgl/tests/src/test_cases/test_fs.c | 53 + lib/lvgl/tests/src/test_cases/test_line.c | 95 + lib/lvgl/tests/src/test_cases/test_mem.c | 26 + lib/lvgl/tests/src/test_cases/test_obj_tree.c | 39 + lib/lvgl/tests/src/test_cases/test_slider.c | 214 +++ lib/lvgl/tests/src/test_cases/test_snapshot.c | 47 + lib/lvgl/tests/src/test_cases/test_style.c | 109 ++ lib/lvgl/tests/src/test_cases/test_switch.c | 140 ++ lib/lvgl/tests/src/test_cases/test_table.c | 247 +++ lib/lvgl/tests/src/test_cases/test_textarea.c | 107 ++ lib/lvgl/tests/src/test_cases/test_txt.c | 207 ++ lib/lvgl/tests/src/test_files/readtest.txt | Bin 0 -> 745 bytes lib/lvgl/tests/src/test_fonts/font_1.c | 1380 ++++++++++++++ lib/lvgl/tests/src/test_fonts/font_1.fnt | Bin 0 -> 6876 bytes lib/lvgl/tests/src/test_fonts/font_2.c | 1410 ++++++++++++++ lib/lvgl/tests/src/test_fonts/font_2.fnt | Bin 0 -> 7252 bytes lib/lvgl/tests/src/test_fonts/font_3.c | 948 +++++++++ lib/lvgl/tests/src/test_fonts/font_3.fnt | Bin 0 -> 4892 bytes lib/lvgl/tests/unity/generate_test_runner.rb | 511 +++++ lib/lvgl/tests/unity/run_test.erb | 37 + lib/lvgl/tests/unity/type_sanitizer.rb | 6 + lib/lvgl/tests/unity/unity.c | 2113 +++++++++++++++++++++ lib/lvgl/tests/unity/unity.h | 668 +++++++ lib/lvgl/tests/unity/unity_internals.h | 1042 ++++++++++ lib/lvgl/tests/unity/unity_support.c | 237 +++ lib/lvgl/tests/unity/unity_support.h | 42 + 54 files changed, 12026 insertions(+), 1 deletion(-) delete mode 160000 lib/lvgl create mode 100644 lib/lvgl/tests/.gitignore create mode 100644 lib/lvgl/tests/CMakeLists.txt create mode 100644 lib/lvgl/tests/README.md create mode 100644 lib/lvgl/tests/config.yml create mode 100755 lib/lvgl/tests/main.py create mode 100644 lib/lvgl/tests/makefile/Makefile create mode 100644 lib/lvgl/tests/makefile/test.c create mode 100644 lib/lvgl/tests/ref_imgs/dropdown_1.png create mode 100644 lib/lvgl/tests/ref_imgs/dropdown_2.png create mode 100644 lib/lvgl/tests/ref_imgs/scr1.png create mode 100644 lib/lvgl/tests/ref_imgs/table_1.png create mode 100644 lib/lvgl/tests/src/lv_test_conf.h create mode 100644 lib/lvgl/tests/src/lv_test_helpers.h create mode 100644 lib/lvgl/tests/src/lv_test_indev.c create mode 100644 lib/lvgl/tests/src/lv_test_indev.h create mode 100644 lib/lvgl/tests/src/lv_test_init.c create mode 100644 lib/lvgl/tests/src/lv_test_init.h create mode 100644 lib/lvgl/tests/src/test_cases/_test_template.c create mode 100644 lib/lvgl/tests/src/test_cases/test_arc.c create mode 100644 lib/lvgl/tests/src/test_cases/test_bar.c create mode 100644 lib/lvgl/tests/src/test_cases/test_checkbox.c create mode 100644 lib/lvgl/tests/src/test_cases/test_config.c create mode 100644 lib/lvgl/tests/src/test_cases/test_demo_stress.c create mode 100644 lib/lvgl/tests/src/test_cases/test_demo_widgets.c create mode 100644 lib/lvgl/tests/src/test_cases/test_dropdown.c create mode 100644 lib/lvgl/tests/src/test_cases/test_event.c create mode 100644 lib/lvgl/tests/src/test_cases/test_font_loader.c create mode 100644 lib/lvgl/tests/src/test_cases/test_fs.c create mode 100644 lib/lvgl/tests/src/test_cases/test_line.c create mode 100644 lib/lvgl/tests/src/test_cases/test_mem.c create mode 100644 lib/lvgl/tests/src/test_cases/test_obj_tree.c create mode 100644 lib/lvgl/tests/src/test_cases/test_slider.c create mode 100644 lib/lvgl/tests/src/test_cases/test_snapshot.c create mode 100644 lib/lvgl/tests/src/test_cases/test_style.c create mode 100644 lib/lvgl/tests/src/test_cases/test_switch.c create mode 100644 lib/lvgl/tests/src/test_cases/test_table.c create mode 100644 lib/lvgl/tests/src/test_cases/test_textarea.c create mode 100644 lib/lvgl/tests/src/test_cases/test_txt.c create mode 100644 lib/lvgl/tests/src/test_files/readtest.txt create mode 100644 lib/lvgl/tests/src/test_fonts/font_1.c create mode 100644 lib/lvgl/tests/src/test_fonts/font_1.fnt create mode 100644 lib/lvgl/tests/src/test_fonts/font_2.c create mode 100644 lib/lvgl/tests/src/test_fonts/font_2.fnt create mode 100644 lib/lvgl/tests/src/test_fonts/font_3.c create mode 100644 lib/lvgl/tests/src/test_fonts/font_3.fnt create mode 100644 lib/lvgl/tests/unity/generate_test_runner.rb create mode 100644 lib/lvgl/tests/unity/run_test.erb create mode 100644 lib/lvgl/tests/unity/type_sanitizer.rb create mode 100644 lib/lvgl/tests/unity/unity.c create mode 100644 lib/lvgl/tests/unity/unity.h create mode 100644 lib/lvgl/tests/unity/unity_internals.h create mode 100644 lib/lvgl/tests/unity/unity_support.c create mode 100644 lib/lvgl/tests/unity/unity_support.h (limited to 'lib/lvgl/tests') diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 index 0732400e..00000000 --- a/lib/lvgl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0732400e7b564dd0e7dc4a924619d8e19c5b23a0 diff --git a/lib/lvgl/tests/.gitignore b/lib/lvgl/tests/.gitignore new file mode 100644 index 00000000..d484e9e1 --- /dev/null +++ b/lib/lvgl/tests/.gitignore @@ -0,0 +1,2 @@ +*.out +*_Runner.c diff --git a/lib/lvgl/tests/CMakeLists.txt b/lib/lvgl/tests/CMakeLists.txt new file mode 100644 index 00000000..2f8250dc --- /dev/null +++ b/lib/lvgl/tests/CMakeLists.txt @@ -0,0 +1,376 @@ +if(ESP_PLATFORM) + +################################### +# Tests do not build for ESP-IDF. # +################################### + +else() + +cmake_minimum_required(VERSION 3.13) +project(lvgl_tests LANGUAGES C) + +include(CTest) + +set(LVGL_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +set(LVGL_TEST_COMMON_EXAMPLE_OPTIONS + -DLV_BUILD_EXAMPLES=1 + -DLV_USE_DEMO_WIDGETS=1 + -DLV_USE_DEMO_STRESS=1 +) + +set(LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME + -DLV_COLOR_DEPTH=1 + -DLV_MEM_SIZE=65535 + -DLV_DPI_DEF=40 + -DLV_DRAW_COMPLEX=0 + -DLV_USE_METER=0 + -DLV_USE_LOG=1 + -DLV_USE_ASSERT_NULL=0 + -DLV_USE_ASSERT_MALLOC=0 + -DLV_USE_ASSERT_MEM_INTEGRITY=0 + -DLV_USE_ASSERT_OBJ=0 + -DLV_USE_ASSERT_STYLE=0 + -DLV_USE_USER_DATA=0 + -DLV_FONT_UNSCII_8=1 + -DLV_USE_BIDI=0 + -DLV_USE_ARABIC_PERSIAN_CHARS=0 + -DLV_BUILD_EXAMPLES=1 + -DLV_FONT_DEFAULT=&lv_font_montserrat_14 + -DLV_USE_PNG=1 + -DLV_USE_BMP=1 + -DLV_USE_GIF=1 + -DLV_USE_QRCODE=1 +) + +set(LVGL_TEST_OPTIONS_NORMAL_8BIT + -DLV_COLOR_DEPTH=8 + -DLV_MEM_SIZE=65535 + -DLV_DPI_DEF=40 + -DLV_DRAW_COMPLEX=1 + -DLV_USE_LOG=1 + -DLV_USE_ASSERT_NULL=0 + -DLV_USE_ASSERT_MALLOC=0 + -DLV_USE_ASSERT_MEM_INTEGRITY=0 + -DLV_USE_ASSERT_OBJ=0 + -DLV_USE_ASSERT_STYLE=0 + -DLV_USE_USER_DATA=1 + -DLV_FONT_UNSCII_8=1 + -DLV_USE_FONT_SUBPX=1 + -DLV_USE_BIDI=0 + -DLV_USE_ARABIC_PERSIAN_CHARS=0 + ${LVGL_TEST_COMMON_EXAMPLE_OPTIONS} + -DLV_FONT_DEFAULT=&lv_font_montserrat_14 + -DLV_USE_PNG=1 + -DLV_USE_BMP=1 + -DLV_USE_SJPG=1 + -DLV_USE_GIF=1 + -DLV_USE_QRCODE=1 +) + +set(LVGL_TEST_OPTIONS_16BIT + -DLV_COLOR_DEPTH=16 + -DLV_COLOR_16_SWAP=0 + -DLV_MEM_SIZE=65536 + -DLV_DPI_DEF=40 + -DLV_DRAW_COMPLEX=1 + -DLV_DITHER_GRADIENT=1 + -DLV_USE_LOG=1 + -DLV_USE_ASSERT_NULL=0 + -DLV_USE_ASSERT_MALLOC=0 + -DLV_USE_ASSERT_MEM_INTEGRITY=0 + -DLV_USE_ASSERT_OBJ=0 + -DLV_USE_ASSERT_STYLE=0 + -DLV_USE_USER_DATA=1 + -DLV_FONT_UNSCII_8=1 + -DLV_USE_FONT_SUBPX=1 + -DLV_USE_BIDI=0 + -DLV_USE_ARABIC_PERSIAN_CHARS=0 + ${LVGL_TEST_COMMON_EXAMPLE_OPTIONS} + -DLV_FONT_DEFAULT=&lv_font_montserrat_14 + -DLV_USE_PNG=1 + -DLV_USE_BMP=1 + -DLV_USE_SJPG=1 + -DLV_USE_GIF=1 + -DLV_USE_QRCODE=1 +) + +set(LVGL_TEST_OPTIONS_16BIT_SWAP + -DLV_COLOR_DEPTH=16 + -DLV_COLOR_16_SWAP=1 + -DLV_MEM_SIZE=65536 + -DLV_DPI_DEF=40 + -DLV_DRAW_COMPLEX=1 + -DLV_DITHER_GRADIENT=1 + -DLV_DITHER_ERROR_DIFFUSION=1 + -DLV_GRAD_CACHE_DEF_SIZE=8*1024 + -DLV_USE_LOG=1 + -DLV_USE_ASSERT_NULL=0 + -DLV_USE_ASSERT_MALLOC=0 + -DLV_USE_ASSERT_MEM_INTEGRITY=0 + -DLV_USE_ASSERT_OBJ=0 + -DLV_USE_ASSERT_STYLE=0 + -DLV_USE_USER_DATA=1 + -DLV_FONT_UNSCII_8=1 + -DLV_USE_FONT_SUBPX=1 + -DLV_USE_BIDI=0 + -DLV_USE_ARABIC_PERSIAN_CHARS=0 + ${LVGL_TEST_COMMON_EXAMPLE_OPTIONS} + -DLV_FONT_DEFAULT=&lv_font_montserrat_14 + -DLV_USE_PNG=1 + -DLV_USE_BMP=1 + -DLV_USE_SJPG=1 + -DLV_USE_GIF=1 + -DLV_USE_QRCODE=1 +) + +set(LVGL_TEST_OPTIONS_FULL_32BIT + -DLV_COLOR_DEPTH=32 + -DLV_MEM_SIZE=8388608 + -DLV_DPI_DEF=160 + -DLV_DRAW_COMPLEX=1 + -DLV_SHADOW_CACHE_SIZE=1 + -DLV_IMG_CACHE_DEF_SIZE=32 + -DLV_USE_LOG=1 + -DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE + -DLV_LOG_PRINTF=1 + -DLV_USE_FONT_SUBPX=1 + -DLV_FONT_SUBPX_BGR=1 + -DLV_USE_PERF_MONITOR=1 + -DLV_USE_ASSERT_NULL=1 + -DLV_USE_ASSERT_MALLOC=1 + -DLV_USE_ASSERT_MEM_INTEGRITY=1 + -DLV_USE_ASSERT_OBJ=1 + -DLV_USE_ASSERT_STYLE=1 + -DLV_USE_USER_DATA=1 + -DLV_USE_LARGE_COORD=1 + -DLV_FONT_MONTSERRAT_8=1 + -DLV_FONT_MONTSERRAT_10=1 + -DLV_FONT_MONTSERRAT_12=1 + -DLV_FONT_MONTSERRAT_14=1 + -DLV_FONT_MONTSERRAT_16=1 + -DLV_FONT_MONTSERRAT_18=1 + -DLV_FONT_MONTSERRAT_20=1 + -DLV_FONT_MONTSERRAT_22=1 + -DLV_FONT_MONTSERRAT_24=1 + -DLV_FONT_MONTSERRAT_26=1 + -DLV_FONT_MONTSERRAT_28=1 + -DLV_FONT_MONTSERRAT_30=1 + -DLV_FONT_MONTSERRAT_32=1 + -DLV_FONT_MONTSERRAT_34=1 + -DLV_FONT_MONTSERRAT_36=1 + -DLV_FONT_MONTSERRAT_38=1 + -DLV_FONT_MONTSERRAT_40=1 + -DLV_FONT_MONTSERRAT_42=1 + -DLV_FONT_MONTSERRAT_44=1 + -DLV_FONT_MONTSERRAT_46=1 + -DLV_FONT_MONTSERRAT_48=1 + -DLV_FONT_MONTSERRAT_12_SUBPX=1 + -DLV_FONT_MONTSERRAT_28_COMPRESSED=1 + -DLV_FONT_DEJAVU_16_PERSIAN_HEBREW=1 + -DLV_FONT_SIMSUN_16_CJK=1 + -DLV_FONT_UNSCII_8=1 + -DLV_FONT_UNSCII_16=1 + -DLV_FONT_FMT_TXT_LARGE=1 + -DLV_USE_FONT_COMPRESSED=1 + -DLV_USE_BIDI=1 + -DLV_USE_ARABIC_PERSIAN_CHARS=1 + -DLV_USE_PERF_MONITOR=1 + -DLV_USE_MEM_MONITOR=1 + -DLV_LABEL_TEXT_SELECTION=1 + ${LVGL_TEST_COMMON_EXAMPLE_OPTIONS} + -DLV_FONT_DEFAULT=&lv_font_montserrat_24 + -DLV_USE_FS_STDIO=1 + -DLV_FS_STDIO_LETTER='A' + -DLV_USE_FS_POSIX=1 + -DLV_FS_POSIX_LETTER='B' + -DLV_USE_PNG=1 + -DLV_USE_BMP=1 + -DLV_USE_SJPG=1 + -DLV_USE_GIF=1 + -DLV_USE_QRCODE=1 + -DLV_USE_FRAGMENT=1 + -DLV_USE_IMGFONT=1 + -DLV_USE_MSG=1 +) + +set(LVGL_TEST_OPTIONS_TEST_COMMON + --coverage + -DLV_COLOR_DEPTH=32 + -DLV_MEM_SIZE=2097152 + -DLV_SHADOW_CACHE_SIZE=10240 + -DLV_IMG_CACHE_DEF_SIZE=32 + -DLV_DITHER_GRADIENT=1 + -DLV_DITHER_ERROR_DIFFUSION=1 + -DLV_GRAD_CACHE_DEF_SIZE=8*1024 + -DLV_USE_LOG=1 + -DLV_LOG_PRINTF=1 + -DLV_USE_FONT_SUBPX=1 + -DLV_FONT_SUBPX_BGR=1 + -DLV_USE_ASSERT_NULL=0 + -DLV_USE_ASSERT_MALLOC=0 + -DLV_USE_ASSERT_MEM_INTEGRITY=0 + -DLV_USE_ASSERT_OBJ=0 + -DLV_USE_ASSERT_STYLE=0 + -DLV_USE_USER_DATA=1 + -DLV_USE_LARGE_COORD=1 + -DLV_FONT_MONTSERRAT_14=1 + -DLV_FONT_MONTSERRAT_16=1 + -DLV_FONT_MONTSERRAT_18=1 + -DLV_FONT_MONTSERRAT_24=1 + -DLV_FONT_MONTSERRAT_48=1 + -DLV_FONT_MONTSERRAT_12_SUBPX=1 + -DLV_FONT_MONTSERRAT_28_COMPRESSED=1 + -DLV_FONT_DEJAVU_16_PERSIAN_HEBREW=1 + -DLV_FONT_SIMSUN_16_CJK=1 + -DLV_FONT_UNSCII_8=1 + -DLV_FONT_UNSCII_16=1 + -DLV_FONT_FMT_TXT_LARGE=1 + -DLV_USE_FONT_COMPRESSED=1 + -DLV_USE_BIDI=1 + -DLV_USE_ARABIC_PERSIAN_CHARS=1 + -DLV_LABEL_TEXT_SELECTION=1 + -DLV_USE_FS_STDIO=1 + -DLV_FS_STDIO_LETTER='A' + -DLV_FS_STDIO_CACHE_SIZE=100 + -DLV_USE_FS_POSIX=1 + -DLV_FS_POSIX_LETTER='B' + -DLV_FS_POSIX_CACHE_SIZE=0 + ${LVGL_TEST_COMMON_EXAMPLE_OPTIONS} + -DLV_FONT_DEFAULT=&lv_font_montserrat_14 + -Wno-unused-but-set-variable # unused variables are common in the dual-heap arrangement + -Wno-unused-variable +) + +set(LVGL_TEST_OPTIONS_TEST_SYSHEAP + ${LVGL_TEST_OPTIONS_TEST_COMMON} + -DLVGL_CI_USING_SYS_HEAP + -DLV_MEM_CUSTOM=1 + -fsanitize=address +) + +set(LVGL_TEST_OPTIONS_TEST_DEFHEAP + ${LVGL_TEST_OPTIONS_TEST_COMMON} + -DLVGL_CI_USING_DEF_HEAP + -DLV_MEM_SIZE=2097152 + -fsanitize=address +) + +if (OPTIONS_MINIMAL_MONOCHROME) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME}) +elseif (OPTIONS_NORMAL_8BIT) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_NORMAL_8BIT}) +elseif (OPTIONS_16BIT) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_16BIT}) +elseif (OPTIONS_16BIT_SWAP) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_16BIT_SWAP}) +elseif (OPTIONS_FULL_32BIT) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_FULL_32BIT}) +elseif (OPTIONS_TEST_SYSHEAP) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_SYSHEAP}) + set (TEST_LIBS --coverage -fsanitize=address) +elseif (OPTIONS_TEST_DEFHEAP) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_DEFHEAP}) + set (TEST_LIBS --coverage -fsanitize=address) +else() + message(FATAL_ERROR "Must provide a known options value (check main.py?).") +endif() + +# Options lvgl and examples are compiled with. +set(COMPILE_OPTIONS + -DLV_CONF_PATH=${LVGL_TEST_DIR}/src/lv_test_conf.h + -DLV_BUILD_TEST + -pedantic-errors + -Wall + -Wclobbered + -Wdeprecated + -Wdouble-promotion + -Wempty-body + -Werror + -Wextra + -Wformat-security + -Wmaybe-uninitialized + -Wmissing-prototypes + -Wpointer-arith + -Wmultichar + -Wno-discarded-qualifiers + -Wpedantic + -Wreturn-type + -Wshadow + -Wshift-negative-value + -Wsizeof-pointer-memaccess + -Wstack-usage=5000 + -Wtype-limits + -Wundef + -Wuninitialized + -Wunreachable-code + ${BUILD_OPTIONS} +) + +# Options test cases are compiled with. +set(LVGL_TESTFILE_COMPILE_OPTIONS + ${COMPILE_OPTIONS} + -Wno-missing-prototypes +) + +get_filename_component(LVGL_DIR ${LVGL_TEST_DIR} DIRECTORY) + +# Include lvgl project file. +include(${LVGL_DIR}/CMakeLists.txt) +target_compile_options(lvgl PUBLIC ${COMPILE_OPTIONS}) +target_compile_options(lvgl_examples PUBLIC ${COMPILE_OPTIONS}) + + +set(TEST_INCLUDE_DIRS + $ + $ + $ +) + +add_library(test_common + STATIC + src/lv_test_indev.c + src/lv_test_init.c + src/test_fonts/font_1.c + src/test_fonts/font_2.c + src/test_fonts/font_3.c + unity/unity_support.c + unity/unity.c +) +target_include_directories(test_common PUBLIC ${TEST_INCLUDE_DIRS}) +target_compile_options(test_common PUBLIC ${LVGL_TESTFILE_COMPILE_OPTIONS}) + +# Some examples `#include "lvgl/lvgl.h"` - which is a path which is not +# in this source repository. If this repo is in a directory names 'lvgl' +# then we can add our parent directory to the include path. +# TODO: This is not good practice and should be fixed. +get_filename_component(LVGL_PARENT_DIR ${LVGL_DIR} DIRECTORY) +target_include_directories(lvgl_examples PUBLIC $) + +# Generate one test executable for each source file pair. +# The sources in src/test_runners is auto-generated, the +# sources in src/test_cases is the actual test case. +file( GLOB TEST_CASE_FILES src/test_cases/*.c ) +foreach( test_case_fname ${TEST_CASE_FILES} ) + # If test file is foo/bar/baz.c then test_name is "baz". + get_filename_component(test_name ${test_case_fname} NAME_WLE) + if (${test_name} STREQUAL "_test_template") + continue() + endif() + # Create path to auto-generated source file. + set(test_runner_fname src/test_runners/${test_name}_Runner.c) + add_executable( ${test_name} + ${test_case_fname} + ${test_runner_fname} + ) + target_link_libraries(${test_name} test_common lvgl_examples lvgl_demos lvgl png ${TEST_LIBS}) + target_include_directories(${test_name} PUBLIC ${TEST_INCLUDE_DIRS}) + target_compile_options(${test_name} PUBLIC ${LVGL_TESTFILE_COMPILE_OPTIONS}) + + add_test( + NAME ${test_name} + WORKING_DIRECTORY ${LVGL_TEST_DIR} + COMMAND ${test_name}) +endforeach( test_case_fname ${TEST_CASE_FILES} ) + +endif() diff --git a/lib/lvgl/tests/README.md b/lib/lvgl/tests/README.md new file mode 100644 index 00000000..a7703b9b --- /dev/null +++ b/lib/lvgl/tests/README.md @@ -0,0 +1,57 @@ +# Tests for LVGL + +The tests in the folder can be run locally and automatically by GitHub CI. + +## Running locally + +### Requirements (Linux) + +Install requirements by: + +```sh +scripts/install-prerequisites.sh +``` + +### Run test +1. Run all executable tests with `./tests/main.py test`. +2. Build all build-only tests with `./tests/main.py build`. +3. Clean prior test build, build all build-only tests, + run executable tests, and generate code coverage + report `./tests/main.py --clean --report build test`. + +For full information on running tests run: `./tests/main.py --help`. + +## Running automatically + +GitHub's CI automatically runs these tests on pushes and pull requests to `master` and `releasev8.*` branches. + +## Directory structure +- `src` Source files of the tests + - `test_cases` The written tests, + - `test_runners` Generated automatically from the files in `test_cases`. + - other miscellaneous files and folders +- `ref_imgs` - Reference images for screenshot compare +- `report` - Coverage report. Generated if the `report` flag was passed to `./main.py` +- `unity` Source files of the test engine + +## Add new tests + +### Create new test file +New test needs to be added into the `src/test_cases` folder. The name of the files should look like `test_.c`. The basic skeleton of a test file copy `_test_template.c`. + +### Asserts +See the list of asserts [here](https://github.com/ThrowTheSwitch/Unity/blob/master/docs/UnityAssertionsReference.md). + +There are some custom, LVGL specific asserts: +- `TEST_ASSERT_EQUAL_SCREENSHOT("image1.png")` Render the active screen and compare its content with an image in the `ref_imgs` folder. +If the compare fails `lvgl/test_screenshot_error.h` is created with the content of the frame buffer as an image. +To see the that image `#include "test_screenshot_error.h"` and call `test_screenshot_error_show();`. +- `TEST_ASSERT_EQUAL_COLOR(color1, color2)` Compare two colors. + +### Adding new reference images +The reference images can be taken by copy-pasting the test code in to LVGL simulator and saving the screen. +LVGL needs to +- 800x480 resolution +- 32 bit color depth +- `LV_USE_PERF_MONITOR` and `LV_USE_MEM_MONITOR` disabled +- use the default theme, with the default color (don't set a theme manually) diff --git a/lib/lvgl/tests/config.yml b/lib/lvgl/tests/config.yml new file mode 100644 index 00000000..6dd0209d --- /dev/null +++ b/lib/lvgl/tests/config.yml @@ -0,0 +1,5 @@ +:unity: + :includes: + - lv_test_init.h + :suite_setup: "lv_test_init();" + :suite_teardown: "lv_test_deinit();return num_failures;" diff --git a/lib/lvgl/tests/main.py b/lib/lvgl/tests/main.py new file mode 100755 index 00000000..efdfbe6c --- /dev/null +++ b/lib/lvgl/tests/main.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python3 + +import argparse +import errno +import glob +import shutil +import subprocess +import sys +import os + +lvgl_test_dir = os.path.dirname(os.path.realpath(__file__)) + +# Key values must match variable names in CMakeLists.txt. +build_only_options = { + 'OPTIONS_MINIMAL_MONOCHROME': 'Minimal config monochrome', + 'OPTIONS_NORMAL_8BIT': 'Normal config, 8 bit color depth', + 'OPTIONS_16BIT': 'Minimal config, 16 bit color depth', + 'OPTIONS_16BIT_SWAP': 'Normal config, 16 bit color depth swapped', + 'OPTIONS_FULL_32BIT': 'Full config, 32 bit color depth', +} + +test_options = { + 'OPTIONS_TEST_SYSHEAP': 'Test config, system heap, 32 bit color depth', + 'OPTIONS_TEST_DEFHEAP': 'Test config, LVGL heap, 32 bit color depth', +} + + +def is_valid_option_name(option_name): + return option_name in build_only_options or option_name in test_options + + +def get_option_description(option_name): + if option_name in build_only_options: + return build_only_options[option_name] + return test_options[option_name] + + +def delete_dir_ignore_missing(dir_path): + '''Recursively delete a directory and ignore if missing.''' + try: + shutil.rmtree(dir_path) + except FileNotFoundError: + pass + + +def generate_test_runners(): + '''Generate the test runner source code.''' + global lvgl_test_dir + os.chdir(lvgl_test_dir) + delete_dir_ignore_missing('src/test_runners') + os.mkdir('src/test_runners') + + # TODO: Intermediate files should be in the build folders, not alongside + # the other repo source. + for f in glob.glob("./src/test_cases/test_*.c"): + r = f[:-2] + "_Runner.c" + r = r.replace("/test_cases/", "/test_runners/") + subprocess.check_call(['ruby', 'unity/generate_test_runner.rb', + f, r, 'config.yml']) + + +def options_abbrev(options_name): + '''Return an abbreviated version of the option name.''' + prefix = 'OPTIONS_' + assert options_name.startswith(prefix) + return options_name[len(prefix):].lower() + + +def get_base_buid_dir(options_name): + '''Given the build options name, return the build directory name. + + Does not return the full path to the directory - just the base name.''' + return 'build_%s' % options_abbrev(options_name) + + +def get_build_dir(options_name): + '''Given the build options name, return the build directory name. + + Returns absolute path to the build directory.''' + global lvgl_test_dir + return os.path.join(lvgl_test_dir, get_base_buid_dir(options_name)) + + +def build_tests(options_name, build_type, clean): + '''Build all tests for the specified options name.''' + global lvgl_test_dir + + print() + print() + label = 'Building: %s: %s' % (options_abbrev( + options_name), get_option_description(options_name)) + print('=' * len(label)) + print(label) + print('=' * len(label)) + print(flush=True) + + build_dir = get_build_dir(options_name) + if clean: + delete_dir_ignore_missing(build_dir) + + os.chdir(lvgl_test_dir) + created_build_dir = False + if not os.path.isdir(build_dir): + os.mkdir(build_dir) + created_build_dir = True + os.chdir(build_dir) + if created_build_dir: + subprocess.check_call(['cmake', '-DCMAKE_BUILD_TYPE=%s' % build_type, + '-D%s=1' % options_name, '..']) + subprocess.check_call(['cmake', '--build', build_dir, + '--parallel', str(os.cpu_count())]) + + +def run_tests(options_name): + '''Run the tests for the given options name.''' + + print() + print() + label = 'Running tests for %s' % options_abbrev(options_name) + print('=' * len(label)) + print(label) + print('=' * len(label), flush=True) + + os.chdir(get_build_dir(options_name)) + subprocess.check_call( + ['ctest', '--timeout', '30', '--parallel', str(os.cpu_count()), '--output-on-failure']) + + +def generate_code_coverage_report(): + '''Produce code coverage test reports for the test execution.''' + global lvgl_test_dir + + print() + print() + label = 'Generating code coverage reports' + print('=' * len(label)) + print(label) + print('=' * len(label)) + print(flush=True) + + os.chdir(lvgl_test_dir) + delete_dir_ignore_missing('report') + os.mkdir('report') + root_dir = os.pardir + html_report_file = 'report/index.html' + cmd = ['gcovr', '--root', root_dir, '--html-details', '--output', + html_report_file, '--xml', 'report/coverage.xml', + '-j', str(os.cpu_count()), '--print-summary', + '--html-title', 'LVGL Test Coverage'] + for d in ('.*\\bexamples/.*', '\\bsrc/test_.*', '\\bsrc/lv_test.*', '\\bunity\\b'): + cmd.extend(['--exclude', d]) + + subprocess.check_call(cmd) + print("Done: See %s" % html_report_file, flush=True) + + +if __name__ == "__main__": + epilog = '''This program builds and optionally runs the LVGL test programs. + There are two types of LVGL tests: "build", and "test". The build-only + tests, as their name suggests, only verify that the program successfully + compiles and links (with various build options). There are also a set of + tests that execute to verify correct LVGL library behavior. + ''' + parser = argparse.ArgumentParser( + description='Build and/or run LVGL tests.', epilog=epilog) + parser.add_argument('--build-options', nargs=1, + help='''the build option name to build or run. When + omitted all build configurations are used. + ''') + parser.add_argument('--clean', action='store_true', default=False, + help='clean existing build artifacts before operation.') + parser.add_argument('--report', action='store_true', + help='generate code coverage report for tests.') + parser.add_argument('actions', nargs='*', choices=['build', 'test'], + help='build: compile build tests, test: compile/run executable tests.') + + args = parser.parse_args() + + if args.build_options: + options_to_build = args.build_options + else: + if 'build' in args.actions: + if 'test' in args.actions: + options_to_build = {**build_only_options, **test_options} + else: + options_to_build = build_only_options + else: + options_to_build = test_options + + for opt in options_to_build: + if not is_valid_option_name(opt): + print('Invalid build option "%s"' % opt, file=sys.stderr) + sys.exit(errno.EINVAL) + + generate_test_runners() + + for options_name in options_to_build: + is_test = options_name in test_options + build_type = 'Debug' + build_tests(options_name, build_type, args.clean) + if is_test: + try: + run_tests(options_name) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) + + if args.report: + generate_code_coverage_report() diff --git a/lib/lvgl/tests/makefile/Makefile b/lib/lvgl/tests/makefile/Makefile new file mode 100644 index 00000000..486d1e12 --- /dev/null +++ b/lib/lvgl/tests/makefile/Makefile @@ -0,0 +1,9 @@ +LVGL_DIR := $(CURDIR)/../.. +include ../../lvgl.mk + +CSRCS += test.c +CFLAGS += -DLV_CONF_SKIP=1 -DLV_BUILD_TEST=1 -I$(LVGL_DIR)/.. +COBJS := $(patsubst %.c, %.o, $(CSRCS)) + +test_file: $(COBJS) + $(CC) -o $@ $^ diff --git a/lib/lvgl/tests/makefile/test.c b/lib/lvgl/tests/makefile/test.c new file mode 100644 index 00000000..e725ade6 --- /dev/null +++ b/lib/lvgl/tests/makefile/test.c @@ -0,0 +1,9 @@ +#if LV_BUILD_TEST +#include +#include "lvgl/lvgl.h" + +int main(void) { + lv_init(); + return 0; +} +#endif diff --git a/lib/lvgl/tests/ref_imgs/dropdown_1.png b/lib/lvgl/tests/ref_imgs/dropdown_1.png new file mode 100644 index 00000000..30bf0bb7 Binary files /dev/null and b/lib/lvgl/tests/ref_imgs/dropdown_1.png differ diff --git a/lib/lvgl/tests/ref_imgs/dropdown_2.png b/lib/lvgl/tests/ref_imgs/dropdown_2.png new file mode 100644 index 00000000..6b0b5334 Binary files /dev/null and b/lib/lvgl/tests/ref_imgs/dropdown_2.png differ diff --git a/lib/lvgl/tests/ref_imgs/scr1.png b/lib/lvgl/tests/ref_imgs/scr1.png new file mode 100644 index 00000000..f0bd8528 Binary files /dev/null and b/lib/lvgl/tests/ref_imgs/scr1.png differ diff --git a/lib/lvgl/tests/ref_imgs/table_1.png b/lib/lvgl/tests/ref_imgs/table_1.png new file mode 100644 index 00000000..193e1327 Binary files /dev/null and b/lib/lvgl/tests/ref_imgs/table_1.png differ diff --git a/lib/lvgl/tests/src/lv_test_conf.h b/lib/lvgl/tests/src/lv_test_conf.h new file mode 100644 index 00000000..d47fe638 --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_conf.h @@ -0,0 +1,47 @@ +/** + * @file lv_test_conf.h + * + */ + +#ifndef LV_TEST_CONF_H +#define LV_TEST_CONF_H + +#define LV_CONF_SUPPRESS_DEFINE_CHECK 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +/********************* + * DEFINES + *********************/ + +void lv_test_assert_fail(void); +#define LV_ASSERT_HANDLER lv_test_assert_fail(); + +/********************** + * TYPEDEFS + **********************/ + +uint32_t custom_tick_get(void); +#define LV_TICK_CUSTOM_SYS_TIME_EXPR custom_tick_get() + +typedef void * lv_user_data_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TEST_CONF_H*/ diff --git a/lib/lvgl/tests/src/lv_test_helpers.h b/lib/lvgl/tests/src/lv_test_helpers.h new file mode 100644 index 00000000..2b78c42e --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_helpers.h @@ -0,0 +1,23 @@ +#ifndef LV_TEST_HELPERS_H +#define LV_TEST_HELPERS_H + +#ifdef LVGL_CI_USING_SYS_HEAP +/* Skip checking heap as we don't have the info available */ +#define LV_HEAP_CHECK(x) do {} while(0) +/* Pick a non-zero value */ +#define lv_test_get_free_mem() (65536) +#else +#define LV_HEAP_CHECK(x) x + +static inline uint32_t lv_test_get_free_mem(void) +{ + lv_mem_monitor_t m1; + lv_mem_monitor(&m1); + return m1.free_size; +} +#endif /* LVGL_CI_USING_SYS_HEAP */ + + +#endif /*LV_TEST_HELPERS_H*/ + + diff --git a/lib/lvgl/tests/src/lv_test_indev.c b/lib/lvgl/tests/src/lv_test_indev.c new file mode 100644 index 00000000..1ac68089 --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_indev.c @@ -0,0 +1,140 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" +#include +#include + +#include +#include "lv_test_indev.h" +#include "lv_test_init.h" + +static lv_coord_t x_act; +static lv_coord_t y_act; +static uint32_t key_act; +static int32_t diff_act; +static bool mouse_pressed; +static bool key_pressed; +static bool enc_pressed; + +void lv_test_mouse_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data) +{ + LV_UNUSED(drv); + data->point.x = x_act; + data->point.y = y_act; + data->state = mouse_pressed ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; +} + +void lv_test_mouse_move_to(lv_coord_t x, lv_coord_t y) +{ + x_act = x; + y_act = y; +} + +void lv_test_mouse_move_by(lv_coord_t x, lv_coord_t y) +{ + x_act += x; + y_act += y; +} + +void lv_test_mouse_press(void) +{ + mouse_pressed = true; +} + +void lv_test_mouse_release(void) +{ + mouse_pressed = false; +} + +void lv_test_mouse_click_at(lv_coord_t x, lv_coord_t y) +{ + lv_test_mouse_release(); + lv_test_indev_wait(50); + lv_test_mouse_move_to(x, y); + lv_test_mouse_press(); + lv_test_indev_wait(50); + lv_test_mouse_release(); + lv_test_indev_wait(50); +} + + +void lv_test_keypad_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data) +{ + LV_UNUSED(drv); + data->key = key_act; + data->state = key_pressed ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; +} + +void lv_test_key_press(uint32_t k) +{ + key_act = k; + key_pressed = true; +} + +void lv_test_key_release(void) +{ + key_pressed = false; +} + +void lv_test_key_hit(uint32_t k) +{ + lv_test_key_release(); + lv_test_indev_wait(50); + lv_test_key_press(k); + lv_test_mouse_press(); + lv_test_indev_wait(50); + lv_test_key_release(); + lv_test_indev_wait(50); +} + +void lv_test_encoder_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data) +{ + LV_UNUSED(drv); + data->enc_diff = diff_act; + data->state = enc_pressed ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; + diff_act = 0; +} + +void lv_test_encoder_add_diff(int32_t d) +{ + diff_act += d; +} + +void lv_test_encoder_turn(int32_t d) +{ + diff_act += d; + lv_test_indev_wait(50); +} + + +void lv_test_encoder_press(void) +{ + enc_pressed = true; +} + +void lv_test_encoder_release(void) +{ + enc_pressed = false; +} + +void lv_test_encoder_click(void) +{ + lv_test_encoder_release(); + lv_test_indev_wait(50); + lv_test_encoder_press(); + lv_test_indev_wait(50); + lv_test_encoder_release(); + lv_test_indev_wait(50); +} + + +void lv_test_indev_wait(uint32_t ms) +{ + uint32_t t = lv_tick_get(); + while(lv_tick_elaps(t) < ms) { + lv_timer_handler(); + lv_tick_inc(1); + } +} + + +#endif diff --git a/lib/lvgl/tests/src/lv_test_indev.h b/lib/lvgl/tests/src/lv_test_indev.h new file mode 100644 index 00000000..2a0508fd --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_indev.h @@ -0,0 +1,54 @@ + +#ifndef LV_TEST_INDEV_H +#define LV_TEST_INDEV_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "../lvgl.h" + +void lv_test_mouse_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data); + +void lv_test_mouse_move_to(lv_coord_t x, lv_coord_t y); +void lv_test_mouse_move_by(lv_coord_t x, lv_coord_t y); +void lv_test_mouse_press(void); +void lv_test_mouse_release(void); +void lv_test_mouse_click_at(lv_coord_t x, lv_coord_t y); + +void lv_test_keypad_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data); + +void lv_test_key_press(uint32_t k); +void lv_test_key_release(void); +void lv_test_key_hit(uint32_t k); + +/* encoder read callback */ +void lv_test_encoder_read_cb(lv_indev_drv_t * drv, lv_indev_data_t * data) ; + +/* Simulate encoder rotation, use positive parameter to rotate to the right + * and negative to rotate to the left */ +void lv_test_encoder_add_diff(int32_t d); +/* Same as lv_test_encoder_add_diff but with additional delay */ +void lv_test_encoder_turn(int32_t d); +/* Set encoder to pressed */ +void lv_test_encoder_press(void); +/* Set encoder to released */ +void lv_test_encoder_release(void); +/* Simulate release+press+release (including delays) */ +void lv_test_encoder_click(void); + +/* Simulate delay */ +void lv_test_indev_wait(uint32_t ms); + +extern lv_indev_t * lv_test_mouse_indev; +extern lv_indev_t * lv_test_keypad_indev; +extern lv_indev_t * lv_test_encoder_indev; + + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TEST_INDEV_H*/ + diff --git a/lib/lvgl/tests/src/lv_test_init.c b/lib/lvgl/tests/src/lv_test_init.c new file mode 100644 index 00000000..8c156022 --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_init.c @@ -0,0 +1,100 @@ + +#if LV_BUILD_TEST +#include "lv_test_init.h" +#include "lv_test_indev.h" +#include +#include +#include +#include "../unity/unity.h" + +#define HOR_RES 800 +#define VER_RES 480 + +static void hal_init(void); +static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); + +lv_indev_t * lv_test_mouse_indev; +lv_indev_t * lv_test_keypad_indev; +lv_indev_t * lv_test_encoder_indev; + +lv_color_t test_fb[HOR_RES * VER_RES]; +static lv_color_t disp_buf1[HOR_RES * VER_RES]; + +void lv_test_init(void) +{ + lv_init(); + hal_init(); +} + +void lv_test_deinit(void) +{ + lv_mem_deinit(); +} + +static void hal_init(void) +{ + static lv_disp_draw_buf_t draw_buf; + + lv_disp_draw_buf_init(&draw_buf, disp_buf1, NULL, HOR_RES * VER_RES); + + static lv_disp_drv_t disp_drv; + lv_disp_drv_init(&disp_drv); + disp_drv.draw_buf = &draw_buf; + disp_drv.flush_cb = dummy_flush_cb; + disp_drv.hor_res = HOR_RES; + disp_drv.ver_res = VER_RES; + lv_disp_drv_register(&disp_drv); + + static lv_indev_drv_t indev_mouse_drv; + lv_indev_drv_init(&indev_mouse_drv); + indev_mouse_drv.type = LV_INDEV_TYPE_POINTER; + indev_mouse_drv.read_cb = lv_test_mouse_read_cb; + lv_test_mouse_indev = lv_indev_drv_register(&indev_mouse_drv); + + static lv_indev_drv_t indev_keypad_drv; + lv_indev_drv_init(&indev_keypad_drv); + indev_keypad_drv.type = LV_INDEV_TYPE_KEYPAD; + indev_keypad_drv.read_cb = lv_test_keypad_read_cb; + lv_test_keypad_indev = lv_indev_drv_register(&indev_keypad_drv); + + static lv_indev_drv_t indev_encoder_drv; + lv_indev_drv_init(&indev_encoder_drv); + indev_encoder_drv.type = LV_INDEV_TYPE_ENCODER; + indev_encoder_drv.read_cb = lv_test_encoder_read_cb; + lv_test_encoder_indev = lv_indev_drv_register(&indev_encoder_drv); +} + +static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) +{ + LV_UNUSED(area); + LV_UNUSED(color_p); + + memcpy(test_fb, color_p, lv_area_get_size(area) * sizeof(lv_color_t)); + + lv_disp_flush_ready(disp_drv); +} + +uint32_t custom_tick_get(void) +{ + static uint64_t start_ms = 0; + if(start_ms == 0) { + struct timeval tv_start; + gettimeofday(&tv_start, NULL); + start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000; + } + + struct timeval tv_now; + gettimeofday(&tv_now, NULL); + uint64_t now_ms; + now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000; + + uint32_t time_ms = now_ms - start_ms; + return time_ms; +} + +void lv_test_assert_fail(void) +{ + TEST_FAIL(); +} + +#endif diff --git a/lib/lvgl/tests/src/lv_test_init.h b/lib/lvgl/tests/src/lv_test_init.h new file mode 100644 index 00000000..dc629207 --- /dev/null +++ b/lib/lvgl/tests/src/lv_test_init.h @@ -0,0 +1,20 @@ + +#ifndef LV_TEST_INIT_H +#define LV_TEST_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include <../lvgl.h> + +void lv_test_init(void); +void lv_test_deinit(void); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TEST_INIT_H*/ + diff --git a/lib/lvgl/tests/src/test_cases/_test_template.c b/lib/lvgl/tests/src/test_cases/_test_template.c new file mode 100644 index 00000000..f340c013 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/_test_template.c @@ -0,0 +1,21 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +void setUp(void) +{ + /* Function run before every test */ +} + +void tearDown(void) +{ + /* Function run after every test */ +} + +void test_func_1(void) +{ + TEST_FAIL(); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_arc.c b/lib/lvgl/tests/src/test_cases/test_arc.c new file mode 100644 index 00000000..adb30377 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_arc.c @@ -0,0 +1,167 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" +#include "lv_test_indev.h" + +/* This function runs before each test */ +void setUp(void); + +void test_arc_creation_successfull(void); +void test_arc_should_truncate_to_max_range_when_new_value_exceeds_it(void); +void test_arc_should_truncate_to_min_range_when_new_value_is_inferior(void); +void test_arc_should_update_value_after_updating_range(void); +void test_arc_should_update_angles_when_changing_to_symmetrical_mode(void); +void test_arc_should_update_angles_when_changing_to_symmetrical_mode_value_more_than_middle_range(void); +void test_arc_angles_when_reversed(void); + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * arc = NULL; +static uint32_t event_cnt; + +static void dummy_event_cb(lv_event_t * e); + +void setUp(void) +{ + active_screen = lv_scr_act(); +} + +void test_arc_creation_successfull(void) +{ + arc = lv_arc_create(active_screen); + + TEST_ASSERT_NOT_NULL(arc); +} + +void test_arc_should_truncate_to_max_range_when_new_value_exceeds_it(void) +{ + /* Default max range is 100 */ + int16_t value_after_truncation = 100; + + arc = lv_arc_create(active_screen); + + lv_arc_set_value(arc, 200); + + TEST_ASSERT_EQUAL_INT16(value_after_truncation, lv_arc_get_value(arc)); +} + +void test_arc_should_truncate_to_min_range_when_new_value_is_inferior(void) +{ + /* Default min range is 100 */ + int16_t value_after_truncation = 0; + + arc = lv_arc_create(active_screen); + + lv_arc_set_value(arc, 0); + + TEST_ASSERT_EQUAL_INT16(value_after_truncation, lv_arc_get_value(arc)); +} + +void test_arc_should_update_value_after_updating_range(void) +{ + int16_t value_after_updating_max_range = 50; + int16_t value_after_updating_min_range = 30; + + arc = lv_arc_create(active_screen); + + lv_arc_set_value(arc, 80); + lv_arc_set_range(arc, 1, 50); + + TEST_ASSERT_EQUAL_INT16(value_after_updating_max_range, lv_arc_get_value(arc)); + + lv_arc_set_value(arc, 10); + lv_arc_set_range(arc, 30, 50); + + TEST_ASSERT_EQUAL_INT16(value_after_updating_min_range, lv_arc_get_value(arc)); +} + +void test_arc_should_update_angles_when_changing_to_symmetrical_mode(void) +{ + int16_t expected_angle_start = 135; + int16_t expected_angle_end = 270; + + /* start angle is 135, end angle is 45 at creation */ + arc = lv_arc_create(active_screen); + lv_arc_set_mode(arc, LV_ARC_MODE_SYMMETRICAL); + + TEST_ASSERT_EQUAL_INT16(expected_angle_start, lv_arc_get_angle_start(arc)); + TEST_ASSERT_EQUAL_INT16(expected_angle_end, lv_arc_get_angle_end(arc)); +} + +void test_arc_should_update_angles_when_changing_to_symmetrical_mode_value_more_than_middle_range(void) +{ + int16_t expected_angle_start = 270; + int16_t expected_angle_end = 45; + + /* start angle is 135, end angle is 45 at creation */ + arc = lv_arc_create(active_screen); + lv_arc_set_value(arc, 100); + lv_arc_set_mode(arc, LV_ARC_MODE_SYMMETRICAL); + + TEST_ASSERT_EQUAL_INT16(expected_angle_start, lv_arc_get_angle_start(arc)); + TEST_ASSERT_EQUAL_INT16(expected_angle_end, lv_arc_get_angle_end(arc)); +} + +/* See #2522 for more information */ +void test_arc_angles_when_reversed(void) +{ + uint16_t expected_start_angle = 54; + uint16_t expected_end_angle = 90; + int16_t expected_value = 40; + + lv_obj_t * arcBlack; + arcBlack = lv_arc_create(lv_scr_act()); + + lv_arc_set_mode(arcBlack, LV_ARC_MODE_REVERSE); + + lv_arc_set_bg_angles(arcBlack, 0, 90); + + lv_arc_set_value(arcBlack, expected_value); + + TEST_ASSERT_EQUAL_UINT16(expected_start_angle, lv_arc_get_angle_start(arcBlack)); + TEST_ASSERT_EQUAL_UINT16(expected_end_angle, lv_arc_get_angle_end(arcBlack)); + TEST_ASSERT_EQUAL_INT16(expected_value, lv_arc_get_value(arcBlack)); +} + +void test_arc_click_area_with_adv_hittest(void) +{ + arc = lv_arc_create(lv_scr_act()); + lv_obj_set_size(arc, 100, 100); + lv_obj_set_style_arc_width(arc, 10, 0); + lv_obj_add_flag(arc, LV_OBJ_FLAG_ADV_HITTEST); + lv_obj_add_event_cb(arc, dummy_event_cb, LV_EVENT_VALUE_CHANGED, NULL); + lv_obj_set_ext_click_area(arc, 5); + + /*No click detected at the middle*/ + event_cnt = 0; + lv_test_mouse_click_at(50, 50); + TEST_ASSERT_EQUAL_UINT32(0, event_cnt); + + /*No click close to the radius - bg_arc - ext_click_area*/ + event_cnt = 0; + lv_test_mouse_click_at(83, 50); + TEST_ASSERT_EQUAL_UINT32(0, event_cnt); + + /*Click on the radius - bg_arc - ext_click_area*/ + event_cnt = 0; + lv_test_mouse_click_at(86, 50); + TEST_ASSERT_GREATER_THAN(0, event_cnt); + + /*Click on the radius + ext_click_area*/ + event_cnt = 0; + lv_test_mouse_click_at(104, 50); + TEST_ASSERT_GREATER_THAN(0, event_cnt); + + /*No click beyond to the radius + ext_click_area*/ + event_cnt = 0; + lv_test_mouse_click_at(106, 50); + TEST_ASSERT_EQUAL_UINT32(0, event_cnt); +} + +static void dummy_event_cb(lv_event_t * e) +{ + LV_UNUSED(e); + event_cnt++; +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_bar.c b/lib/lvgl/tests/src/test_cases/test_bar.c new file mode 100644 index 00000000..14eacbe0 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_bar.c @@ -0,0 +1,253 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +#include "lv_test_indev.h" + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * bar = NULL; + +void setUp(void) +{ + active_screen = lv_scr_act(); + bar = lv_bar_create(active_screen); +} + +void tearDown(void) +{ +} + +void test_bar_should_have_valid_default_attributes(void) +{ + TEST_ASSERT_EQUAL(0, lv_bar_get_min_value(bar)); + TEST_ASSERT_EQUAL(100, lv_bar_get_max_value(bar)); + TEST_ASSERT_EQUAL(LV_BAR_MODE_NORMAL, lv_bar_get_mode(bar)); +} + +/* + * Bar has two parts, main and indicator, coordinates of the latter are + * calculated based on: + * - Bar size + * - Bar (main part) padding + * - Bar value + * - Bar coordinates + * - Bar base direction + * See Boxing model in docs for reference. + * + * Bar properties assumed: + * - mode: LV_BAR_MODE_NORMAL + * - min value: 0 + * - max value: 100 + * - base direction: LTR + */ +void test_bar_should_update_indicator_right_coordinate_based_on_bar_value(void) +{ + lv_bar_t * bar_ptr = (lv_bar_t *) bar; + + static lv_style_t bar_style; + + const lv_coord_t style_padding = 5u; + const lv_coord_t bar_width = 200u; + const lv_coord_t bar_height = 20u; + int32_t bar_value = 10u; + + lv_style_init(&bar_style); + lv_style_set_pad_all(&bar_style, style_padding); + + /* Setup new style */ + lv_obj_remove_style_all(bar); + lv_obj_add_style(bar, &bar_style, LV_PART_MAIN); + + /* Set properties */ + lv_obj_set_size(bar, bar_width, bar_height); + lv_bar_set_value(bar, bar_value, LV_ANIM_OFF); + + /* FIXME: Remove wait */ + lv_test_indev_wait(50); + + int32_t actual_coord = lv_area_get_width(&bar_ptr->indic_area); + + /* Calculate bar indicator right coordinate, using rule of 3 */ + lv_coord_t bar_max_value = lv_bar_get_max_value(bar); + lv_coord_t indicator_part_width = lv_obj_get_content_width(bar); + lv_coord_t sides_padding = lv_obj_get_style_pad_left(bar, LV_PART_MAIN); + sides_padding += lv_obj_get_style_pad_right(bar, LV_PART_MAIN); + + int32_t expected_coord = (bar_value * indicator_part_width) / bar_max_value; + /* NOTE: Add 1 to calculation because the coordinates start at 0 */ + expected_coord += 1; + + TEST_ASSERT_EQUAL_INT32(expected_coord, actual_coord); +} + +/* + * Bar has two parts, main and indicator, coordinates of the latter are + * calculated based on: + * - Bar size + * - Bar (main part) padding + * - Bar value + * - Bar coordinates + * - Bar base direction + * See Boxing model in docs for reference. + * + * Bar properties assumed: + * - mode: LV_BAR_MODE_NORMAL + * - min value: 0 + * - max value: 100 + */ +void test_bar_rtl_should_update_indicator_left_coordinate_based_on_bar_value(void) +{ + lv_bar_t * bar_ptr = (lv_bar_t *) bar; + + static lv_style_t bar_style; + + const lv_coord_t style_padding = 5u; + const lv_coord_t bar_width = 200u; + const lv_coord_t bar_height = 20u; + int32_t bar_value = 10u; + + lv_style_init(&bar_style); + lv_style_set_pad_all(&bar_style, style_padding); + + /* Setup new style */ + lv_obj_remove_style_all(bar); + lv_obj_add_style(bar, &bar_style, LV_PART_MAIN); + + /* Set properties */ + lv_obj_set_size(bar, bar_width, bar_height); + lv_bar_set_value(bar, bar_value, LV_ANIM_OFF); + lv_obj_set_style_base_dir(bar, LV_BASE_DIR_RTL, 0); + + /* FIXME: Remove wait */ + lv_test_indev_wait(50); + + int32_t actual_coord = bar_ptr->indic_area.x1; + + /* Calculate current indicator width */ + lv_coord_t bar_max_value = lv_bar_get_max_value(bar); + lv_coord_t indicator_part_width = lv_obj_get_content_width(bar); + lv_coord_t right_padding = lv_obj_get_style_pad_right(bar, LV_PART_MAIN); + int32_t indicator_width = (bar_value * indicator_part_width) / bar_max_value; + + int32_t expected_coord = (bar_width - right_padding) - indicator_width; + expected_coord -= 1; + + TEST_ASSERT_EQUAL_INT32(expected_coord, actual_coord); +} + +void test_bar_indicator_area_should_get_smaller_when_padding_is_increased(void) +{ + lv_bar_t * bar_ptr = (lv_bar_t *) bar; + + const lv_coord_t style_padding = 10u; + static lv_style_t bar_style; + + int32_t new_height = 0u; + int32_t new_width = 0u; + int32_t original_height = 0u; + int32_t original_width = 0u; + + lv_bar_set_value(bar, 50, LV_ANIM_OFF); + lv_test_indev_wait(50); + + original_width = lv_area_get_width(&bar_ptr->indic_area); + original_height = lv_area_get_height(&bar_ptr->indic_area); + + /* Setup new padding */ + lv_style_init(&bar_style); + lv_style_set_pad_all(&bar_style, style_padding); + lv_obj_set_size(bar, 100, 50); + + /* Apply new style */ + lv_obj_remove_style_all(bar); + lv_obj_add_style(bar, &bar_style, LV_PART_MAIN); + + /* Notify LVGL of style change */ + lv_obj_report_style_change(&bar_style); + lv_test_indev_wait(50); + + new_height = lv_area_get_height(&bar_ptr->indic_area); + new_width = lv_area_get_width(&bar_ptr->indic_area); + + TEST_ASSERT_LESS_THAN_INT32(original_height, new_height); + TEST_ASSERT_LESS_THAN_INT32(original_width, new_width); +} + +void test_bar_start_value_should_only_change_when_in_range_mode(void) +{ + int32_t new_start_value = 20u; + + lv_bar_set_value(bar, 90, LV_ANIM_OFF); + lv_bar_set_start_value(bar, new_start_value, LV_ANIM_OFF); + + /* Start value shouldn't be updated when not in RANGE mode */ + TEST_ASSERT_EQUAL_INT32(0u, lv_bar_get_start_value(bar)); + + /* Set bar in RANGE mode so we can edit the start value */ + lv_bar_set_mode(bar, LV_BAR_MODE_RANGE); + lv_bar_set_start_value(bar, new_start_value, LV_ANIM_OFF); + + TEST_ASSERT_EQUAL_INT32(new_start_value, lv_bar_get_start_value(bar)); +} + +void test_bar_start_value_should_be_smaller_than_current_value_in_range_mode(void) +{ + /* Set bar in RANGE mode so we can edit the start value */ + lv_bar_set_mode(bar, LV_BAR_MODE_RANGE); + lv_bar_set_value(bar, 50, LV_ANIM_OFF); + lv_bar_set_start_value(bar, 100u, LV_ANIM_OFF); + + TEST_ASSERT_EQUAL_INT32(lv_bar_get_value(bar), lv_bar_get_start_value(bar)); +} + +void test_bar_current_value_should_be_truncated_to_max_value_when_exceeds_it(void) +{ + int32_t max_value = lv_bar_get_max_value(bar); + int32_t new_value = max_value + 1u; + + lv_bar_set_value(bar, new_value, LV_ANIM_OFF); + TEST_ASSERT_EQUAL_INT32(max_value, lv_bar_get_value(bar)); +} + +void test_bar_current_value_should_be_truncated_to_min_value_when_it_is_below_it(void) +{ + int32_t min_value = lv_bar_get_min_value(bar); + int32_t new_value = min_value - 1u; + + lv_bar_set_value(bar, new_value, LV_ANIM_OFF); + TEST_ASSERT_EQUAL_INT32(min_value, lv_bar_get_value(bar)); +} + +/** When in symmetrical mode, the bar indicator has to be drawn towards the min + * range value. Requires a negative min range value and a positive max range + * value. + * + * Bar properties assumed: + * - base direction: LTR + */ +void test_bar_indicator_should_be_drawn_towards_the_min_range_side_after_setting_a_more_negative_value(void) +{ + lv_bar_t * bar_ptr = (lv_bar_t *) bar; + + /* Setup bar properties */ + lv_obj_set_size(bar, 100, 50); + lv_bar_set_mode(bar, LV_BAR_MODE_SYMMETRICAL); + lv_bar_set_range(bar, -100, 100); + + /* Set bar value to 1, so it gets drawn at the middle of the bar */ + lv_bar_set_value(bar, 1, LV_ANIM_OFF); + lv_test_indev_wait(50); + + lv_coord_t original_pos = bar_ptr->indic_area.x1; + + /* Set bar to a more negative value */ + lv_bar_set_value(bar, -50, LV_ANIM_OFF); + lv_test_indev_wait(50); + + lv_coord_t final_pos = bar_ptr->indic_area.x1; + + TEST_ASSERT_LESS_THAN(original_pos, final_pos); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_checkbox.c b/lib/lvgl/tests/src/test_cases/test_checkbox.c new file mode 100644 index 00000000..1d98570f --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_checkbox.c @@ -0,0 +1,96 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +#include "lv_test_helpers.h" +#include "lv_test_indev.h" + +void test_checkbox_creation_successfull(void); +void test_checkbox_should_call_event_handler_on_click_when_enabled(void); +void test_checkbox_should_have_default_text_when_created(void); +void test_checkbox_should_return_dinamically_allocated_text(void); +void test_checkbox_should_allocate_memory_for_static_text(void); + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * checkbox = NULL; + +static volatile bool event_called = false; + +static void event_handler(lv_event_t * e) +{ + lv_event_code_t code = lv_event_get_code(e); + + if(LV_EVENT_VALUE_CHANGED == code) { + event_called = true; + } +} + +void test_checkbox_creation_successfull(void) +{ + active_screen = lv_scr_act(); + checkbox = lv_checkbox_create(active_screen); + + TEST_ASSERT_NOT_NULL(checkbox); +} + +void test_checkbox_should_call_event_handler_on_click_when_enabled(void) +{ + active_screen = lv_scr_act(); + checkbox = lv_checkbox_create(active_screen); + + lv_obj_add_state(checkbox, LV_STATE_CHECKED); + lv_obj_add_event_cb(checkbox, event_handler, LV_EVENT_ALL, NULL); + + lv_test_mouse_click_at(checkbox->coords.x1, checkbox->coords.y1); + + TEST_ASSERT_TRUE(event_called); + + event_called = false; +} + +void test_checkbox_should_have_default_text_when_created(void) +{ + const char * default_text = "Check box"; + + active_screen = lv_scr_act(); + checkbox = lv_checkbox_create(active_screen); + + TEST_ASSERT_EQUAL_STRING(default_text, lv_checkbox_get_text(checkbox)); + TEST_ASSERT_NOT_NULL(lv_checkbox_get_text(checkbox)); +} + +void test_checkbox_should_return_dinamically_allocated_text(void) +{ + const char * message = "Hello World!"; + + active_screen = lv_scr_act(); + checkbox = lv_checkbox_create(active_screen); + + lv_checkbox_set_text(checkbox, message); + + TEST_ASSERT_EQUAL_STRING(message, lv_checkbox_get_text(checkbox)); + TEST_ASSERT_NOT_NULL(lv_checkbox_get_text(checkbox)); +} + +void test_checkbox_should_allocate_memory_for_static_text(void) +{ + uint32_t initial_available_memory = 0; + const char * static_text = "Keep me while you exist"; + + lv_mem_monitor_t m1; + lv_mem_monitor(&m1); + + active_screen = lv_scr_act(); + checkbox = lv_checkbox_create(active_screen); + + initial_available_memory = m1.free_size; + + lv_checkbox_set_text_static(checkbox, static_text); + + lv_mem_monitor(&m1); + + LV_HEAP_CHECK(TEST_ASSERT_LESS_THAN(initial_available_memory, m1.free_size)); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_config.c b/lib/lvgl/tests/src/test_cases/test_config.c new file mode 100644 index 00000000..13672de5 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_config.c @@ -0,0 +1,19 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +void test_config(void); + +void test_config(void) +{ + TEST_ASSERT_EQUAL(130, LV_DPI_DEF); + TEST_ASSERT_EQUAL(130, lv_disp_get_dpi(NULL)); + TEST_ASSERT_EQUAL(800, LV_HOR_RES); + TEST_ASSERT_EQUAL(800, lv_disp_get_hor_res(NULL)); + TEST_ASSERT_EQUAL(480, LV_VER_RES); + TEST_ASSERT_EQUAL(480, lv_disp_get_ver_res(NULL)); + TEST_ASSERT_EQUAL(32, LV_COLOR_DEPTH); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_demo_stress.c b/lib/lvgl/tests/src/test_cases/test_demo_stress.c new file mode 100644 index 00000000..929ae3bf --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_demo_stress.c @@ -0,0 +1,32 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" +#include "../demos/lv_demos.h" + +#include "unity/unity.h" + +#include "lv_test_helpers.h" +#include "lv_test_indev.h" + +static void loop_through_stress_test(void) +{ +#if LV_USE_DEMO_STRESS + lv_test_indev_wait(LV_DEMO_STRESS_TIME_STEP * 33); /* FIXME: remove magic number of states */ +#endif +} +void test_demo_stress(void) +{ +#if LV_USE_DEMO_STRESS + lv_demo_stress(); +#endif + /* loop once to allow objects to be created */ + loop_through_stress_test(); + uint32_t mem_before = lv_test_get_free_mem(); + /* loop 10 more times */ + for(uint32_t i = 0; i < 10; i++) { + loop_through_stress_test(); + } + TEST_ASSERT_EQUAL(mem_before, lv_test_get_free_mem()); +} + +#endif + diff --git a/lib/lvgl/tests/src/test_cases/test_demo_widgets.c b/lib/lvgl/tests/src/test_cases/test_demo_widgets.c new file mode 100644 index 00000000..48ba758f --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_demo_widgets.c @@ -0,0 +1,18 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" +#include "../demos/lv_demos.h" + +#include "unity/unity.h" + +#include "lv_test_helpers.h" +#include "lv_test_indev.h" + +void test_demo_widgets(void) +{ +#if LV_USE_DEMO_WIDGETS + lv_demo_widgets(); +#endif +} + +#endif + diff --git a/lib/lvgl/tests/src/test_cases/test_dropdown.c b/lib/lvgl/tests/src/test_cases/test_dropdown.c new file mode 100644 index 00000000..a49cc1d5 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_dropdown.c @@ -0,0 +1,445 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" +#include "lv_test_indev.h" + +void setUp(void) +{ + /* Function run before every test */ +} + +void tearDown(void) +{ + /* Function run after every test */ + lv_obj_clean(lv_scr_act()); +} +void test_dropdown_create_delete(void) +{ + lv_dropdown_create(lv_scr_act()); + TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(lv_scr_act())); + + lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd2, 200, 0); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + lv_dropdown_open(dd2); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd2)); + lv_dropdown_open(dd2); /*Try to open again*/ + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + + lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd3, 400, 0); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + lv_dropdown_open(dd3); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + lv_dropdown_close(dd3); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + lv_dropdown_close(dd3); /*Try to close again*/ + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + + lv_obj_del(dd2); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + + lv_obj_clean(lv_scr_act()); + TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(lv_scr_act())); + +} + +void test_dropdown_set_options(void) +{ + + lv_mem_monitor_t m1; + lv_mem_monitor(&m1); + + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + TEST_ASSERT_EQUAL_STRING("Option 1\nOption 2\nOption 3", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(3, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_set_options(dd1, "a1\nb2\nc3\nd4\ne5\nf6"); + TEST_ASSERT_EQUAL_STRING("a1\nb2\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(6, lv_dropdown_get_option_cnt(dd1)); + + lv_obj_set_width(dd1, 200); + lv_dropdown_open(dd1); + lv_obj_update_layout(dd1); + TEST_ASSERT_EQUAL(200, lv_obj_get_width(lv_dropdown_get_list(dd1))); + + lv_dropdown_close(dd1); + + lv_dropdown_add_option(dd1, "x0", 0); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(7, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_add_option(dd1, "y0", 3); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\ny0\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(8, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_add_option(dd1, "z0", LV_DROPDOWN_POS_LAST); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\ny0\nc3\nd4\ne5\nf6\nz0", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(9, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_clear_options(dd1); + TEST_ASSERT_EQUAL_STRING("", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(0, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_set_options(dd1, "o1\no2"); /*Just to add some content before lv_dropdown_set_options_static*/ + + lv_dropdown_set_options_static(dd1, "a1\nb2\nc3\nd4\ne5\nf6"); + TEST_ASSERT_EQUAL_STRING("a1\nb2\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(6, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_add_option(dd1, "x0", 0); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(7, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_add_option(dd1, "y0", 3); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\ny0\nc3\nd4\ne5\nf6", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(8, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_add_option(dd1, "z0", LV_DROPDOWN_POS_LAST); + TEST_ASSERT_EQUAL_STRING("x0\na1\nb2\ny0\nc3\nd4\ne5\nf6\nz0", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(9, lv_dropdown_get_option_cnt(dd1)); + + lv_dropdown_clear_options(dd1); + TEST_ASSERT_EQUAL_STRING("", lv_dropdown_get_options(dd1)); + TEST_ASSERT_EQUAL(0, lv_dropdown_get_option_cnt(dd1)); + + lv_obj_del(dd1); + + lv_mem_monitor_t m2; + lv_mem_monitor(&m2); + TEST_ASSERT_UINT32_WITHIN(48, m1.free_size, m2.free_size); +} + +void test_dropdown_select(void) +{ + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_selected(dd1, 2); + + TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); + + char buf[32]; + memset(buf, 0x00, sizeof(buf)); + lv_dropdown_get_selected_str(dd1, buf, sizeof(buf)); + TEST_ASSERT_EQUAL_STRING("Option 3", buf); + + memset(buf, 0x00, sizeof(buf)); + lv_dropdown_get_selected_str(dd1, buf, 4); + TEST_ASSERT_EQUAL_STRING("Opt", buf); + + /*Out of range*/ + lv_dropdown_set_selected(dd1, 3); + TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); +} + +void test_dropdown_click(void) +{ + lv_obj_clean(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_update_layout(dd1); + + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + lv_test_mouse_click_at(dd1->coords.x1 + 5, dd1->coords.y1 + 5); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd1)); + + lv_obj_t * list = lv_dropdown_get_list(dd1); + TEST_ASSERT_EQUAL(0, lv_dropdown_get_selected(dd1)); + lv_test_mouse_click_at(list->coords.x1 + 5, list->coords.y2 - 25); + TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); +} + +static uint32_t event_cnt; +static void dd_event(lv_event_t * e) +{ + LV_UNUSED(e); + event_cnt++; +} + +void test_dropdown_keypad(void) +{ + lv_obj_clean(lv_scr_act()); + + lv_group_t * g = lv_group_create(); + lv_indev_set_group(lv_test_keypad_indev, g); + + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd1, 20, 20); + lv_dropdown_set_options(dd1, "1\n2\n3\n4\n5\n6\n7\n8"); + lv_group_add_obj(g, dd1); + lv_obj_add_event_cb(dd1, dd_event, LV_EVENT_VALUE_CHANGED, NULL); + + lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd2, 300, 20); + lv_group_add_obj(g, dd2); + + event_cnt = 0; + + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_RIGHT); /*Same as down*/ + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(1, event_cnt); + + lv_test_key_hit(LV_KEY_DOWN); /*Open the list too*/ + TEST_ASSERT_NOT_NULL(lv_dropdown_get_list(dd1)); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(3, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(2, event_cnt); + + lv_test_key_hit(LV_KEY_RIGHT); /*Open the list too*/ + TEST_ASSERT_NOT_NULL(lv_dropdown_get_list(dd1)); + lv_test_key_hit(LV_KEY_RIGHT); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(4, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(3, event_cnt); + + lv_test_key_hit(LV_KEY_LEFT); /*Open the list too*/ + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd1)); + lv_test_key_hit(LV_KEY_LEFT); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(3, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(4, event_cnt); + + lv_test_key_hit(LV_KEY_UP); /*Open the list too*/ + TEST_ASSERT_NOT_NULL(lv_dropdown_get_list(dd1)); + lv_test_key_hit(LV_KEY_UP); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(5, event_cnt); + + lv_test_key_hit(LV_KEY_UP); + lv_test_key_hit(LV_KEY_UP); + lv_test_key_hit(LV_KEY_UP); + lv_test_key_hit(LV_KEY_UP); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(0, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(6, event_cnt); + + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_DOWN); + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(7, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(7, event_cnt); + + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd1)); + + lv_test_key_hit(LV_KEY_NEXT); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + + lv_test_key_hit(LV_KEY_ENTER); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_NOT_NULL(lv_dropdown_get_list(dd2)); + + lv_indev_set_group(lv_test_keypad_indev, NULL); + lv_group_del(g); +} + + +void test_dropdown_encoder(void) +{ + lv_obj_clean(lv_scr_act()); + + lv_group_t * g = lv_group_create(); + lv_indev_set_group(lv_test_encoder_indev, g); + + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd1, 20, 20); + lv_dropdown_set_options(dd1, "1\n2\n3\n4\n5\n6\n7\n8"); + lv_group_add_obj(g, dd1); + lv_obj_add_event_cb(dd1, dd_event, LV_EVENT_VALUE_CHANGED, NULL); + + lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd2, 300, 20); + lv_group_add_obj(g, dd2); + + event_cnt = 0; + + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + lv_test_encoder_click(); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); + + lv_test_encoder_turn(5); + lv_test_encoder_click(); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(5, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(1, event_cnt); + + lv_test_encoder_click(); + lv_test_encoder_turn(-1); + lv_test_encoder_click(); + TEST_ASSERT_EQUAL(4, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(2, event_cnt); + + lv_test_encoder_click(); + lv_test_encoder_turn(2); + lv_test_encoder_press(); + lv_test_indev_wait(1000); //Long press + lv_test_encoder_release(); + lv_test_indev_wait(50); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_EQUAL(4, lv_dropdown_get_selected(dd1)); + TEST_ASSERT_EQUAL(2, event_cnt); + + lv_test_encoder_turn(1); + lv_test_encoder_click(); + TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); + TEST_ASSERT_TRUE(lv_dropdown_is_open(dd2)); + + lv_indev_set_group(lv_test_encoder_indev, NULL); + lv_group_del(g); +} + + +void test_dropdown_render_1(void) +{ + lv_obj_clean(lv_scr_act()); + + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd1, 10, 10); + lv_dropdown_set_selected(dd1, 1); + + lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_pos(dd2, 200, 10); + lv_obj_set_width(dd2, 200); + lv_dropdown_set_selected(dd2, 2); + lv_dropdown_open(dd2); + TEST_ASSERT_TRUE(lv_dropdown_get_selected_highlight(dd2)); + lv_dropdown_set_selected_highlight(dd2, false); + TEST_ASSERT_FALSE(lv_dropdown_get_selected_highlight(dd2)); + + lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_obj_set_style_pad_hor(dd3, 5, 0); + lv_obj_set_style_pad_ver(dd3, 20, 0); + lv_obj_set_pos(dd3, 500, 150); + TEST_ASSERT_EQUAL_PTR(NULL, lv_dropdown_get_text(dd3)); + lv_dropdown_set_text(dd3, "A text"); + TEST_ASSERT_EQUAL_STRING("A text", lv_dropdown_get_text(dd3)); + + lv_dropdown_set_selected(dd3, 2); + + TEST_ASSERT_EQUAL(LV_DIR_BOTTOM, lv_dropdown_get_dir(dd3)); + lv_dropdown_set_dir(dd3, LV_DIR_LEFT); + TEST_ASSERT_EQUAL(LV_DIR_LEFT, lv_dropdown_get_dir(dd3)); + + TEST_ASSERT_EQUAL_STRING(LV_SYMBOL_DOWN, lv_dropdown_get_symbol(dd3)); + lv_dropdown_set_symbol(dd3, LV_SYMBOL_LEFT); + TEST_ASSERT_EQUAL_STRING(LV_SYMBOL_LEFT, lv_dropdown_get_symbol(dd3)); + + lv_dropdown_set_options(dd3, "a0\na1\na2\na3\na4\na5\na6\na7\na8\na9\na10\na11\na12\na13\na14\na15\na16"); + lv_dropdown_open(dd3); + lv_dropdown_set_selected(dd3, 3); + lv_obj_t * list = lv_dropdown_get_list(dd3); + lv_obj_set_style_text_line_space(list, 5, 0); + lv_obj_set_style_bg_color(list, lv_color_hex3(0xf00), LV_PART_SELECTED | LV_STATE_CHECKED); + + + TEST_ASSERT_EQUAL_SCREENSHOT("dropdown_1.png"); +} + +void test_dropdown_render_2(void) +{ + lv_obj_clean(lv_scr_act()); + LV_IMG_DECLARE(img_caret_down); + lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd1, "Short"); + lv_dropdown_set_options(dd1, "1\n2"); + lv_dropdown_set_symbol(dd1, &img_caret_down); + lv_dropdown_open(dd1); + + lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd2, "Go Up"); + lv_dropdown_set_options(dd2, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); + lv_dropdown_set_symbol(dd2, NULL); + lv_obj_align(dd2, LV_ALIGN_LEFT_MID, 150, 50); + lv_dropdown_open(dd2); + + lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd3, "Limit Down"); + lv_dropdown_set_options(dd3, "1aaaaaaaaaaaaaaaa\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); + lv_obj_align(dd3, LV_ALIGN_LEFT_MID, 300, -10); + lv_dropdown_open(dd3); + + lv_obj_t * dd4 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd4, "Limit Top"); + lv_dropdown_set_options(dd4, "1aaaaaaaaaaaaaaaa\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); + lv_obj_align(dd4, LV_ALIGN_LEFT_MID, 450, 10); + lv_dropdown_set_dir(dd4, LV_DIR_TOP); + lv_dropdown_set_symbol(dd4, LV_SYMBOL_UP); + lv_dropdown_open(dd4); + + lv_obj_t * dd5 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd5, "Go Down"); + lv_dropdown_set_options(dd5, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); + lv_dropdown_set_dir(dd5, LV_DIR_TOP); + lv_dropdown_set_symbol(dd5, LV_SYMBOL_UP); + lv_obj_align(dd5, LV_ALIGN_LEFT_MID, 650, -200); + lv_dropdown_open(dd5); + + lv_obj_t * dd6 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd6, "Right"); + lv_dropdown_set_options(dd6, "1aaa\n2aa\n3aa"); + lv_dropdown_set_dir(dd6, LV_DIR_RIGHT); + lv_dropdown_set_symbol(dd6, LV_SYMBOL_RIGHT); + lv_obj_align(dd6, LV_ALIGN_BOTTOM_LEFT, 20, -20); + lv_dropdown_open(dd6); + lv_obj_set_style_text_align(lv_dropdown_get_list(dd6), LV_TEXT_ALIGN_RIGHT, 0); + + lv_obj_t * dd7 = lv_dropdown_create(lv_scr_act()); + lv_dropdown_set_text(dd7, "Left"); + lv_dropdown_set_options(dd7, "1aaa\n2\n3"); + lv_dropdown_set_dir(dd7, LV_DIR_LEFT); + lv_dropdown_set_symbol(dd7, LV_SYMBOL_LEFT); + lv_obj_align(dd7, LV_ALIGN_BOTTOM_RIGHT, -20, -20); + lv_dropdown_open(dd7); + + TEST_ASSERT_EQUAL_SCREENSHOT("dropdown_2.png"); +} + +/* See #2893 */ +void test_dropdown_should_list_on_top(void) +{ + lv_obj_t * cont1 = lv_obj_create(lv_scr_act()); + lv_obj_set_size(cont1, 200, 100); + + lv_obj_t * dd = lv_dropdown_create(cont1); + + lv_obj_t * cont2 = lv_obj_create(lv_scr_act()); + lv_obj_set_size(cont2, 200, 100); + lv_obj_set_pos(cont2, 0, 100); + + lv_dropdown_open(dd); + lv_obj_t * list = lv_dropdown_get_list(dd); + TEST_ASSERT_EQUAL_PTR(lv_scr_act(), lv_obj_get_parent(list)); + TEST_ASSERT_EQUAL_INT(2, lv_obj_get_index(list)); +} + + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_event.c b/lib/lvgl/tests/src/test_cases/test_event.c new file mode 100644 index 00000000..0ef4186d --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_event.c @@ -0,0 +1,27 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +static void event_object_deletion_cb(const lv_obj_class_t * cls, lv_event_t * e) +{ + LV_UNUSED(cls); + if(lv_event_get_code(e) == LV_EVENT_VALUE_CHANGED) { + lv_obj_del(lv_event_get_current_target(e)); + } +} + +static const lv_obj_class_t event_object_deletion_class = { + .event_cb = event_object_deletion_cb, + .base_class = &lv_obj_class +}; + + +/* Checks for memory leaks/invalid memory accesses on deleted objects */ +void test_event_object_deletion(void) +{ + lv_obj_t * obj = lv_obj_class_create_obj(&event_object_deletion_class, lv_scr_act()); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_font_loader.c b/lib/lvgl/tests/src/test_cases/test_font_loader.c new file mode 100644 index 00000000..c1675bb8 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_font_loader.c @@ -0,0 +1,220 @@ +/** + * @file test_font_loader.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#if LV_BUILD_TEST +#include "../../lvgl.h" + +#include "unity/unity.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static int compare_fonts(lv_font_t * f1, lv_font_t * f2); +void test_font_loader(void); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +extern lv_font_t font_1; +extern lv_font_t font_2; +extern lv_font_t font_3; + +void test_font_loader(void) +{ + /*Test with cahce ('A' has cache)*/ + lv_font_t * font_1_bin = lv_font_load("A:src/test_fonts/font_1.fnt"); + lv_font_t * font_2_bin = lv_font_load("A:src/test_fonts/font_2.fnt"); + lv_font_t * font_3_bin = lv_font_load("A:src/test_fonts/font_3.fnt"); + + compare_fonts(&font_1, font_1_bin); + compare_fonts(&font_2, font_2_bin); + compare_fonts(&font_3, font_3_bin); + + lv_font_free(font_1_bin); + lv_font_free(font_2_bin); + lv_font_free(font_3_bin); + + /*Test with cahce ('B' has NO cache)*/ + font_1_bin = lv_font_load("B:src/test_fonts/font_1.fnt"); + font_2_bin = lv_font_load("B:src/test_fonts/font_2.fnt"); + font_3_bin = lv_font_load("B:src/test_fonts/font_3.fnt"); + + compare_fonts(&font_1, font_1_bin); + compare_fonts(&font_2, font_2_bin); + compare_fonts(&font_3, font_3_bin); + + lv_font_free(font_1_bin); + lv_font_free(font_2_bin); + lv_font_free(font_3_bin); +} + +static int compare_fonts(lv_font_t * f1, lv_font_t * f2) +{ + TEST_ASSERT_NOT_NULL_MESSAGE(f1, "font not null"); + TEST_ASSERT_NOT_NULL_MESSAGE(f2, "font not null"); + + // Skip these test because -Wpedantic tells + // ISO C forbids passing argument 1 of ‘TEST_ASSERT_EQUAL_PTR_MESSAGE’ between function pointer and ‘void *’ + // TEST_ASSERT_EQUAL_PTR_MESSAGE(f1->get_glyph_dsc, f2->get_glyph_dsc, "glyph_dsc"); + // TEST_ASSERT_EQUAL_PTR_MESSAGE(f1->get_glyph_bitmap, f2->get_glyph_bitmap, "glyph_bitmap"); + + TEST_ASSERT_EQUAL_INT_MESSAGE(f1->line_height, f2->line_height, "line_height"); + TEST_ASSERT_EQUAL_INT_MESSAGE(f1->base_line, f2->base_line, "base_line"); + TEST_ASSERT_EQUAL_INT_MESSAGE(f1->subpx, f2->subpx, "subpx"); + lv_font_fmt_txt_dsc_t * dsc1 = (lv_font_fmt_txt_dsc_t *)f1->dsc; + lv_font_fmt_txt_dsc_t * dsc2 = (lv_font_fmt_txt_dsc_t *)f2->dsc; + + TEST_ASSERT_EQUAL_INT_MESSAGE(dsc1->kern_scale, dsc2->kern_scale, "kern_scale"); + TEST_ASSERT_EQUAL_INT_MESSAGE(dsc1->cmap_num, dsc2->cmap_num, "cmap_num"); + TEST_ASSERT_EQUAL_INT_MESSAGE(dsc1->bpp, dsc2->bpp, "bpp"); + TEST_ASSERT_EQUAL_INT_MESSAGE(dsc1->kern_classes, dsc2->kern_classes, "kern_classes"); + TEST_ASSERT_EQUAL_INT_MESSAGE(dsc1->bitmap_format, dsc2->bitmap_format, "bitmap_format"); + + // cmaps + int total_glyphs = 0; + for(int i = 0; i < dsc1->cmap_num; ++i) { + lv_font_fmt_txt_cmap_t * cmaps1 = (lv_font_fmt_txt_cmap_t *)&dsc1->cmaps[i]; + lv_font_fmt_txt_cmap_t * cmaps2 = (lv_font_fmt_txt_cmap_t *)&dsc2->cmaps[i]; + + TEST_ASSERT_EQUAL_INT_MESSAGE(cmaps1->range_start, cmaps2->range_start, "range_start"); + TEST_ASSERT_EQUAL_INT_MESSAGE(cmaps1->range_length, cmaps2->range_length, "range_length"); + TEST_ASSERT_EQUAL_INT_MESSAGE(cmaps1->glyph_id_start, cmaps2->glyph_id_start, "glyph_id_start"); + TEST_ASSERT_EQUAL_INT_MESSAGE(cmaps1->type, cmaps2->type, "type"); + TEST_ASSERT_EQUAL_INT_MESSAGE(cmaps1->list_length, cmaps2->list_length, "list_length"); + + if(cmaps1->unicode_list != NULL && cmaps2->unicode_list != NULL) { + TEST_ASSERT_TRUE_MESSAGE(cmaps1->unicode_list && cmaps2->unicode_list, "unicode_list"); + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + (uint8_t *)cmaps1->unicode_list, + (uint8_t *)cmaps2->unicode_list, + sizeof(uint16_t) * cmaps1->list_length, + "unicode_list"); + total_glyphs += cmaps1->list_length; + } + else { + total_glyphs += cmaps1->range_length; + TEST_ASSERT_EQUAL_PTR_MESSAGE(cmaps1->unicode_list, cmaps2->unicode_list, "unicode_list"); + } + + if(cmaps1->glyph_id_ofs_list != NULL && cmaps2->glyph_id_ofs_list != NULL) { + uint8_t * ids1 = (uint8_t *)cmaps1->glyph_id_ofs_list; + uint8_t * ids2 = (uint8_t *)cmaps2->glyph_id_ofs_list; + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(ids1, ids2, cmaps1->list_length, "glyph_id_ofs_list"); + } + else { + TEST_ASSERT_EQUAL_PTR_MESSAGE(cmaps1->glyph_id_ofs_list, cmaps2->glyph_id_ofs_list, "glyph_id_ofs_list"); + } + } + + // kern_dsc + if(dsc1->kern_classes == 1 && dsc2->kern_classes == 1) { + lv_font_fmt_txt_kern_classes_t * kern1 = (lv_font_fmt_txt_kern_classes_t *)dsc1->kern_dsc; + lv_font_fmt_txt_kern_classes_t * kern2 = (lv_font_fmt_txt_kern_classes_t *)dsc2->kern_dsc; + if(kern1 != NULL && kern2 != NULL) { + TEST_ASSERT_EQUAL_INT_MESSAGE(kern1->right_class_cnt, kern2->right_class_cnt, "right_class_cnt"); + TEST_ASSERT_EQUAL_INT_MESSAGE(kern1->left_class_cnt, kern2->left_class_cnt, "left_class_cnt"); + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + (uint8_t *)kern1->left_class_mapping, + (uint8_t *)kern2->left_class_mapping, + kern1->left_class_cnt, + "left_class_mapping"); + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + (uint8_t *)kern1->right_class_mapping, + (uint8_t *)kern2->right_class_mapping, + kern1->right_class_cnt, + "right_class_mapping"); + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + (uint8_t *)kern1->class_pair_values, + (uint8_t *)kern2->class_pair_values, + kern1->right_class_cnt * kern1->left_class_cnt, + "class_pair_values"); + } + else { + TEST_ASSERT_EQUAL_PTR_MESSAGE(kern1, kern2, "kern"); + } + } + else if(dsc1->kern_classes == 0 && dsc2->kern_classes == 0) { + lv_font_fmt_txt_kern_pair_t * kern1 = (lv_font_fmt_txt_kern_pair_t *)dsc1->kern_dsc; + lv_font_fmt_txt_kern_pair_t * kern2 = (lv_font_fmt_txt_kern_pair_t *)dsc2->kern_dsc; + if(kern1 != NULL && kern2 != NULL) { + TEST_ASSERT_EQUAL_INT_MESSAGE(kern1->glyph_ids_size, kern2->glyph_ids_size, "glyph_ids_size"); + TEST_ASSERT_EQUAL_INT_MESSAGE(kern1->pair_cnt, kern2->pair_cnt, "pair_cnt"); + + int ids_size; + + if(kern1->glyph_ids_size == 0) { + ids_size = sizeof(int8_t) * 2 * kern1->pair_cnt; + } + else { + ids_size = sizeof(int16_t) * 2 * kern1->pair_cnt; + } + + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(kern1->glyph_ids, kern2->glyph_ids, ids_size, "glyph_ids"); + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + (uint8_t *) kern1->values, + (uint8_t *) kern2->values, + kern1->pair_cnt, + "glyph_values"); + } + } + + lv_font_fmt_txt_glyph_dsc_t * glyph_dsc1 = (lv_font_fmt_txt_glyph_dsc_t *)dsc1->glyph_dsc; + lv_font_fmt_txt_glyph_dsc_t * glyph_dsc2 = (lv_font_fmt_txt_glyph_dsc_t *)dsc2->glyph_dsc; + + for(int i = 0; i < total_glyphs; ++i) { + if(i < total_glyphs - 1) { + int size1 = glyph_dsc1[i + 1].bitmap_index - glyph_dsc1[i].bitmap_index; + + if(size1 > 0) { + TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE( + dsc1->glyph_bitmap + glyph_dsc1[i].bitmap_index, + dsc2->glyph_bitmap + glyph_dsc2[i].bitmap_index, + size1 - 1, "glyph_bitmap"); + } + } + TEST_ASSERT_EQUAL_INT_MESSAGE(glyph_dsc1[i].adv_w, glyph_dsc2[i].adv_w, "adv_w"); + TEST_ASSERT_EQUAL_INT_MESSAGE(glyph_dsc1[i].box_w, glyph_dsc2[i].box_w, "box_w"); + TEST_ASSERT_EQUAL_INT_MESSAGE(glyph_dsc1[i].box_h, glyph_dsc2[i].box_h, "box_h"); + TEST_ASSERT_EQUAL_INT_MESSAGE(glyph_dsc1[i].ofs_x, glyph_dsc2[i].ofs_x, "ofs_x"); + TEST_ASSERT_EQUAL_INT_MESSAGE(glyph_dsc1[i].ofs_y, glyph_dsc2[i].ofs_y, "ofs_y"); + } + + LV_LOG_INFO("No differences found!"); + return 0; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif // LV_BUILD_TEST + diff --git a/lib/lvgl/tests/src/test_cases/test_fs.c b/lib/lvgl/tests/src/test_cases/test_fs.c new file mode 100644 index 00000000..7e31a96a --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_fs.c @@ -0,0 +1,53 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + + +const char * read_exp = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed maximus orci. Morbi massa nisi, varius eu convallis ac, venenatis at metus. In in nibh id urna pretium feugiat vitae eu libero. Ut eget fringilla eros. Nunc ullamcorper lectus mauris, vel rhoncus velit volutpat et. Phasellus sed molestie massa. Maecenas quis dui sollicitudin, vulputate nunc ut, dictum quam. Nam a congue lorem. Nulla non facilisis sapien. Ut luctus nulla nibh, sed finibus urna porta non. Duis aliquet augue id urna euismod auctor. Integer pellentesque vulputate enim non mattis. Donec finibus mattis dolor, et feugiat nisi pharetra porta. Mauris ullamcorper cursus magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."; + +void setUp(void) +{ + /* Function run before every test */ +} + +void tearDown(void) +{ + /* Function run after every test */ +} +#include +void test_read(void) +{ + lv_fs_res_t res; + + /*'A' has cache*/ + lv_fs_file_t fa; + res = lv_fs_open(&fa, "A:src/test_files/readtest.txt", LV_FS_MODE_RD); + TEST_ASSERT_EQUAL(LV_FS_RES_OK, res); + + /*'B' has no cache*/ + lv_fs_file_t fb; + res = lv_fs_open(&fb, "B:src/test_files/readtest.txt", LV_FS_MODE_RD); + TEST_ASSERT_EQUAL(LV_FS_RES_OK, res); + + /*Use an odd size to make sure it's not aligned with the drivier's'cache size*/ + uint8_t buf[79]; + uint32_t cnt = 0; + uint32_t br = 1; + while(br) { + res = lv_fs_read(&fa, buf, sizeof(buf), &br); + TEST_ASSERT_EQUAL(LV_FS_RES_OK, res); + TEST_ASSERT_TRUE(memcmp(buf, read_exp + cnt, br) == 0); + + res = lv_fs_read(&fb, buf, sizeof(buf), &br); + TEST_ASSERT_EQUAL(LV_FS_RES_OK, res); + TEST_ASSERT_TRUE(memcmp(buf, read_exp + cnt, br) == 0); + cnt += br; + } + + lv_fs_close(&fa); + lv_fs_close(&fb); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_line.c b/lib/lvgl/tests/src/test_cases/test_line.c new file mode 100644 index 00000000..e2f781d4 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_line.c @@ -0,0 +1,95 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * line = NULL; + +static const uint16_t default_point_num = 0U; +static const lv_coord_t initial_extra_draw_size = 5U; +static const lv_coord_t final_extra_draw_size = 10U; + +void setUp(void) +{ + active_screen = lv_scr_act(); + line = lv_line_create(active_screen); +} + +void tearDown(void) +{ + lv_obj_clean(active_screen); +} + +void test_line_should_have_valid_documented_default_values(void) +{ + lv_line_t * line_ptr = (lv_line_t *) line; + TEST_ASSERT_EQUAL_UINT16(default_point_num, line_ptr->point_num); + TEST_ASSERT_NULL(line_ptr->point_array); + TEST_ASSERT_FALSE(lv_line_get_y_invert(line)); + TEST_ASSERT_FALSE(lv_obj_has_flag(line, LV_OBJ_FLAG_CLICKABLE)); + /* line doesn't have any points, so it's 0,0 in size */ + TEST_ASSERT_EQUAL_UINT16(0U, lv_obj_get_self_width(line)); + TEST_ASSERT_EQUAL_UINT16(0U, lv_obj_get_self_height(line)); +} + +void test_line_should_return_valid_y_invert(void) +{ + lv_line_set_y_invert(line, true); + TEST_ASSERT_TRUE(lv_line_get_y_invert(line)); +} + +void test_line_size_should_be_updated_after_adding_points(void) +{ + static lv_point_t points[] = { {5, 5} }; + uint16_t point_cnt = (uint16_t) sizeof(points) / sizeof(lv_point_t); + lv_line_set_points(line, points, point_cnt); + + lv_coord_t calculated_width = 0; + lv_coord_t calculated_height = 0; + + /* Get the biggest coordinate on both axis */ + uint16_t point_idx = 0; + for(point_idx = 0; point_idx < point_cnt; point_idx++) { + calculated_width = LV_MAX(points[point_idx].x, calculated_width); + calculated_height = LV_MAX(points[point_idx].y, calculated_height); + } + /* Add style line width */ + lv_coord_t line_width = lv_obj_get_style_line_width(line, LV_PART_MAIN); + calculated_width += line_width; + calculated_height += line_width; + + TEST_ASSERT_EQUAL_UINT16(calculated_width, lv_obj_get_self_width(line)); + TEST_ASSERT_EQUAL_UINT16(calculated_height, lv_obj_get_self_height(line)); +} + +static void line_event_cb(lv_event_t * e) +{ + lv_event_code_t code = lv_event_get_code(e); + + if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + /* Set the new line extra draw size */ + lv_event_set_ext_draw_size(e, initial_extra_draw_size); + } +} + +void test_line_should_update_extra_draw_size_based_on_style(void) +{ + /* Setup an event handler for line extra draw size event */ + lv_obj_add_event_cb(line, line_event_cb, LV_EVENT_ALL, NULL); + /* Trigger the extra draw size event */ + lv_obj_refresh_ext_draw_size(line); + + TEST_ASSERT_EQUAL(initial_extra_draw_size, _lv_obj_get_ext_draw_size(line)); + + /* Update line width style, the event handler should set the extra draw size + * to the line width */ + lv_obj_set_style_line_width(line, final_extra_draw_size, LV_PART_MAIN); + + /* Trigger the extra draw size event */ + lv_obj_refresh_ext_draw_size(line); + + TEST_ASSERT_EQUAL(final_extra_draw_size, _lv_obj_get_ext_draw_size(line)); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_mem.c b/lib/lvgl/tests/src/test_cases/test_mem.c new file mode 100644 index 00000000..c97e2719 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_mem.c @@ -0,0 +1,26 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +void setUp(void) +{ + /* Function run before every test */ +} + +void tearDown(void) +{ + /* Function run after every test */ +} + +/* #3324 */ +void test_mem_buf_realloc(void) +{ +#if LV_MEM_CUSTOM == 0 + void * buf1 = lv_mem_alloc(20); + void * buf2 = lv_mem_realloc(buf1, LV_MEM_SIZE + 16384); + TEST_ASSERT_NULL(buf2); +#endif +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_obj_tree.c b/lib/lvgl/tests/src/test_cases/test_obj_tree.c new file mode 100644 index 00000000..73bdb0f1 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_obj_tree.c @@ -0,0 +1,39 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +void test_obj_tree_1(void); +void test_obj_tree_2(void); + +void test_obj_tree_1(void) +{ + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); +} + +void test_obj_tree_2(void) +{ + + lv_obj_create(lv_scr_act()); + lv_obj_t * o2 = lv_obj_create(lv_scr_act()); + lv_obj_create(lv_scr_act()); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 3); + + lv_obj_del(o2); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 2); + + lv_obj_clean(lv_scr_act()); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); + + lv_color_t c1 = lv_color_hex(0x444444); + lv_color_t c2 = lv_color_hex3(0x444); + TEST_ASSERT_EQUAL_COLOR(c1, c2); + + lv_obj_remove_style_all(lv_scr_act()); + lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x112233), 0); + lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, 0); + + //TEST_ASSERT_EQUAL_SCREENSHOT("scr1.png") +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_slider.c b/lib/lvgl/tests/src/test_cases/test_slider.c new file mode 100644 index 00000000..2fe88245 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_slider.c @@ -0,0 +1,214 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" +#include "lv_test_indev.h" + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * slider = NULL; +static lv_obj_t * sliderRangeMode = NULL; +static lv_obj_t * sliderNormalMode = NULL; +static lv_obj_t * sliderSymmetricalMode = NULL; +static lv_group_t * g = NULL; + +void setUp(void) +{ + active_screen = lv_scr_act(); + slider = lv_slider_create(active_screen); + sliderRangeMode = lv_slider_create(active_screen); + sliderNormalMode = lv_slider_create(active_screen); + sliderSymmetricalMode = lv_slider_create(active_screen); + + lv_slider_set_mode(sliderRangeMode, LV_SLIDER_MODE_RANGE); + lv_slider_set_mode(sliderNormalMode, LV_SLIDER_MODE_NORMAL); + lv_slider_set_mode(sliderSymmetricalMode, LV_SLIDER_MODE_SYMMETRICAL); + + g = lv_group_create(); + lv_indev_set_group(lv_test_encoder_indev, g); +} + +void tearDown(void) +{ + lv_obj_clean(active_screen); +} + +void test_textarea_should_have_valid_documented_default_values(void) +{ + lv_coord_t objw = lv_obj_get_width(slider); + lv_coord_t objh = lv_obj_get_height(slider); + + /* Horizontal slider */ + TEST_ASSERT_TRUE(objw >= objh); + TEST_ASSERT_FALSE(lv_obj_has_flag(slider, LV_OBJ_FLAG_SCROLL_CHAIN)); + TEST_ASSERT_FALSE(lv_obj_has_flag(slider, LV_OBJ_FLAG_SCROLLABLE)); +} + +void test_slider_event_keys_right_and_up_increment_value_by_one(void) +{ + char key = LV_KEY_RIGHT; + lv_slider_set_value(slider, 10, LV_ANIM_OFF); + int32_t value = lv_slider_get_value(slider); + + lv_event_send(slider, LV_EVENT_KEY, (void *) &key); + + int32_t new_value = lv_slider_get_value(slider); + TEST_ASSERT_EQUAL_INT32(value + 1, new_value); + + key = LV_KEY_UP; + lv_event_send(slider, LV_EVENT_KEY, (void *) &key); + TEST_ASSERT_EQUAL_INT32(new_value + 1, lv_slider_get_value(slider)); +} + +void test_slider_event_keys_left_and_down_decrement_value_by_one(void) +{ + char key = LV_KEY_LEFT; + lv_slider_set_value(slider, 10, LV_ANIM_OFF); + int32_t value = lv_slider_get_value(slider); + + lv_event_send(slider, LV_EVENT_KEY, (void *) &key); + + int32_t new_value = lv_slider_get_value(slider); + TEST_ASSERT_EQUAL_INT32(value - 1, new_value); + + key = LV_KEY_DOWN; + lv_event_send(slider, LV_EVENT_KEY, (void *) &key); + TEST_ASSERT_EQUAL_INT32(new_value - 1, lv_slider_get_value(slider)); +} + +void test_slider_event_invalid_key_should_not_change_values(void) +{ + char key = LV_KEY_ENTER; + lv_slider_set_value(slider, 10, LV_ANIM_OFF); + int32_t value = lv_slider_get_value(slider); + + lv_event_send(slider, LV_EVENT_KEY, (void *) &key); + + TEST_ASSERT_EQUAL_INT32(value, lv_slider_get_value(slider)); +} + +void test_slider_range_mode_should_leave_edit_mode_if_released(void) +{ + lv_slider_t * ptr = (lv_slider_t *) sliderRangeMode; + + /* Setup group and encoder indev */ + lv_group_add_obj(g, sliderNormalMode); + lv_group_set_editing(g, true); + + lv_test_encoder_click(); + + /* Always executed when handling LV_EVENT_RELEASED or + * LV_EVENT_PRESS_LOST */ + TEST_ASSERT_FALSE(ptr->dragging); + TEST_ASSERT_NULL(ptr->value_to_set); + TEST_ASSERT_EQUAL(0U, ptr->left_knob_focus); + + /* Group leaved edit mode */ + TEST_ASSERT_FALSE(lv_group_get_editing(g)); +} + +void test_slider_range_mode_should_not_leave_edit_mode_if_released_with_no_left_knob_focus(void) +{ + lv_slider_t * ptr = (lv_slider_t *) sliderRangeMode; + + /* Setup group and encoder indev */ + lv_group_add_obj(g, sliderRangeMode); + lv_group_set_editing(g, true); + + lv_test_encoder_release(); + lv_test_indev_wait(50); + + /* Always executed when handling LV_EVENT_RELEASED or + * LV_EVENT_PRESS_LOST */ + TEST_ASSERT_FALSE(ptr->dragging); + TEST_ASSERT_NULL(ptr->value_to_set); + + TEST_ASSERT(lv_group_get_editing(g)); +} + +void test_slider_normal_mode_should_leave_edit_mode_if_released(void) +{ + lv_slider_t * ptr = (lv_slider_t *) sliderNormalMode; + ptr->left_knob_focus = 1; + + /* Setup group and encoder indev */ + lv_group_add_obj(g, sliderNormalMode); + lv_group_set_editing(g, true); + + lv_test_encoder_click(); + + /* Always executed when handling LV_EVENT_RELEASED or + * LV_EVENT_PRESS_LOST */ + TEST_ASSERT_FALSE(ptr->dragging); + TEST_ASSERT_NULL(ptr->value_to_set); + TEST_ASSERT_EQUAL(0U, ptr->left_knob_focus); + + /* Group leaved edit mode */ + TEST_ASSERT_FALSE(lv_group_get_editing(g)); +} + +void test_ranged_mode_adjust_with_encoder(void) +{ + lv_slider_set_value(sliderRangeMode, 90, LV_ANIM_OFF); + lv_slider_set_left_value(sliderRangeMode, 10, LV_ANIM_OFF); + + /* Setup group and encoder indev */ + lv_group_add_obj(g, sliderRangeMode); + lv_group_set_editing(g, false); + + /*Go the edit mode*/ + lv_test_encoder_click(); + + /*Adjust the right knob*/ + lv_test_encoder_turn(-10); + TEST_ASSERT_EQUAL(80, lv_slider_get_value(sliderRangeMode)); /*Updated?*/ + TEST_ASSERT_EQUAL(10, lv_slider_get_left_value(sliderRangeMode)); /*Maintained?*/ + + /*Focus the left knob*/ + lv_test_encoder_click(); + + /*Adjust the left knob*/ + lv_test_encoder_turn(5); + TEST_ASSERT_EQUAL(80, lv_slider_get_value(sliderRangeMode)); /*Maintained?*/ + TEST_ASSERT_EQUAL(15, lv_slider_get_left_value(sliderRangeMode)); /*Updated?*/ + +} + +void test_normal_mode_slider_hit_test(void) +{ + /* Validate if point 0,0 can click in the slider */ + lv_point_t point = { + .x = 0, + .y = 0 + }; + + lv_hit_test_info_t info = { + .res = false, + .point = &point + }; + + lv_slider_set_value(sliderNormalMode, 100, LV_ANIM_OFF); + lv_event_send(sliderNormalMode, LV_EVENT_HIT_TEST, (void *) &info); + + /* point can click slider */ + TEST_ASSERT(info.res); +} + +void test_slider_range_event_hit_test(void) +{ + /* Validate if point 0,0 can click in the slider */ + lv_point_t point = { + .x = 0, + .y = 0 + }; + + lv_hit_test_info_t info = { + .res = false, + .point = &point + }; + lv_event_send(sliderRangeMode, LV_EVENT_HIT_TEST, (void *) &info); + + /* point can click slider in the left knob */ + TEST_ASSERT(info.res); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_snapshot.c b/lib/lvgl/tests/src/test_cases/test_snapshot.c new file mode 100644 index 00000000..0c87b310 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_snapshot.c @@ -0,0 +1,47 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#if LV_USE_SNAPSHOT + +#include "unity/unity.h" + + +#define NUM_SNAPSHOTS 1 + +void test_snapshot_should_not_leak_memory(void) +{ + uint32_t idx = 0; + uint32_t initial_available_memory = 0; + uint32_t final_available_memory = 0; + lv_mem_monitor_t monitor; + + lv_img_dsc_t * snapshots[NUM_SNAPSHOTS] = {NULL}; + + lv_mem_monitor(&monitor); + initial_available_memory = monitor.free_size; + + for(idx = 0; idx < NUM_SNAPSHOTS; idx++) { + snapshots[idx] = lv_snapshot_take(lv_scr_act(), LV_IMG_CF_TRUE_COLOR_ALPHA); + TEST_ASSERT_NOT_NULL(snapshots[idx]); + } + + for(idx = 0; idx < NUM_SNAPSHOTS; idx++) { + lv_snapshot_free(snapshots[idx]); + } + + lv_mem_monitor(&monitor); + final_available_memory = monitor.free_size; + + TEST_ASSERT_EQUAL(initial_available_memory, final_available_memory); +} + +#else /*LV_USE_SNAPSHOT*/ + +void test_snapshot_should_not_leak_memory(void) +{ + +} + +#endif + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_style.c b/lib/lvgl/tests/src/test_cases/test_style.c new file mode 100644 index 00000000..76c1724d --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_style.c @@ -0,0 +1,109 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" +#include + +static void obj_set_height_helper(void * obj, int32_t height) +{ + lv_obj_set_height((lv_obj_t *)obj, (lv_coord_t)height); +} + +void test_gradient_vertical_misalignment(void) +{ + lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_VER, 0); + lv_obj_set_style_bg_grad_color(obj, lv_color_hex(0xff0000), 0); + lv_obj_set_style_bg_color(obj, lv_color_hex(0x00ff00), 0); + + lv_obj_set_size(obj, 300, 100); + + lv_refr_now(NULL); + lv_obj_set_style_bg_grad_color(obj, lv_color_hex(0xffff00), 0); + lv_obj_set_style_bg_color(obj, lv_color_hex(0x00ffff), 0); + + lv_anim_t a; + lv_anim_init(&a); + lv_anim_set_var(&a, obj); + lv_anim_set_exec_cb(&a, obj_set_height_helper); + lv_anim_set_time(&a, 3000); + lv_anim_set_playback_time(&a, 3000); + lv_anim_set_repeat_count(&a, 100); + lv_anim_set_values(&a, 0, 300); + lv_anim_start(&a); + + uint32_t i; + for(i = 0; i < 1000; i++) { + lv_timer_handler(); + lv_tick_inc(100); + usleep(1000); + } +} + +void test_custom_prop_ids(void) +{ + uint8_t fake_flag = 0; + uint32_t initial_custom_props = lv_style_get_num_custom_props(); + uint32_t max_props_to_register = 64; + for(uint32_t i = 0; i < max_props_to_register; i++) { + lv_style_prop_t prop = lv_style_register_prop(fake_flag); + /* Should have a higher index than the last built-in prop */ + TEST_ASSERT_GREATER_THAN(_LV_STYLE_LAST_BUILT_IN_PROP, prop); + if(i == 0) { + /* Should be equal to the first expected index of a custom prop */ + TEST_ASSERT_EQUAL(_LV_STYLE_NUM_BUILT_IN_PROPS + initial_custom_props, prop); + } + /*We should find our flags*/ + TEST_ASSERT_EQUAL(fake_flag, _lv_style_prop_lookup_flags(prop)); + if(fake_flag == 0xff) + fake_flag = 0; + else + fake_flag++; + } + TEST_ASSERT_EQUAL(initial_custom_props + max_props_to_register, lv_style_get_num_custom_props()); + /* + * Check that the resizing algorithm works correctly, given that 64 props + * were registered + whatever's built-in. A failure here may just indicate + * that LVGL registers more built-in properties now and this needs adjustment. + */ + extern uint32_t _lv_style_custom_prop_flag_lookup_table_size; + TEST_ASSERT_EQUAL(_lv_style_custom_prop_flag_lookup_table_size, 96); +} + +void test_inherit_meta(void) +{ + lv_obj_t * parent = lv_obj_create(lv_scr_act()); + lv_obj_t * child = lv_obj_create(parent); + lv_obj_t * grandchild = lv_label_create(child); + lv_obj_set_style_text_color(parent, lv_color_hex(0xff0000), LV_PART_MAIN); + lv_obj_set_local_style_prop_meta(child, LV_STYLE_TEXT_COLOR, LV_STYLE_PROP_META_INHERIT, LV_PART_MAIN); + TEST_ASSERT_EQUAL_HEX(lv_color_hex(0xff0000).full, lv_obj_get_style_text_color(grandchild, LV_PART_MAIN).full); +} + +void test_id_meta_overrun(void) +{ + /* Test that property ID registration is blocked once the ID reaches into the meta bits */ + lv_style_prop_t prop_id; + do { + prop_id = lv_style_register_prop(0); + if(prop_id != LV_STYLE_PROP_INV) { + TEST_ASSERT_EQUAL(0, prop_id & LV_STYLE_PROP_META_MASK); + } + } while(prop_id != LV_STYLE_PROP_INV); +} + +void test_inherit_meta_with_lower_precedence_style(void) +{ + lv_obj_t * parent = lv_obj_create(lv_scr_act()); + lv_obj_t * child = lv_obj_create(parent); + lv_obj_t * grandchild = lv_label_create(child); + lv_obj_set_style_text_color(parent, lv_color_hex(0xff0000), LV_PART_MAIN); + lv_style_t style; + lv_style_init(&style); + lv_style_set_text_color(&style, lv_color_hex(0xffffff)); + lv_obj_set_local_style_prop_meta(child, LV_STYLE_TEXT_COLOR, LV_STYLE_PROP_META_INHERIT, LV_PART_MAIN); + lv_obj_add_style(child, &style, LV_PART_MAIN); + TEST_ASSERT_EQUAL_HEX(lv_color_hex(0xff0000).full, lv_obj_get_style_text_color(grandchild, LV_PART_MAIN).full); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_switch.c b/lib/lvgl/tests/src/test_cases/test_switch.c new file mode 100644 index 00000000..cfb4a1c2 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_switch.c @@ -0,0 +1,140 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +#include "lv_test_helpers.h" +#include "lv_test_indev.h" + +#define SWITCHES_CNT 10 + +uint8_t value_changed_event_cnt = 0; +lv_obj_t * scr = NULL; +lv_obj_t * sw = NULL; + +void setUp(void) +{ + /* Function run before every test */ + scr = lv_scr_act(); + sw = lv_switch_create(scr); +} + +void tearDown(void) +{ + /* Function run after every test */ + value_changed_event_cnt = 0; +} + +static void mouse_click_on_switch(void) +{ + lv_test_mouse_click_at(sw->coords.x1, sw->coords.y1); +} + +static void event_handler(lv_event_t * e) +{ + lv_event_code_t event = lv_event_get_code(e); + + if(LV_EVENT_VALUE_CHANGED == event) { + value_changed_event_cnt++; + } + +} + +void test_switch_should_have_default_state_after_being_created(void) +{ + lv_state_t state = lv_obj_get_state(sw); + TEST_ASSERT_EQUAL(state, LV_STATE_DEFAULT); +} + +void test_switch_should_not_leak_memory_after_deletion(void) +{ + size_t idx = 0; + uint32_t initial_available_memory = 0; + uint32_t final_available_memory = 0; + lv_mem_monitor_t monitor; + lv_obj_t * switches[SWITCHES_CNT] = {NULL}; + + lv_mem_monitor(&monitor); + initial_available_memory = monitor.free_size; + + for(idx = 0; idx < SWITCHES_CNT; idx++) { + switches[idx] = lv_switch_create(scr); + } + + for(idx = 0; idx < SWITCHES_CNT; idx++) { + lv_obj_del(switches[idx]); + } + + lv_mem_monitor(&monitor); + final_available_memory = monitor.free_size; + + LV_HEAP_CHECK(TEST_ASSERT_LESS_OR_EQUAL(initial_available_memory, final_available_memory)); +} + +void test_switch_animation(void) +{ + lv_switch_t * anim_sw = (lv_switch_t *) sw; + int32_t initial_anim_state = anim_sw->anim_state; + + /* Trigger animation */ + mouse_click_on_switch(); + /* Wait some time */ + lv_test_indev_wait(50); + + int32_t checked_anim_state = anim_sw->anim_state; + TEST_ASSERT_GREATER_THAN(initial_anim_state, checked_anim_state); + TEST_ASSERT(lv_obj_has_state(sw, LV_STATE_CHECKED)); + + mouse_click_on_switch(); + lv_test_indev_wait(50); + + TEST_ASSERT_LESS_THAN(checked_anim_state, anim_sw->anim_state); + TEST_ASSERT_FALSE(lv_obj_has_state(sw, LV_STATE_CHECKED)); +} + +void test_switch_should_not_have_extra_draw_size_at_creation(void) +{ + lv_coord_t extra_size = _lv_obj_get_ext_draw_size(sw); + + TEST_ASSERT_EQUAL(0, extra_size); +} + +void test_switch_should_update_extra_draw_size_after_editing_padding(void) +{ + lv_coord_t pad = 6; + lv_coord_t actual = 0; + lv_coord_t expected = pad + _LV_SWITCH_KNOB_EXT_AREA_CORRECTION; + + static lv_style_t style_knob; + lv_style_init(&style_knob); + lv_style_set_pad_all(&style_knob, pad); + + lv_obj_remove_style_all(sw); + lv_obj_add_style(sw, &style_knob, LV_PART_KNOB); + lv_obj_center(sw); + + /* Get extra draw size */ + actual = _lv_obj_get_ext_draw_size(sw); + + TEST_ASSERT_EQUAL(expected, actual); +} + +/* See #2330 for context */ +void test_switch_should_trigger_value_changed_event_only_once(void) +{ + lv_obj_add_event_cb(sw, event_handler, LV_EVENT_ALL, NULL); + mouse_click_on_switch(); + + TEST_ASSERT_EQUAL(1, value_changed_event_cnt); +} + +/* See #2785 for context */ +void test_switch_should_state_change_when_event_bubbling_is_enabled(void) +{ + lv_obj_add_flag(sw, LV_OBJ_FLAG_EVENT_BUBBLE); + mouse_click_on_switch(); + + TEST_ASSERT(lv_obj_has_state(sw, LV_STATE_CHECKED)); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_table.c b/lib/lvgl/tests/src/test_cases/test_table.c new file mode 100644 index 00000000..f563718f --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_table.c @@ -0,0 +1,247 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +static lv_obj_t * scr = NULL; +static lv_obj_t * table = NULL; + +void setUp(void) +{ + scr = lv_scr_act(); + table = lv_table_create(scr); +} + +void tearDown(void) +{ + lv_obj_clean(lv_scr_act()); +} + +void test_table_should_return_assigned_cell_value(void) +{ + uint16_t row = 0; + uint16_t column = 0; + const char * value = "LVGL"; + + lv_table_set_cell_value(table, row, column, value); + + TEST_ASSERT_EQUAL_STRING(value, lv_table_get_cell_value(table, row, column)); +} + +void test_table_should_grow_columns_automatically_when_setting_formatted_cell_value(void) +{ + /* Newly created tables have 1 column and 1 row */ + uint16_t original_column_count = lv_table_get_col_cnt(table); + TEST_ASSERT_EQUAL_UINT16(1, original_column_count); + + /* Table currently only has a cell at 0,0 (row, colum) */ + lv_table_set_cell_value_fmt(table, 0, 1, "LVGL %s", "Rocks!"); + + /* Table now should have cells at 0,0 and 0,1, so 2 columns */ + uint16_t expected_column_count = original_column_count + 1; + TEST_ASSERT_EQUAL_UINT16(expected_column_count, lv_table_get_col_cnt(table)); +} + +void test_table_should_identify_cell_with_ctrl(void) +{ + bool has_ctrl = false; + + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + + TEST_ASSERT_FALSE(has_ctrl); + + lv_table_add_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + TEST_ASSERT_TRUE(has_ctrl); +} + +void test_table_should_clear_selected_cell_ctrl(void) +{ + bool has_ctrl = false; + + lv_table_add_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + TEST_ASSERT_TRUE(has_ctrl); + + lv_table_clear_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + TEST_ASSERT_FALSE(has_ctrl); +} + +void test_table_should_keep_not_selected_cell_ctrl(void) +{ + bool has_ctrl = false; + + lv_table_add_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT | LV_TABLE_CELL_CTRL_TEXT_CROP); + + lv_table_clear_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + TEST_ASSERT_FALSE(has_ctrl); + + has_ctrl = lv_table_has_cell_ctrl(table, 0, 0, LV_TABLE_CELL_CTRL_TEXT_CROP); + TEST_ASSERT_TRUE(has_ctrl); +} + +/* We're using a newly created table */ +void test_table_cell_value_should_return_empty_string_when_cell_is_empty(void) +{ + TEST_ASSERT_EQUAL_STRING("", lv_table_get_cell_value(table, 0, 0)); +} + +void test_table_row_height_should_increase_with_multiline_cell_value(void) +{ + lv_table_t * table_ptr = (lv_table_t *) table; + const char * singleline_value = "LVGL"; + const char * multiline_value = "LVGL\nRocks"; + + lv_table_set_cell_value(table, 0, 0, singleline_value); + lv_coord_t singleline_row_height = table_ptr->row_h[0]; + + lv_table_set_cell_value(table, 0, 0, multiline_value); + lv_coord_t multiline_row_height = table_ptr->row_h[0]; + + TEST_ASSERT_GREATER_THAN(singleline_row_height, multiline_row_height); +} + +void test_table_should_wrap_long_texts(void) +{ + lv_table_t * table_ptr = (lv_table_t *) table; + const char * long_text = "Testing automatic text wrap with a very long text"; + const char * small_text = "Hi"; + + lv_table_set_col_width(table, 0, 50); + + lv_table_set_cell_value(table, 0, 0, small_text); + lv_coord_t row_height = table_ptr->row_h[0]; + + lv_table_set_cell_value(table, 0, 0, long_text); + lv_coord_t wrapped_row_height = table_ptr->row_h[0]; + + /* Row height on cells with wrapped text is bigger than cells with small texts */ + TEST_ASSERT_GREATER_THAN(row_height, wrapped_row_height); +} + +static void draw_part_event_cb(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e); + /*If the cells are drawn...*/ + if(dsc->part == LV_PART_ITEMS) { + uint32_t row = dsc->id / lv_table_get_col_cnt(obj); + uint32_t col = dsc->id - row * lv_table_get_col_cnt(obj); + + /*Make the texts in the first cell center aligned*/ + if(row == 0) { + dsc->label_dsc->align = LV_TEXT_ALIGN_CENTER; + dsc->rect_dsc->bg_color = lv_color_mix(lv_palette_main(LV_PALETTE_BLUE), dsc->rect_dsc->bg_color, LV_OPA_40); + dsc->rect_dsc->bg_opa = LV_OPA_COVER; + } + /*In the first column align the texts to the right*/ + else if(col == 0) { + dsc->label_dsc->align = LV_TEXT_ALIGN_RIGHT; + } + + /*Make every 2nd row grayish*/ + if(row != 0 && (row % 2 == 0)) { + dsc->rect_dsc->bg_color = lv_color_mix(lv_palette_main(LV_PALETTE_RED), dsc->rect_dsc->bg_color, LV_OPA_30); + dsc->rect_dsc->bg_opa = LV_OPA_COVER; + } + } +} + +void test_table_rendering(void) +{ + lv_obj_center(table); + lv_obj_add_event_cb(table, draw_part_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); + lv_obj_set_style_border_side(table, LV_BORDER_SIDE_FULL, LV_PART_ITEMS); + lv_obj_set_style_pad_all(table, 10, LV_PART_ITEMS); + lv_obj_set_style_border_width(table, 5, LV_PART_ITEMS); + lv_table_set_col_cnt(table, 5); + lv_table_set_row_cnt(table, 5); + lv_table_set_col_width(table, 1, 60); + lv_table_set_col_width(table, 2, 100); + + lv_table_add_cell_ctrl(table, 0, 1, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + lv_table_set_cell_value(table, 0, 1, "2 cells are merged"); + + lv_table_add_cell_ctrl(table, 1, 0, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + lv_table_add_cell_ctrl(table, 1, 1, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + lv_table_add_cell_ctrl(table, 1, 2, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + lv_table_add_cell_ctrl(table, 1, 3, LV_TABLE_CELL_CTRL_MERGE_RIGHT); + lv_table_set_cell_value(table, 1, 0, "5 cells are merged"); + + uint32_t i; + for(i = 0; i < 5; i++) { + lv_table_set_cell_value_fmt(table, 3, i, "%d", i); + } + + lv_table_set_cell_value_fmt(table, 2, 3, "Multi\nline text"); + lv_table_set_cell_value_fmt(table, 2, 4, "Very long text wrapped automatically"); + + lv_table_add_cell_ctrl(table, 4, 3, LV_TABLE_CELL_CTRL_TEXT_CROP); + lv_table_set_cell_value_fmt(table, 4, 3, "crop crop crop crop crop crop crop crop "); + + TEST_ASSERT_EQUAL_SCREENSHOT("table_1.png"); +} + +/* See #3120 for context */ +void test_table_should_reduce_cells(void) +{ + const uint16_t initial_col_num = 8; + const uint16_t initial_row_num = 1; + const uint16_t final_col_num = 4; + const uint16_t final_row_num = 1; + + lv_obj_center(table); + + lv_table_set_col_cnt(table, initial_col_num); + lv_table_set_row_cnt(table, initial_row_num); + + uint32_t row_idx, col_idx; + for(row_idx = 0; row_idx < initial_row_num; row_idx++) { + for(col_idx = 0; col_idx < initial_col_num; col_idx++) { + lv_table_set_cell_value(table, row_idx, col_idx, "00"); + } + } + + lv_table_set_col_cnt(table, final_col_num); + lv_table_set_row_cnt(table, final_row_num); + + for(row_idx = 0; row_idx < final_row_num; row_idx++) { + for(col_idx = 0; col_idx < final_col_num; col_idx++) { + lv_table_set_cell_value(table, row_idx, col_idx, "00"); + } + } +} + +/* See #3120 for context */ +void test_table_should_reduce_cells_with_more_than_one_row(void) +{ + const uint16_t initial_col_num = 8; + const uint16_t initial_row_num = 2; + const uint16_t final_col_num = 4; + const uint16_t final_row_num = 1; + + lv_obj_center(table); + + lv_table_set_col_cnt(table, initial_col_num); + lv_table_set_row_cnt(table, initial_row_num); + + uint32_t row_idx, col_idx; + for(row_idx = 0; row_idx < initial_row_num; row_idx++) { + for(col_idx = 0; col_idx < initial_col_num; col_idx++) { + lv_table_set_cell_value(table, row_idx, col_idx, "00"); + } + } + + lv_table_set_col_cnt(table, final_col_num); + lv_table_set_row_cnt(table, final_row_num); + + for(row_idx = 0; row_idx < final_row_num; row_idx++) { + for(col_idx = 0; col_idx < final_col_num; col_idx++) { + lv_table_set_cell_value(table, row_idx, col_idx, "00"); + } + } +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_textarea.c b/lib/lvgl/tests/src/test_cases/test_textarea.c new file mode 100644 index 00000000..99a14d81 --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_textarea.c @@ -0,0 +1,107 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +static lv_obj_t * active_screen = NULL; +static lv_obj_t * textarea = NULL; + +static const char * textarea_default_text = ""; + +void setUp(void) +{ + active_screen = lv_scr_act(); + textarea = lv_textarea_create(active_screen); +} + +void tearDown(void) +{ + /* Function run after every test */ +} + +void test_textarea_should_have_valid_documented_defualt_values(void) +{ + TEST_ASSERT(lv_textarea_get_cursor_click_pos(textarea)); + TEST_ASSERT_EQUAL(0U, lv_textarea_get_one_line(textarea)); + /* No placeholder text should be set on widget creation */ + TEST_ASSERT_EQUAL_STRING(textarea_default_text, lv_textarea_get_placeholder_text(textarea)); + TEST_ASSERT_EQUAL_STRING(textarea_default_text, lv_textarea_get_text(textarea)); +} + +/* When in password mode the lv_textarea_get_text function returns + * the actual text, not the bullet characters. */ +void test_textarea_should_return_actual_text_when_password_mode_is_enabled(void) +{ + const char * text = "Hello LVGL!"; + + lv_textarea_add_text(textarea, text); + lv_textarea_set_password_mode(textarea, true); + + TEST_ASSERT_TRUE(lv_textarea_get_password_mode(textarea)); + TEST_ASSERT_EQUAL_STRING(text, lv_textarea_get_text(textarea)); +} + +void test_textarea_should_update_label_style_with_one_line_enabled(void) +{ + lv_textarea_t * txt_ptr = (lv_textarea_t *) textarea; + + lv_textarea_add_text(textarea, "Hi"); + lv_textarea_set_one_line(textarea, true); + + lv_coord_t left_padding = lv_obj_get_style_pad_left(txt_ptr->label, LV_PART_MAIN); + lv_coord_t right_padding = lv_obj_get_style_pad_right(txt_ptr->label, LV_PART_MAIN); + lv_coord_t line_width = lv_obj_get_width(txt_ptr->label); + lv_coord_t expected_size = left_padding + right_padding + line_width; + + TEST_ASSERT(lv_textarea_get_one_line(textarea)); + TEST_ASSERT_EQUAL_UINT16(expected_size, lv_obj_get_width(txt_ptr->label)); + TEST_ASSERT_EQUAL_UINT16(lv_pct(100), lv_obj_get_style_min_width(txt_ptr->label, LV_PART_MAIN)); +} + +void test_textarea_cursor_click_pos_field_update(void) +{ + lv_textarea_set_cursor_click_pos(textarea, false); + + TEST_ASSERT_FALSE(lv_textarea_get_cursor_click_pos(textarea)); +} + +void test_textarea_should_update_placeholder_text(void) +{ + const char * new_placeholder = "LVGL Rocks!!!!!"; + const char * text = "Hello LVGL!"; + + /* Allocating memory for placeholder text */ + lv_textarea_set_placeholder_text(textarea, text); + TEST_ASSERT_EQUAL_STRING(text, lv_textarea_get_placeholder_text(textarea)); + + /* Reallocating memory for the new placeholder text */ + lv_textarea_set_placeholder_text(textarea, new_placeholder); + TEST_ASSERT_EQUAL_STRING(new_placeholder, lv_textarea_get_placeholder_text(textarea)); + + /* Freeing allocated memory for placeholder text */ + lv_textarea_set_placeholder_text(textarea, ""); + TEST_ASSERT_EQUAL_STRING("", lv_textarea_get_placeholder_text(textarea)); +} + +void test_textarea_should_keep_only_accepted_chars(void) +{ + const char * accepted_list = "abcd"; + + lv_textarea_set_accepted_chars(textarea, accepted_list); + lv_textarea_set_text(textarea, "abcde"); + + TEST_ASSERT_EQUAL_STRING(accepted_list, lv_textarea_get_text(textarea)); +} + +void test_textarea_in_one_line_mode_should_ignore_line_break_characters(void) +{ + lv_textarea_set_one_line(textarea, true); + + lv_textarea_add_char(textarea, '\n'); + TEST_ASSERT_EQUAL_STRING(textarea_default_text, lv_textarea_get_text(textarea)); + + lv_textarea_add_char(textarea, '\r'); + TEST_ASSERT_EQUAL_STRING(textarea_default_text, lv_textarea_get_text(textarea)); +} + +#endif diff --git a/lib/lvgl/tests/src/test_cases/test_txt.c b/lib/lvgl/tests/src/test_cases/test_txt.c new file mode 100644 index 00000000..a855396f --- /dev/null +++ b/lib/lvgl/tests/src/test_cases/test_txt.c @@ -0,0 +1,207 @@ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include "unity/unity.h" + +static const char color_cmd = LV_TXT_COLOR_CMD[0]; + +void test_txt_should_identify_valid_start_of_command(void) +{ + uint32_t character = color_cmd; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_WAIT; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_TRUE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_PAR); +} + +void test_txt_should_identify_invalid_start_of_command(void) +{ + uint32_t character = '$'; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_WAIT; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_FALSE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_WAIT); +} + +void test_txt_should_identify_scaped_command_in_parameter(void) +{ + uint32_t character = color_cmd; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_PAR; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_FALSE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_WAIT); +} + +void test_txt_should_skip_color_parameter_in_parameter(void) +{ + uint32_t character = '$'; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_PAR; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_TRUE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_PAR); +} + +void test_txt_should_reset_state_when_receiving_color_cmd_while_processing_commands(void) +{ + uint32_t character = color_cmd; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_IN; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_TRUE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_WAIT); +} + +void test_txt_should_identify_space_after_parameter(void) +{ + uint32_t character = ' '; + lv_text_cmd_state_t state = LV_TEXT_CMD_STATE_PAR; + + bool is_cmd = _lv_txt_is_cmd(&state, character); + + TEST_ASSERT_TRUE(is_cmd); + TEST_ASSERT_EQUAL_UINT8(state, LV_TEXT_CMD_STATE_IN); +} + +void test_txt_should_insert_string_into_another(void) +{ + const char * msg = "Hello "; + const char * suffix = "World"; + char target[20] = {0}; + size_t msg_len = strlen(msg); + + strcpy(target, msg); + + _lv_txt_ins(target, msg_len, suffix); + + TEST_ASSERT_EQUAL_STRING("Hello World", target); +} + +void test_txt_should_handle_null_pointers_when_inserting(void) +{ + const char * msg = "Hello "; + char target[20] = {0}; + size_t msg_len = strlen(msg); + + strcpy(target, msg); + + _lv_txt_ins(target, msg_len, NULL); + + TEST_ASSERT_EQUAL_STRING("Hello ", target); +} + +void test_txt_cut_should_handle_null_pointer_to_txt(void) +{ + _lv_txt_cut(NULL, 0, 6); +} + +void test_txt_cut_happy_path(void) +{ + char msg[] = "Hello World"; + + _lv_txt_cut(msg, 0, 6); + + TEST_ASSERT_EQUAL_STRING("World", msg); +} + +void test_txt_cut_should_handle_len_longer_than_string_length(void) +{ + char msg[] = "Hello World"; + + _lv_txt_cut(msg, 0, 30); + + TEST_ASSERT_EQUAL_UINT8(msg[0], 0x00); +} + +void test_txt_get_encoded_next_should_decode_valid_ascii(void) +{ + char msg[] = "Hello World!"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32((uint32_t) 'H', result); +} + +void test_txt_get_encoded_next_detect_valid_2_byte_input(void) +{ + char msg[] = "\xc3\xb1"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(241, result); +} + +void test_txt_get_encoded_next_detect_invalid_2_byte_input(void) +{ + char msg[] = "\xc3\x28"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(0, result); +} + +void test_txt_get_encoded_next_detect_valid_3_byte_input(void) +{ + char msg[] = "\xe2\x82\xa1"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(8353, result); +} + +void test_txt_get_encoded_next_detect_invalid_3_byte_input(void) +{ + char msg[] = "\xe2\x28\xa1"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(0, result); +} + +void test_txt_get_encoded_next_detect_valid_4_byte_input(void) +{ + char msg[] = "\xf0\x90\x8c\xbc"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(66364, result); +} + +void test_txt_get_encoded_next_detect_invalid_4_byte_input(void) +{ + char msg[] = "\xf0\x28\x8c\x28"; + uint32_t result = 0; + + result = _lv_txt_encoded_next(msg, NULL); + + TEST_ASSERT_EQUAL_UINT32(0, result); +} + +/* See #2615 for more information */ +void test_txt_next_line_should_handle_empty_string(void) +{ + const lv_font_t * font_ptr = NULL; + lv_coord_t letter_space = 0; + lv_coord_t max_width = 0; + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; + + uint32_t next_line = _lv_txt_get_next_line("", font_ptr, letter_space, max_width, NULL, flag); + + TEST_ASSERT_EQUAL_UINT32(0, next_line); +} + +#endif diff --git a/lib/lvgl/tests/src/test_files/readtest.txt b/lib/lvgl/tests/src/test_files/readtest.txt new file mode 100644 index 00000000..e398426d Binary files /dev/null and b/lib/lvgl/tests/src/test_files/readtest.txt differ diff --git a/lib/lvgl/tests/src/test_fonts/font_1.c b/lib/lvgl/tests/src/test_fonts/font_1.c new file mode 100644 index 00000000..f32374f1 --- /dev/null +++ b/lib/lvgl/tests/src/test_fonts/font_1.c @@ -0,0 +1,1380 @@ +#if LV_BUILD_TEST +#include "../../lvgl.h" + +/******************************************************************************* + * Size: 8 px + * Bpp: 4 + * Opts: --bpp 4 --size 8 --font ../Montserrat-Medium.ttf -r 0x20-0x7F,0xB0,0x2022 --font ../FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o ..\generated_fonts/font_1.c + ******************************************************************************/ + +#ifndef FONT_1 +#define FONT_1 1 +#endif + +#if FONT_1 + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { + /* U+20 " " */ + + /* U+21 "!" */ + 0x58, 0xf, 0x11, 0x32, 0xb2, 0x80, + + /* U+22 "\"" */ + 0x73, 0x90, 0x10, 0x72, 0x90, + + /* U+23 "#" */ + 0x4, 0x52, 0x60, 0x4f, 0xc9, 0xc3, 0x43, 0x9c, + 0x83, 0x64, 0x8b, 0xa1, 0x65, 0x85, 0x81, + + /* U+24 "$" */ + 0x0, 0x40, 0x0, 0xad, 0x68, 0x97, 0x56, 0x89, + 0xf9, 0x60, 0x42, 0x17, 0x21, 0x69, 0x7e, 0x96, + 0x96, 0xcc, + + /* U+25 "%" */ + 0x58, 0x70, 0x63, 0xd, 0x8f, 0x30, 0x30, 0xa7, + 0xdb, 0x7, 0x12, 0x7d, 0xa1, 0x57, 0x6, 0xa2, + 0xfa, 0x40, + + /* U+26 "&" */ + 0x9, 0x98, 0x2, 0x2a, 0x30, 0x0, 0x97, 0xc1, + 0x4, 0xd6, 0xc4, 0x2, 0xe6, 0xc, 0xc4, 0x75, + 0x33, 0x10, + + /* U+27 "'" */ + 0x72, 0x0, 0x39, 0x0, + + /* U+28 "(" */ + 0x8, 0x20, 0x32, 0x11, 0x1, 0x10, 0x8, 0x80, + 0x22, 0x0, 0x19, 0x0, + + /* U+29 ")" */ + 0x73, 0x6a, 0x12, 0x7, 0x7, 0x12, 0x6a, + + /* U+2A "*" */ + 0x48, 0x40, 0x26, 0xc0, 0x7b, 0x90, + + /* U+2B "+" */ + 0x0, 0x10, 0x6, 0x80, 0x2, 0x4b, 0xc8, 0xa4, + 0xbc, 0x88, + + /* U+2C "," */ + 0x0, 0x3a, 0x82, 0x0, + + /* U+2D "-" */ + 0x5a, 0x60, + + /* U+2E "." */ + 0x0, 0x3a, 0x0, + + /* U+2F "/" */ + 0x0, 0xa8, 0x2, 0x22, 0x0, 0x55, 0x40, 0x8, + 0x88, 0x0, 0x4c, 0x0, 0xb5, 0xc0, 0x2, 0x2, + 0x0, + + /* U+30 "0" */ + 0xa, 0xbb, 0x13, 0x65, 0xd4, 0xfa, 0x80, 0xbf, + 0xa8, 0xb, 0xb6, 0x5d, 0x48, + + /* U+31 "1" */ + 0x9e, 0x29, 0x40, 0xf, 0xf0, + + /* U+32 "2" */ + 0x6a, 0xb9, 0x6, 0xab, 0x50, 0x9, 0x50, 0x1, + 0x5, 0x1, 0x2d, 0xb4, 0x60, + + /* U+33 "3" */ + 0x7a, 0xbe, 0x7, 0xa1, 0xc0, 0x2, 0x5, 0x80, + 0x12, 0x8c, 0xa2, 0xa8, 0x64, + + /* U+34 "4" */ + 0x0, 0x24, 0x80, 0x47, 0xd2, 0x0, 0x18, 0xa8, + 0x20, 0x90, 0xa5, 0x92, 0x8b, 0xa4, 0x82, + + /* U+35 "5" */ + 0x3d, 0xaa, 0x3, 0x5d, 0x50, 0x1, 0xb5, 0x0, + 0xb7, 0x42, 0x6f, 0x54, 0x33, 0x0, + + /* U+36 "6" */ + 0x9, 0xaa, 0x1b, 0x75, 0x50, 0xff, 0xd3, 0x45, + 0xe1, 0x31, 0x6, 0x19, 0x8e, + + /* U+37 "7" */ + 0xca, 0xa6, 0xb5, 0xd5, 0x5, 0x9c, 0x1a, 0xc0, + 0x2a, 0x70, 0x3, 0x58, 0x0, + + /* U+38 "8" */ + 0x1a, 0xa5, 0x92, 0x65, 0x7d, 0x25, 0xd4, 0xdc, + 0xca, 0xb2, 0x2f, 0xa6, 0xfc, + + /* U+39 "9" */ + 0x4a, 0x99, 0x7, 0xdc, 0x82, 0xc5, 0xc8, 0x69, + 0xd4, 0x86, 0x9d, 0x58, 0xa8, + + /* U+3A ":" */ + 0x74, 0x74, 0x0, 0x3a, 0x0, + + /* U+3B ";" */ + 0x74, 0x74, 0x0, 0x3a, 0x8b, 0xb1, 0x0, + + /* U+3C "<" */ + 0x0, 0x84, 0x0, 0x93, 0x20, 0x58, 0xa8, 0x5, + 0xd5, 0x91, 0x1, 0x69, 0x10, + + /* U+3D "=" */ + 0x49, 0x98, 0x52, 0x66, 0x14, 0x99, 0x84, + + /* U+3E ">" */ + 0x10, 0xc, 0x53, 0x4, 0x7, 0x3d, 0xe2, 0x92, + 0x5a, 0x29, 0x28, 0x0, + + /* U+3F "?" */ + 0x6a, 0xb9, 0x6, 0xab, 0x50, 0xa, 0xa0, 0x2, + 0x94, 0x0, 0x15, 0x80, 0x0, + + /* U+40 "@" */ + 0x3, 0x87, 0x74, 0x28, 0x15, 0xe6, 0xf2, 0x12, + 0xd4, 0x7d, 0x4b, 0x2e, 0x80, 0x7e, 0xa8, 0xf9, + 0x91, 0xc7, 0x15, 0xe0, 0xf6, 0x53, 0x0, + + /* U+41 "A" */ + 0x0, 0xae, 0x40, 0x31, 0x9c, 0x20, 0x14, 0x4c, + 0xa0, 0x0, 0x8d, 0x14, 0x82, 0x1f, 0x93, 0x2e, + 0x80, + + /* U+42 "B" */ + 0x2d, 0x99, 0x58, 0x83, 0xcc, 0x8d, 0x41, 0xe6, + 0x95, 0x40, 0xf3, 0x5d, 0x0, 0xf3, 0x28, 0xd0, + + /* U+43 "C" */ + 0x7, 0xba, 0xa1, 0x2f, 0x5d, 0x50, 0xb2, 0x80, + 0x36, 0x50, 0x6, 0x5e, 0xba, 0xa1, 0x0, + + /* U+44 "D" */ + 0x2e, 0xab, 0xb1, 0x80, 0x12, 0xae, 0xbc, 0x3, + 0x85, 0x48, 0x3, 0xa, 0x90, 0x25, 0x5d, 0x78, + 0x0, + + /* U+45 "E" */ + 0x2e, 0xaa, 0x40, 0x25, 0x52, 0x1, 0xea, 0x88, + 0xf, 0x54, 0x40, 0x4a, 0xa4, 0x80, + + /* U+46 "F" */ + 0x2e, 0xaa, 0x40, 0x25, 0x52, 0x1, 0x2a, 0x88, + 0x9, 0x54, 0x40, 0xe, + + /* U+47 "G" */ + 0x7, 0xba, 0xa1, 0x2f, 0x5d, 0x50, 0xb2, 0x80, + 0x4, 0x79, 0x40, 0x6, 0x45, 0xeb, 0xae, 0x40, + + /* U+48 "H" */ + 0x2a, 0x0, 0x15, 0x0, 0x7c, 0x95, 0x49, 0x0, + 0x25, 0x52, 0x40, 0x3e, + + /* U+49 "I" */ + 0x2a, 0x0, 0xfc, + + /* U+4A "J" */ + 0x5, 0xad, 0x50, 0x5a, 0xa0, 0x7, 0xf7, 0x88, + 0x4d, 0x1a, 0x0, + + /* U+4B "K" */ + 0x2a, 0x1, 0xa2, 0x0, 0xd, 0x41, 0x3, 0x6e, + 0x10, 0x0, 0x77, 0x94, 0x0, 0xe3, 0x3e, 0x80, + + /* U+4C "L" */ + 0x2a, 0x0, 0xff, 0xe3, 0xa5, 0x51, 0xc0, + + /* U+4D "M" */ + 0x2c, 0x0, 0x8f, 0x0, 0x5c, 0x1, 0x0, 0x4, + 0xe2, 0x8f, 0x0, 0xa2, 0x45, 0x0, 0x21, 0x89, + 0x0, 0x0, + + /* U+4E "N" */ + 0x2d, 0x10, 0x2a, 0x1, 0xa0, 0xc, 0xdf, 0x60, + 0x19, 0x3b, 0x80, 0x19, 0x6c, 0x0, + + /* U+4F "O" */ + 0x7, 0xbb, 0x8c, 0x17, 0xae, 0xd5, 0xe3, 0x94, + 0x0, 0x14, 0x5c, 0xa0, 0x0, 0xa2, 0xab, 0xae, + 0xd5, 0xe2, + + /* U+50 "P" */ + 0x2e, 0xaa, 0x48, 0x1, 0x2a, 0x82, 0x80, 0x18, + 0x9c, 0x12, 0xa9, 0x86, 0x9, 0x54, 0x60, + + /* U+51 "Q" */ + 0x7, 0xbb, 0x8c, 0x17, 0xae, 0xd5, 0xe3, 0x94, + 0x0, 0x14, 0x5c, 0xa0, 0x9, 0x15, 0x5d, 0x77, + 0x78, 0x83, 0xdc, 0x15, 0x18, + + /* U+52 "R" */ + 0x2e, 0xaa, 0x48, 0x1, 0x2a, 0x82, 0x80, 0x18, + 0x9c, 0x1e, 0xb0, 0x8c, 0x1e, 0xb4, 0x84, + + /* U+53 "S" */ + 0x2a, 0xa8, 0x97, 0x2a, 0x84, 0xfd, 0x30, 0x21, + 0x13, 0x90, 0xb5, 0x4e, 0xa0, + + /* U+54 "T" */ + 0xaa, 0x75, 0x35, 0x50, 0xa9, 0x80, 0x3f, 0xf8, + 0x60, + + /* U+55 "U" */ + 0x39, 0x0, 0x24, 0x0, 0x7f, 0xf0, 0x9, 0x40, + 0x5, 0xc3, 0x57, 0x58, 0xc0, + + /* U+56 "V" */ + 0xb, 0x10, 0x2, 0xb8, 0x7c, 0x0, 0x39, 0xc1, + 0x14, 0x57, 0x0, 0x28, 0x84, 0xb8, 0x4, 0x8b, + 0x60, 0x0, + + /* U+57 "W" */ + 0x94, 0x0, 0x78, 0x81, 0xcd, 0x70, 0x33, 0x41, + 0x54, 0x36, 0xd, 0x9c, 0x2, 0x30, 0xb9, 0x30, + 0x39, 0xc0, 0x3, 0x32, 0x82, 0x99, 0x80, + + /* U+58 "X" */ + 0x58, 0x2, 0xa0, 0x50, 0x79, 0xb0, 0x4, 0x43, + 0x84, 0x1, 0x57, 0xc2, 0xf, 0x89, 0x34, 0x0, + + /* U+59 "Y" */ + 0xa, 0x20, 0x5, 0x80, 0x2e, 0x42, 0x60, 0x0, + 0x3d, 0x62, 0x60, 0x12, 0xb4, 0x0, 0x70, 0x80, + 0x40, + + /* U+5A "Z" */ + 0x6a, 0xa6, 0x68, 0x35, 0x5b, 0xe0, 0x5, 0x52, + 0x20, 0xb, 0x82, 0x0, 0x43, 0x4d, 0x50, 0x0, + + /* U+5B "[" */ + 0x2d, 0x40, 0x44, 0x0, 0x7f, 0xf0, 0x51, 0x0, + + /* U+5C "\\" */ + 0x19, 0x0, 0x84, 0xc0, 0x37, 0xa8, 0x4, 0xbe, + 0x1, 0x8c, 0x40, 0x2a, 0x60, 0x8, 0xf4, 0x0, + + /* U+5D "]" */ + 0x8c, 0x80, 0xf, 0xe8, 0x0, + + /* U+5E "^" */ + 0x3, 0xc0, 0xa, 0xa1, 0x40, 0xb9, 0x30, 0x0, + + /* U+5F "_" */ + 0x77, 0xc0, + + /* U+60 "`" */ + 0x6, 0x60, + + /* U+61 "a" */ + 0x29, 0x94, 0x0, 0x42, 0xa1, 0x5b, 0x2, 0x2b, + 0xf9, 0x10, + + /* U+62 "b" */ + 0x48, 0x0, 0xff, 0x92, 0xad, 0x40, 0xd, 0x57, + 0x20, 0x1f, 0x9a, 0xa9, 0x20, + + /* U+63 "c" */ + 0x1a, 0xa8, 0x67, 0xaa, 0x82, 0x1, 0xd3, 0xd5, + 0x41, + + /* U+64 "d" */ + 0x0, 0xd6, 0x1, 0xc3, 0x55, 0x4, 0x75, 0x48, + 0x6, 0x10, 0x8e, 0x9b, 0x0, + + /* U+65 "e" */ + 0x19, 0x98, 0x60, 0x4, 0x4e, 0x39, 0x12, 0xd3, + 0xf5, 0x41, + + /* U+66 "f" */ + 0xa, 0xa0, 0x10, 0x50, 0x5b, 0xb8, 0x2d, 0x1c, + 0x3, 0xf8, + + /* U+67 "g" */ + 0x1a, 0x99, 0x5c, 0x74, 0xc3, 0x80, 0x46, 0x11, + 0xd5, 0xe, 0x4, 0x61, 0x0, + + /* U+68 "h" */ + 0x48, 0x0, 0xfe, 0x49, 0xb4, 0x5, 0x9a, 0xf0, + 0x10, 0x17, 0x0, 0xe0, + + /* U+69 "i" */ + 0x37, 0x37, 0x48, 0x0, 0xf0, + + /* U+6A "j" */ + 0x3, 0x70, 0x37, 0x3, 0x80, 0xf, 0xe6, 0x8c, + + /* U+6B "k" */ + 0x48, 0x0, 0xff, 0xa9, 0x0, 0x72, 0x50, 0x12, + 0xa4, 0x0, 0xad, 0xae, + + /* U+6C "l" */ + 0x48, 0x0, 0xff, 0x0, + + /* U+6D "m" */ + 0x4c, 0x9b, 0x89, 0xb4, 0x5, 0x98, 0x39, 0xbf, + 0x1, 0x1, 0x10, 0x1, 0xc0, 0x3f, 0x0, + + /* U+6E "n" */ + 0x4c, 0x9b, 0x40, 0x59, 0xaf, 0x1, 0x1, 0x70, + 0xe, + + /* U+6F "o" */ + 0x1a, 0xa8, 0x67, 0xaa, 0x6c, 0x3, 0xa7, 0xaa, + 0x6c, + + /* U+70 "p" */ + 0x4c, 0xab, 0x50, 0x3, 0x55, 0xc8, 0x7, 0xe6, + 0xaa, 0x48, 0x1, 0x2a, 0x8a, 0x0, + + /* U+71 "q" */ + 0x1a, 0xa4, 0xdc, 0x75, 0x50, 0x3, 0xd1, 0xd5, + 0x40, 0x1a, 0xa4, 0x80, + + /* U+72 "r" */ + 0x4b, 0xa0, 0x0, 0xd0, 0x0, 0x80, 0x3c, + + /* U+73 "s" */ + 0x5b, 0x95, 0xdc, 0xa5, 0x84, 0x44, 0xbc, 0xef, + 0x80, + + /* U+74 "t" */ + 0x29, 0x0, 0x5a, 0x38, 0x5a, 0x38, 0x7, 0x11, + 0x24, 0x0, + + /* U+75 "u" */ + 0x57, 0x1, 0xb0, 0xe, 0x1f, 0x2, 0x4, 0x29, + 0xa0, + + /* U+76 "v" */ + 0xb, 0x0, 0x42, 0x7, 0x38, 0x1a, 0x2, 0xe3, + 0xf0, 0x5, 0xb4, 0xa0, + + /* U+77 "w" */ + 0xb0, 0x7, 0x10, 0x50, 0x72, 0xa9, 0xe8, 0x88, + 0xb, 0xfe, 0x92, 0xaa, 0x0, 0xc, 0x83, 0xc, + 0x80, + + /* U+78 "x" */ + 0x67, 0x1b, 0x6, 0xea, 0xa0, 0x0, 0xc0, 0xc1, + 0xfe, 0xa4, 0x0, + + /* U+79 "y" */ + 0xb, 0x10, 0x83, 0x8, 0x91, 0x23, 0x3, 0x2b, + 0x90, 0xb, 0x80, 0xc0, 0x15, 0xf0, 0x0, + + /* U+7A "z" */ + 0x59, 0xbb, 0x2c, 0x5, 0x5, 0x48, 0xcb, 0xdc, + 0x0, + + /* U+7B "{" */ + 0xa, 0x60, 0x66, 0x0, 0x4a, 0xe0, 0xae, 0x1, + 0xcc, 0xc0, + + /* U+7C "|" */ + 0x28, 0x0, 0xff, 0xe0, 0x0, + + /* U+7D "}" */ + 0x97, 0x9, 0xc0, 0xe, 0x63, 0x6, 0x30, 0xa, + 0x70, 0x0, + + /* U+7E "~" */ + 0x29, 0x35, 0x17, 0x95, 0xd1, + + /* U+B0 "°" */ + 0x26, 0x45, 0x63, 0x57, 0x20, + + /* U+2022 "•" */ + 0x0, 0x2e, 0xaf, 0x80, + + /* U+F001 "" */ + 0x0, 0xff, 0xe0, 0x13, 0x5f, 0x0, 0x23, 0x75, + 0x28, 0x20, 0x7, 0x21, 0x6a, 0x0, 0xd9, 0xd2, + 0xa0, 0x18, 0xc0, 0x3f, 0xab, 0xc2, 0xbc, 0x3, + 0x94, 0x0, 0xa0, 0xa, 0xfa, + + /* U+F008 "" */ + 0xbd, 0xcc, 0xba, 0xac, 0xdb, 0x32, 0x9f, 0x34, + 0x66, 0xdb, 0xe8, 0x1, 0xf9, 0x19, 0xb6, 0xfa, + 0x1b, 0x66, 0x53, 0xe6, + + /* U+F00B "" */ + 0x34, 0x14, 0x4c, 0x79, 0x6d, 0x77, 0xb1, 0x50, + 0xd1, 0x32, 0x8b, 0x8b, 0xbe, 0x14, 0x32, 0x33, + 0xc9, 0x30, 0xd0, 0xef, 0x4c, 0xa1, 0xa1, 0xde, + 0x95, 0x43, 0x44, 0xca, + + /* U+F00C "" */ + 0x0, 0xf4, 0xd0, 0x7, 0x4b, 0x5, 0x48, 0x2, + 0x59, 0x68, 0x1a, 0x64, 0xcb, 0x41, 0x4a, 0xcc, + 0x5a, 0x0, 0xa9, 0x99, 0x40, 0x10, + + /* U+F00D "" */ + 0x63, 0x0, 0x41, 0x56, 0x25, 0x3b, 0x69, 0x5a, + 0xca, 0xb, 0x80, 0x14, 0x29, 0x60, 0xb0, 0xc2, + 0x5f, 0x10, 0x0, + + /* U+F011 "" */ + 0x0, 0xb1, 0x44, 0x0, 0x3a, 0xe2, 0x7e, 0xe1, + 0x20, 0xe0, 0xb, 0x81, 0x4a, 0x0, 0x94, 0x5c, + 0x40, 0x16, 0x80, 0x12, 0x50, 0x31, 0x20, 0xa4, + 0x1e, 0x3c, 0x5b, 0x90, 0xfa, 0xd2, 0x4c, 0x0, + + /* U+F013 "" */ + 0x0, 0xb3, 0x0, 0x10, 0xc4, 0xc, 0xd1, 0x1, + 0x97, 0x70, 0x89, 0xdd, 0x34, 0x3, 0xdc, 0x10, + 0xa0, 0xf, 0xd4, 0x3, 0xdc, 0x10, 0xa9, 0x77, + 0x8, 0x9d, 0xd2, 0x31, 0x3, 0x34, 0x40, 0x40, + + /* U+F015 "" */ + 0x0, 0xc6, 0x4, 0x40, 0xd, 0x59, 0x51, 0x0, + 0x0, 0xe8, 0x48, 0x28, 0x0, 0xfd, 0x46, 0x45, + 0xd0, 0xe2, 0xa, 0x80, 0x8b, 0x10, 0xbe, 0x20, + 0x40, 0x2e, 0xb0, 0x8, 0xec, 0xc0, 0x36, 0xa2, + 0x1, 0x11, 0xa0, + + /* U+F019 "" */ + 0x0, 0xbf, 0xc0, 0x1f, 0xfc, 0x87, 0xf0, 0x7, + 0xb8, 0x1, 0xd8, 0x0, 0xce, 0xf, 0x1c, 0xaa, + 0xe8, 0x78, 0x78, 0x11, 0x43, 0xc0, 0x4, 0x89, + 0x80, + + /* U+F01C "" */ + 0x5, 0xff, 0xe5, 0x1, 0xbc, 0xff, 0xb2, 0xc6, + 0xd8, 0xc0, 0x23, 0x6b, 0x57, 0xf6, 0x6, 0xf7, + 0x50, 0xa, 0x7e, 0x40, 0x22, 0x0, 0xf8, 0x80, + + /* U+F021 "" */ + 0x0, 0xf8, 0xc0, 0xaf, 0xfd, 0x67, 0x85, 0x85, + 0xdc, 0x3c, 0xb, 0x49, 0x17, 0x40, 0x5, 0x58, + 0x1, 0x22, 0xec, 0xea, 0x84, 0x44, 0x57, 0xbb, + 0x42, 0x0, 0x2a, 0x80, 0x2c, 0x6b, 0x6d, 0x1, + 0x85, 0x32, 0x3c, 0x1c, 0x28, 0xcc, 0x40, 0x80, + + /* U+F026 "" */ + 0x0, 0xa4, 0xd3, 0x1b, 0x2c, 0xc0, 0x39, 0x50, + 0x1, 0x57, 0x60, 0x9, 0x38, + + /* U+F027 "" */ + 0x0, 0xa4, 0x0, 0x69, 0x8c, 0x3, 0x96, 0x60, + 0x34, 0x1, 0xe4, 0x40, 0x0, 0x6a, 0xee, 0x0, + 0x8, 0x1, 0x38, 0x0, + + /* U+F028 "" */ + 0x0, 0xf2, 0xa0, 0x6, 0x90, 0x26, 0xf3, 0x32, + 0x63, 0x0, 0x3e, 0x21, 0x96, 0x60, 0x33, 0x25, + 0x70, 0xf, 0xe5, 0x40, 0x0, 0xcc, 0x95, 0xaa, + 0xec, 0x1, 0x7c, 0x48, 0x1, 0x38, 0x9, 0xbc, + 0xc0, + + /* U+F03E "" */ + 0xdf, 0xff, 0x69, 0x7c, 0x0, 0x62, 0x8, 0xb0, + 0x4e, 0x40, 0x1, 0xca, 0x58, 0xd8, 0x2, 0xd6, + 0xc0, 0x31, 0x7f, 0xf8, 0x80, + + /* U+F048 "" */ + 0x40, 0x8, 0xac, 0x82, 0x34, 0x1, 0x2e, 0x0, + 0xe6, 0x0, 0x8c, 0x3, 0x50, 0x80, 0x4f, 0x82, + 0x8, 0x65, 0xec, + + /* U+F04B "" */ + 0x0, 0xfb, 0x68, 0x40, 0x31, 0x2f, 0x38, 0x7, + 0xa3, 0x50, 0x3, 0x8a, 0xe8, 0x3, 0xfe, 0x2b, + 0xa0, 0xa, 0x35, 0x0, 0x97, 0x9c, 0x2, 0xda, + 0x10, 0xc, + + /* U+F04C "" */ + 0x9b, 0x90, 0x9b, 0x96, 0x46, 0x6, 0x46, 0x0, + 0xff, 0xeb, 0xed, 0xe8, 0x6d, 0xe8, + + /* U+F04D "" */ + 0x24, 0x4e, 0x2d, 0xbb, 0xed, 0x0, 0xff, 0xeb, + 0xba, 0x27, 0x38, + + /* U+F051 "" */ + 0x20, 0x9, 0x36, 0x0, 0xac, 0x1e, 0x40, 0x33, + 0x70, 0x6, 0x30, 0x8, 0x68, 0x0, 0x58, 0xe0, + 0xd8, 0x46, 0x80, + + /* U+F052 "" */ + 0x0, 0xc4, 0x1, 0xf4, 0x6c, 0x0, 0x73, 0xb8, + 0x1d, 0xc0, 0x12, 0xc0, 0x5, 0xa, 0x0, 0xb0, + 0xe, 0xb0, 0x5, 0xbb, 0xf5, 0x80, 0x29, 0xdf, + 0xa8, 0x0, 0xa8, 0x9c, 0xa0, + + /* U+F053 "" */ + 0x0, 0x98, 0x80, 0xf, 0x2c, 0xf, 0x14, 0x8b, + 0x12, 0xa0, 0x83, 0xa0, 0x1, 0xc5, 0xb0, 0x1, + 0x62, 0xb0, 0x0, 0xbd, 0x80, + + /* U+F054 "" */ + 0x26, 0x0, 0x9a, 0x5c, 0x0, 0x95, 0xe, 0x0, + 0x59, 0x85, 0x0, 0x68, 0xa0, 0x5a, 0xe0, 0xb2, + 0xe1, 0x3, 0x79, 0x0, 0x0, + + /* U+F067 "" */ + 0x0, 0x90, 0x3, 0x8e, 0xcc, 0x3, 0x38, 0x38, + 0x1, 0xe3, 0x83, 0xa1, 0xe5, 0xd4, 0x15, 0xe7, + 0xbe, 0xc2, 0xff, 0x80, 0x3f, 0x95, 0x14, 0x0, + + /* U+F068 "" */ + 0x78, 0x8e, 0x79, 0x77, 0xe9, + + /* U+F06E "" */ + 0x0, 0x46, 0x65, 0x0, 0x1, 0xd5, 0xda, 0xf5, + 0xd1, 0xd2, 0x84, 0x8e, 0x82, 0xd7, 0x0, 0x40, + 0x80, 0x6a, 0x28, 0xe8, 0xe8, 0x2d, 0x1d, 0x5e, + 0xbf, 0x5c, 0x10, + + /* U+F070 "" */ + 0x1d, 0x30, 0xf, 0xc3, 0x1b, 0x19, 0x95, 0x10, + 0x4, 0xb8, 0xaf, 0x10, 0x3d, 0x40, 0x3, 0xc6, + 0xd, 0xda, 0x82, 0x84, 0x0, 0xb7, 0x52, 0x8, + 0x2, 0x0, 0x75, 0x51, 0xb6, 0x48, 0x58, 0x80, + 0x2a, 0x7f, 0x13, 0xd3, 0xc4, 0x2, 0x6c, 0xc3, + 0x8d, 0x9c, 0x0, + + /* U+F071 "" */ + 0x0, 0xc7, 0xc6, 0x1, 0xfb, 0xc7, 0xc0, 0x3e, + 0x63, 0x39, 0x80, 0x3d, 0x5, 0x85, 0x0, 0x1d, + 0x2, 0x60, 0x63, 0x0, 0x11, 0x38, 0xb, 0x8, + 0x39, 0x0, 0x24, 0x0, 0x28, 0x20, 0x8, 0x0, + 0x30, 0x0, 0x74, 0x40, 0xe, 0x0, + + /* U+F074 "" */ + 0x0, 0xf1, 0x2, 0x20, 0x2, 0x4d, 0x5a, 0xbb, + 0xe, 0x58, 0x47, 0x70, 0xf4, 0x78, 0xf0, 0x0, + 0xa0, 0xa0, 0x17, 0x70, 0x74, 0xf8, 0xf2, 0xaf, + 0x6, 0xec, 0x10, 0x88, 0x0, 0x93, 0x54, + + /* U+F077 "" */ + 0x0, 0xfe, 0x4e, 0x40, 0x9, 0x2c, 0xad, 0x1, + 0x2d, 0xf1, 0xed, 0x3d, 0xe0, 0x21, 0xfe, 0xe0, + 0x2, 0x8b, + + /* U+F078 "" */ + 0x0, 0xfa, 0xe0, 0x2, 0x8b, 0xf7, 0x80, 0x87, + 0xf4, 0xb7, 0xc7, 0xb4, 0x4, 0xb2, 0xb4, 0x0, + 0x93, 0x90, 0x0, + + /* U+F079 "" */ + 0x0, 0x4a, 0xa, 0x26, 0x0, 0xad, 0xae, 0x7f, + 0xeb, 0x10, 0x1, 0xa4, 0x75, 0xdc, 0x20, 0x14, + 0x1, 0xb0, 0x0, 0x40, 0xc0, 0x31, 0xa2, 0x17, + 0xc7, 0xd4, 0x1, 0x98, 0xff, 0x6d, 0x82, 0xa8, + 0x0, 0xf7, 0x74, 0x2e, 0xc0, 0x0, + + /* U+F07B "" */ + 0xdf, 0xf5, 0x80, 0x62, 0x0, 0x27, 0xfd, 0xa0, + 0x1f, 0x10, 0x7, 0xff, 0x10, 0x80, 0x3c, 0x40, + + /* U+F093 "" */ + 0x0, 0xa6, 0x40, 0x1d, 0x2c, 0xc9, 0x0, 0x9d, + 0x80, 0xc, 0xe0, 0x7, 0xf0, 0x7, 0xb8, 0x7, + 0xf3, 0xc2, 0x0, 0x12, 0x1e, 0x1e, 0x9d, 0xd4, + 0xf0, 0x0, 0x17, 0x72, 0xa0, 0x0, + + /* U+F095 "" */ + 0x0, 0xff, 0xe1, 0xbf, 0x50, 0x7, 0xa4, 0x50, + 0x3, 0xc4, 0x4, 0x1, 0xe8, 0xb, 0x0, 0xe1, + 0x91, 0x70, 0x7d, 0xc4, 0xc2, 0xd0, 0x4, 0x91, + 0xd9, 0xe1, 0x80, 0x10, 0x4e, 0x38, 0xc0, 0x0, + + /* U+F0C4 "" */ + 0x3, 0x0, 0xf6, 0x76, 0x1, 0x6e, 0x1, 0x51, + 0x96, 0x1f, 0x5, 0x60, 0x68, 0x61, 0x2, 0x78, + 0x1, 0x8, 0x1, 0x92, 0xc, 0xb2, 0x0, 0x2a, + 0x19, 0x86, 0x90, 0xad, 0xa0, 0x7b, 0xc0, + + /* U+F0C5 "" */ + 0x0, 0x7f, 0xce, 0x8e, 0x80, 0x11, 0x9a, 0x30, + 0x2, 0xb8, 0x0, 0xff, 0xe5, 0x1c, 0x3b, 0xd0, + 0x9, 0xe, 0xe8, 0x70, + + /* U+F0C7 "" */ + 0x24, 0x4c, 0x21, 0xbf, 0xfc, 0x41, 0x77, 0x87, + 0xc1, 0x13, 0x1, 0x5, 0xda, 0x2c, 0x3, 0x36, + 0x30, 0x6, 0x45, 0x40, 0x3, 0xa3, 0x73, 0x23, + 0x80, + + /* U+F0E7 "" */ + 0x7, 0xff, 0x30, 0x5, 0xa0, 0x4, 0x0, 0x98, + 0x1, 0x4e, 0x0, 0x20, 0x3, 0xe0, 0x2, 0x5c, + 0x42, 0x40, 0xf, 0x2, 0xe4, 0x1, 0x18, 0xc0, + 0x6, 0x5b, 0x0, 0x80, + + /* U+F0EA "" */ + 0x79, 0xb9, 0x70, 0x4, 0x33, 0xb4, 0x0, 0x6a, + 0x77, 0x18, 0x5, 0xce, 0xeb, 0xb0, 0x7, 0x8c, + 0x3, 0x9d, 0xd0, 0xe0, 0x1c, 0xf1, 0xe0, 0x18, + + /* U+F0F3 "" */ + 0x0, 0xb4, 0x3, 0x27, 0x17, 0x18, 0x2, 0x44, + 0x7, 0x80, 0x4, 0x1, 0x10, 0x18, 0x7, 0x1c, + 0x0, 0x74, 0x63, 0xbf, 0x6b, 0xc6, 0x3e, 0x43, + 0x0, + + /* U+F11C "" */ + 0xdf, 0xff, 0xb4, 0xb9, 0xdd, 0xce, 0xee, 0x20, + 0xf2, 0x26, 0x91, 0x3c, 0x3, 0xfe, 0xf2, 0xac, + 0xa2, 0xf0, 0x2e, 0x7f, 0xf9, 0xf8, 0x80, + + /* U+F124 "" */ + 0x0, 0xff, 0xe2, 0x25, 0xe0, 0x7, 0x2e, 0x5a, + 0x38, 0x4, 0xdd, 0x46, 0x0, 0xf0, 0x6, 0xc8, + 0x80, 0x46, 0x80, 0xb, 0x77, 0x18, 0x2, 0x40, + 0x26, 0x88, 0x20, 0xa, 0x80, 0x7e, 0x80, 0xf, + 0xb4, 0x98, 0x3, 0xe5, 0xd0, 0xc, + + /* U+F15B "" */ + 0xff, 0xa2, 0xc0, 0x39, 0x2c, 0x2, 0x47, 0x30, + 0x8, 0xdd, 0xc0, 0x1f, 0xfc, 0xc0, + + /* U+F1EB "" */ + 0x0, 0x91, 0xdc, 0x80, 0x1a, 0x7e, 0xef, 0x7c, + 0x86, 0x25, 0xfe, 0x63, 0xed, 0x33, 0xb4, 0x2f, + 0xfd, 0x61, 0xbc, 0x43, 0x63, 0x54, 0x1b, 0x12, + 0x1, 0xfa, 0x74, 0xaf, 0x10, 0xe, 0xcf, 0x0, + 0xfc, 0xd2, 0x1, 0x80, + + /* U+F240 "" */ + 0x24, 0x4f, 0xc1, 0xbf, 0xff, 0x4d, 0x6, 0x2a, + 0xfa, 0x14, 0x3c, 0x47, 0xce, 0x0, 0xd9, 0x9f, + 0x42, 0x3f, 0x6e, 0xf8, 0x60, + + /* U+F241 "" */ + 0x24, 0x4f, 0xc1, 0xbf, 0xff, 0x4d, 0x6, 0x2a, + 0xec, 0xb8, 0x50, 0xf1, 0x1d, 0xe0, 0xe0, 0xd, + 0x99, 0xda, 0x90, 0x8f, 0xdb, 0xbb, 0xbc, 0x60, + + /* U+F242 "" */ + 0x24, 0x4f, 0xc1, 0xbf, 0xff, 0x4d, 0x6, 0x2a, + 0xd7, 0x74, 0x28, 0x78, 0x8c, 0x1, 0x38, 0x3, + 0x66, 0x64, 0x4a, 0x11, 0xfb, 0x76, 0xff, 0x86, + 0x0, + + /* U+F243 "" */ + 0x24, 0x4f, 0xc1, 0xbf, 0xff, 0x4d, 0x6, 0x2e, + 0x5d, 0xe8, 0x50, 0xf1, 0xf0, 0xc, 0xe0, 0xd, + 0x9d, 0x44, 0xd0, 0x8f, 0xdb, 0xdf, 0xf8, 0x60, + + /* U+F244 "" */ + 0x24, 0x4f, 0xc1, 0xbf, 0xff, 0x4c, 0x5, 0xdf, + 0xd0, 0xe0, 0x1f, 0x9c, 0x0, 0x89, 0xf4, 0x13, + 0xff, 0xfc, 0x3c, + + /* U+F287 "" */ + 0x0, 0xff, 0xe1, 0xbe, 0xc0, 0x7, 0xce, 0x97, + 0x80, 0x1a, 0x6c, 0x78, 0x9d, 0x45, 0xc8, 0x1d, + 0x24, 0x72, 0x66, 0xab, 0xc, 0xd8, 0x85, 0xe0, + 0x7e, 0xc8, 0x11, 0x0, 0xc, 0x4d, 0x60, 0x1f, + 0x9b, 0xb0, 0x2, + + /* U+F293 "" */ + 0x6, 0xdd, 0x61, 0x82, 0x49, 0x71, 0x70, 0x69, + 0xa3, 0x59, 0x14, 0x78, 0x9e, 0xc, 0x0, 0xf0, + 0x10, 0x72, 0x31, 0x7f, 0x1, 0xd3, 0x65, 0x91, + 0x24, 0x92, 0xd0, 0xd0, + + /* U+F2ED "" */ + 0x78, 0xdf, 0xd8, 0x70, 0x2, 0xba, 0x80, 0x3d, + 0xdf, 0xbc, 0xc, 0xce, 0x66, 0x0, 0xff, 0xe5, + 0x69, 0x99, 0xcc, 0xda, + + /* U+F304 "" */ + 0x0, 0xf3, 0xf1, 0x80, 0x72, 0x60, 0xe8, 0x6, + 0x8b, 0x24, 0x90, 0xa, 0x1c, 0x1b, 0xdc, 0x1, + 0xe, 0x0, 0x74, 0x0, 0x3b, 0x80, 0xf, 0x0, + 0x14, 0x80, 0x1e, 0x0, 0x38, 0x62, 0x0, 0x1d, + 0xdc, 0x70, 0xe, + + /* U+F55A "" */ + 0x0, 0x57, 0xff, 0xb0, 0x2d, 0x41, 0x8c, 0xcc, + 0x7, 0x48, 0x0, 0x5d, 0xd2, 0x80, 0x7f, 0xf0, + 0x29, 0x0, 0xb, 0xba, 0x50, 0xa, 0xd4, 0x18, + 0xcc, 0xc0, 0x60, + + /* U+F7C2 "" */ + 0x7, 0xff, 0xb8, 0x5f, 0x27, 0x60, 0x89, 0xb, + 0xb7, 0x84, 0x0, 0x14, 0x64, 0x10, 0xf, 0xfe, + 0x51, 0x80, 0x61, 0x20, + + /* U+F8A2 "" */ + 0x0, 0xf8, 0xc0, 0x4, 0x60, 0x11, 0x60, 0x16, + 0x51, 0x14, 0xe0, 0xf, 0x16, 0xdd, 0xa8, 0x1, + 0xe2, 0xdb, 0xbb, 0x80, 0xb2, 0x88, 0xb0, 0x80 +}; + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 34, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 0, .adv_w = 34, .box_w = 2, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6, .adv_w = 50, .box_w = 3, .box_h = 3, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 11, .adv_w = 90, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 26, .adv_w = 79, .box_w = 5, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 44, .adv_w = 108, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 62, .adv_w = 88, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 80, .adv_w = 27, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 84, .adv_w = 43, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 96, .adv_w = 43, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 103, .adv_w = 51, .box_w = 4, .box_h = 3, .ofs_x = 0, .ofs_y = 3}, + {.bitmap_index = 109, .adv_w = 74, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 119, .adv_w = 29, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 123, .adv_w = 49, .box_w = 3, .box_h = 1, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 125, .adv_w = 29, .box_w = 2, .box_h = 2, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 128, .adv_w = 45, .box_w = 5, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 145, .adv_w = 85, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 158, .adv_w = 47, .box_w = 3, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 163, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 176, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 189, .adv_w = 86, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 204, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 218, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 231, .adv_w = 77, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 244, .adv_w = 82, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 257, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 270, .adv_w = 29, .box_w = 2, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 275, .adv_w = 29, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 282, .adv_w = 74, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 295, .adv_w = 74, .box_w = 5, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 302, .adv_w = 74, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 314, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 327, .adv_w = 132, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 350, .adv_w = 94, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 367, .adv_w = 97, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 383, .adv_w = 93, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 398, .adv_w = 106, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 415, .adv_w = 86, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 429, .adv_w = 81, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 441, .adv_w = 99, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 457, .adv_w = 104, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 469, .adv_w = 40, .box_w = 2, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 472, .adv_w = 66, .box_w = 5, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 483, .adv_w = 92, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 499, .adv_w = 76, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 506, .adv_w = 122, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 524, .adv_w = 104, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 538, .adv_w = 108, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 556, .adv_w = 92, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 571, .adv_w = 108, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 592, .adv_w = 93, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 607, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 620, .adv_w = 75, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 629, .adv_w = 101, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 642, .adv_w = 91, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 660, .adv_w = 144, .box_w = 9, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 683, .adv_w = 86, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 699, .adv_w = 83, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 716, .adv_w = 84, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 732, .adv_w = 43, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 740, .adv_w = 45, .box_w = 5, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 756, .adv_w = 43, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 761, .adv_w = 75, .box_w = 5, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 769, .adv_w = 64, .box_w = 4, .box_h = 1, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 771, .adv_w = 77, .box_w = 3, .box_h = 1, .ofs_x = 0, .ofs_y = 5}, + {.bitmap_index = 773, .adv_w = 77, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 783, .adv_w = 87, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 796, .adv_w = 73, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 805, .adv_w = 87, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 818, .adv_w = 78, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 828, .adv_w = 45, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 838, .adv_w = 88, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 851, .adv_w = 87, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 863, .adv_w = 36, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 868, .adv_w = 36, .box_w = 3, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 876, .adv_w = 79, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 888, .adv_w = 36, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 892, .adv_w = 135, .box_w = 8, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 907, .adv_w = 87, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 916, .adv_w = 81, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 925, .adv_w = 87, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 939, .adv_w = 87, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 951, .adv_w = 52, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 958, .adv_w = 64, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 967, .adv_w = 53, .box_w = 4, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 977, .adv_w = 87, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 986, .adv_w = 72, .box_w = 6, .box_h = 4, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 998, .adv_w = 115, .box_w = 8, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1015, .adv_w = 71, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1026, .adv_w = 72, .box_w = 6, .box_h = 5, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1041, .adv_w = 67, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1050, .adv_w = 45, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1060, .adv_w = 38, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1065, .adv_w = 45, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1075, .adv_w = 74, .box_w = 5, .box_h = 2, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 1080, .adv_w = 54, .box_w = 3, .box_h = 3, .ofs_x = 0, .ofs_y = 3}, + {.bitmap_index = 1085, .adv_w = 40, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1089, .adv_w = 128, .box_w = 8, .box_h = 9, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1118, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1138, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1166, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1188, .adv_w = 88, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1207, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1239, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1271, .adv_w = 144, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1306, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1331, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1355, .adv_w = 128, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1395, .adv_w = 64, .box_w = 4, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1408, .adv_w = 96, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1428, .adv_w = 144, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1461, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1482, .adv_w = 112, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1501, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1527, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1541, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1552, .adv_w = 112, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1571, .adv_w = 112, .box_w = 9, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1600, .adv_w = 80, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1621, .adv_w = 80, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1642, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1666, .adv_w = 112, .box_w = 7, .box_h = 2, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 1671, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1698, .adv_w = 160, .box_w = 11, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1741, .adv_w = 144, .box_w = 11, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1779, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1810, .adv_w = 112, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1828, .adv_w = 112, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1847, .adv_w = 160, .box_w = 11, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1885, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1901, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1931, .adv_w = 128, .box_w = 9, .box_h = 9, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1963, .adv_w = 112, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1994, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2014, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2039, .adv_w = 80, .box_w = 7, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 2067, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2091, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2116, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2139, .adv_w = 128, .box_w = 10, .box_h = 10, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 2177, .adv_w = 96, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2191, .adv_w = 160, .box_w = 10, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2227, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2248, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2272, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2297, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2321, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2340, .adv_w = 160, .box_w = 11, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2375, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2403, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2423, .adv_w = 128, .box_w = 9, .box_h = 9, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 2458, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2485, .adv_w = 96, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2505, .adv_w = 129, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + +static const uint16_t unicode_list_1[] = { + 0x0, 0x1f72, 0xef51, 0xef58, 0xef5b, 0xef5c, 0xef5d, 0xef61, + 0xef63, 0xef65, 0xef69, 0xef6c, 0xef71, 0xef76, 0xef77, 0xef78, + 0xef8e, 0xef98, 0xef9b, 0xef9c, 0xef9d, 0xefa1, 0xefa2, 0xefa3, + 0xefa4, 0xefb7, 0xefb8, 0xefbe, 0xefc0, 0xefc1, 0xefc4, 0xefc7, + 0xefc8, 0xefc9, 0xefcb, 0xefe3, 0xefe5, 0xf014, 0xf015, 0xf017, + 0xf037, 0xf03a, 0xf043, 0xf06c, 0xf074, 0xf0ab, 0xf13b, 0xf190, + 0xf191, 0xf192, 0xf193, 0xf194, 0xf1d7, 0xf1e3, 0xf23d, 0xf254, + 0xf4aa, 0xf712, 0xf7f2 +}; + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 32, .range_length = 95, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + }, + { + .range_start = 176, .range_length = 63475, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 59, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + } +}; + +/*----------------- + * KERNING + *----------------*/ + +/*Map glyph_ids to kern left classes*/ +static const uint8_t kern_left_class_mapping[] = +{ + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 0, 13, 14, 15, 16, 17, + 18, 19, 12, 20, 20, 0, 0, 0, + 21, 22, 23, 24, 25, 22, 26, 27, + 28, 29, 29, 30, 31, 32, 29, 29, + 22, 33, 34, 35, 3, 36, 30, 37, + 37, 38, 39, 40, 41, 42, 43, 0, + 44, 0, 45, 46, 47, 48, 49, 50, + 51, 45, 52, 52, 53, 48, 45, 45, + 46, 46, 54, 55, 56, 57, 51, 58, + 58, 59, 58, 60, 41, 0, 0, 9, + 61, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +/*Map glyph_ids to kern right classes*/ +static const uint8_t kern_right_class_mapping[] = +{ + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 12, + 18, 19, 20, 21, 21, 0, 0, 0, + 22, 23, 24, 25, 23, 25, 25, 25, + 23, 25, 25, 26, 25, 25, 25, 25, + 23, 25, 23, 25, 3, 27, 28, 29, + 29, 30, 31, 32, 33, 34, 35, 0, + 36, 0, 37, 38, 39, 39, 39, 0, + 39, 38, 40, 41, 38, 38, 42, 42, + 39, 42, 39, 42, 43, 44, 45, 46, + 46, 47, 46, 48, 0, 0, 35, 9, + 49, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +/*Kern values between classes*/ +static const int8_t kern_class_values[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 3, -3, 0, 0, + 0, 0, -7, -8, 1, 6, 3, 2, + -5, 1, 6, 0, 5, 1, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 1, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, -4, 0, 0, 0, 0, + 0, -3, 2, 3, 0, 0, -1, 0, + -1, 1, 0, -1, 0, -1, -1, -3, + 0, 0, 0, 0, -1, 0, 0, -2, + -2, 0, 0, -1, 0, -3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + -1, 0, -2, 0, -3, 0, -15, 0, + 0, -3, 0, 3, 4, 0, 0, -3, + 1, 1, 4, 3, -2, 3, 0, 0, + -7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -3, -2, -6, 0, -5, + -1, 0, 0, 0, 0, 0, 5, 0, + -4, -1, 0, 0, 0, -2, 0, 0, + -1, -9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -10, -1, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 4, + 0, 1, 0, 0, -3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 5, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 3, 1, 4, -1, 0, 0, 3, -1, + -4, -18, 1, 3, 3, 0, -2, 0, + 5, 0, 4, 0, 4, 0, -12, 0, + -2, 4, 0, 4, -1, 3, 1, 0, + 0, 0, -1, 0, 0, -2, 10, 0, + 10, 0, 4, 0, 5, 2, 2, 4, + 0, 0, 0, -5, 0, 0, 0, 0, + 0, -1, 0, 1, -2, -2, -3, 1, + 0, -1, 0, 0, 0, -5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -7, 0, -8, 0, 0, 0, + 0, -1, 0, 13, -2, -2, 1, 1, + -1, 0, -2, 1, 0, 0, -7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -12, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 8, 0, 0, -5, 0, + 4, 0, -9, -12, -9, -3, 4, 0, + 0, -9, 0, 2, -3, 0, -2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 4, -16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 1, 0, 0, 0, + 0, 0, 1, 1, -2, -3, 0, 0, + 0, -1, 0, 0, -1, 0, 0, 0, + -3, 0, -1, 0, -3, -3, 0, -3, + -4, -4, -2, 0, -3, 0, -3, 0, + 0, 0, 0, -1, 0, 0, 1, 0, + 1, -1, 0, 0, 0, 0, 0, 1, + -1, 0, 0, 0, -1, 1, 1, 0, + 0, 0, 0, -2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, -1, 0, + -2, 0, -2, 0, 0, -1, 0, 4, + 0, 0, -1, 0, 0, 0, 0, 0, + 0, 0, -1, -1, 0, 0, -1, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, -1, 0, -1, -2, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, -1, -1, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, -1, -2, 0, -2, 0, -4, + -1, -4, 3, 0, 0, -3, 1, 3, + 3, 0, -3, 0, -2, 0, 0, -6, + 1, -1, 1, -7, 1, 0, 0, 0, + -7, 0, -7, -1, -11, -1, 0, -6, + 0, 3, 4, 0, 2, 0, 0, 0, + 0, 0, 0, -2, -2, 0, -4, 0, + 0, 0, -1, 0, 0, 0, -1, 0, + 0, 0, 0, 0, -1, -1, 0, -1, + -2, 0, 0, 0, 0, 0, 0, 0, + -1, -1, 0, -1, -2, -1, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, -1, 0, -2, + 0, -1, 0, -3, 1, 0, 0, -2, + 1, 1, 1, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 1, + 0, 0, -1, 0, -1, -1, -2, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + -1, 0, 0, 0, 0, -1, -2, 0, + -2, 0, 4, -1, 0, -4, 0, 0, + 3, -6, -7, -5, -3, 1, 0, -1, + -8, -2, 0, -2, 0, -3, 2, -2, + -8, 0, -3, 0, 0, 1, 0, 1, + -1, 0, 1, 0, -4, -5, 0, -6, + -3, -3, -3, -4, -2, -3, 0, -2, + -3, 1, 0, 0, 0, -1, 0, 0, + 0, 1, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, -1, 0, 0, -1, 0, -2, -3, + -3, 0, 0, -4, 0, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, 1, + -1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + -2, 0, 0, 0, 0, -6, -4, 0, + 0, 0, -2, -6, 0, 0, -1, 1, + 0, -3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, -2, 0, + 0, 0, 0, 2, 0, 1, -3, -3, + 0, -1, -1, -2, 0, 0, 0, 0, + 0, 0, -4, 0, -1, 0, -2, -1, + 0, -3, -3, -4, -1, 0, -3, 0, + -4, 0, 0, 0, 0, 10, 0, 0, + 1, 0, 0, -2, 0, 1, 0, -6, + 0, 0, 0, 0, 0, -12, -2, 4, + 4, -1, -5, 0, 1, -2, 0, -6, + -1, -2, 1, -9, -1, 2, 0, 2, + -4, -2, -5, -4, -5, 0, 0, -8, + 0, 7, 0, 0, -1, 0, 0, 0, + -1, -1, -1, -3, -4, 0, -12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, -1, -2, 0, 0, + -3, 0, -1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, 3, + 0, 2, 0, -3, 1, -1, 0, -3, + -1, 0, -2, -1, -1, 0, -2, -2, + 0, 0, -1, 0, -1, -2, -2, 0, + 0, -1, 0, 1, -1, 0, -3, 0, + 0, 0, -3, 0, -2, 0, -2, -2, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, -3, 1, 0, -2, 0, -1, -2, + -4, -1, -1, -1, 0, -1, -2, 0, + 0, 0, 0, 0, 0, -1, -1, -1, + 0, 0, 0, 0, 2, -1, 0, -1, + 0, 0, 0, -1, -2, -1, -1, -2, + -1, 0, 1, 5, 0, 0, -3, 0, + -1, 3, 0, -1, -5, -2, 2, 0, + 0, -6, -2, 1, -2, 1, 0, -1, + -1, -4, 0, -2, 1, 0, 0, -2, + 0, 0, 0, 1, 1, -3, -2, 0, + -2, -1, -2, -1, -1, 0, -2, 1, + -2, -2, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + 0, 0, -1, -1, 0, 0, 0, 0, + -1, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, -1, 0, 0, 0, 0, + -2, 0, -3, 0, 0, 0, -4, 0, + 1, -3, 3, 0, -1, -6, 0, 0, + -3, -1, 0, -5, -3, -4, 0, 0, + -6, -1, -5, -5, -6, 0, -3, 0, + 1, 9, -2, 0, -3, -1, 0, -1, + -2, -3, -2, -5, -5, -3, -1, 0, + 0, -1, 0, 0, 0, 0, -9, -1, + 4, 3, -3, -5, 0, 0, -4, 0, + -6, -1, -1, 3, -12, -2, 0, 0, + 0, -8, -2, -7, -1, -9, 0, 0, + -9, 0, 8, 0, 0, -1, 0, 0, + 0, 0, -1, -1, -5, -1, 0, -8, + 0, 0, 0, 0, -4, 0, -1, 0, + 0, -4, -6, 0, 0, -1, -2, -4, + -1, 0, -1, 0, 0, 0, 0, -6, + -1, -4, -4, -1, -2, -3, -1, -2, + 0, -3, -1, -4, -2, 0, -2, -2, + -1, -2, 0, 1, 0, -1, -4, 0, + 3, 0, -2, 0, 0, 0, 0, 2, + 0, 1, -3, 5, 0, -1, -1, -2, + 0, 0, 0, 0, 0, 0, -4, 0, + -1, 0, -2, -1, 0, -3, -3, -4, + -1, 0, -3, 1, 5, 0, 0, 0, + 0, 10, 0, 0, 1, 0, 0, -2, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, -3, 0, 0, 0, 0, 0, -1, + 0, 0, 0, -1, -1, 0, 0, -3, + -1, 0, 0, -3, 0, 2, -1, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 2, 3, 1, -1, 0, -4, + -2, 0, 4, -4, -4, -3, -3, 5, + 2, 1, -11, -1, 3, -1, 0, -1, + 1, -1, -4, 0, -1, 1, -2, -1, + -4, -1, 0, 0, 4, 3, 0, -4, + 0, -7, -2, 4, -2, -5, 0, -2, + -4, -4, -1, 5, 1, 0, -2, 0, + -3, 0, 1, 4, -3, -5, -5, -3, + 4, 0, 0, -9, -1, 1, -2, -1, + -3, 0, -3, -5, -2, -2, -1, 0, + 0, -3, -3, -1, 0, 4, 3, -1, + -7, 0, -7, -2, 0, -4, -7, 0, + -4, -2, -4, -4, 3, 0, 0, -2, + 0, -3, -1, 0, -1, -2, 0, 2, + -4, 1, 0, 0, -7, 0, -1, -3, + -2, -1, -4, -3, -4, -3, 0, -4, + -1, -3, -2, -4, -1, 0, 0, 0, + 6, -2, 0, -4, -1, 0, -1, -3, + -3, -3, -4, -5, -2, -3, 3, 0, + -2, 0, -6, -2, 1, 3, -4, -5, + -3, -4, 4, -1, 1, -12, -2, 3, + -3, -2, -5, 0, -4, -5, -2, -1, + -1, -1, -3, -4, 0, 0, 0, 4, + 4, -1, -8, 0, -8, -3, 3, -5, + -9, -3, -4, -5, -6, -4, 3, 0, + 0, 0, 0, -2, 0, 0, 1, -2, + 3, 1, -2, 3, 0, 0, -4, 0, + 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 1, 4, 0, 0, -2, 0, 0, + 0, 0, -1, -1, -2, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 1, 0, + -1, 0, 5, 0, 2, 0, 0, -2, + 0, 3, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -8, 0, -1, 2, 0, 4, + 0, 0, 13, 2, -3, -3, 1, 1, + -1, 0, -6, 0, 0, 6, -8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -9, 5, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, -3, 0, + 0, 0, 0, 0, 1, 17, -3, -1, + 4, 3, -3, 1, 0, 0, 1, 1, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -17, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -4, + 0, 0, 0, -3, 0, 0, 0, 0, + -3, -1, 0, 0, 0, -3, 0, -2, + 0, -6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, -2, 0, -2, 0, + -3, 0, 0, 0, -2, 1, -2, 0, + 0, -3, -1, -3, 0, 0, -3, 0, + -1, 0, -6, 0, -1, 0, 0, -10, + -2, -5, -1, -5, 0, 0, -9, 0, + -3, -1, 0, 0, 0, 0, 0, 0, + 0, 0, -2, -2, -1, -2, 0, 0, + 0, 0, -3, 0, -3, 2, -1, 3, + 0, -1, -3, -1, -2, -2, 0, -2, + -1, -1, 1, -3, 0, 0, 0, 0, + -11, -1, -2, 0, -3, 0, -1, -6, + -1, 0, 0, -1, -1, 0, 0, 0, + 0, 1, 0, -1, -2, -1, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, + 0, -3, 0, -1, 0, 0, 0, -3, + 1, 0, 0, 0, -3, -1, -3, 0, + 0, -4, 0, -1, 0, -6, 0, 0, + 0, 0, -12, 0, -3, -5, -6, 0, + 0, -9, 0, -1, -2, 0, 0, 0, + 0, 0, 0, 0, 0, -1, -2, -1, + -2, 0, 0, 0, 2, -2, 0, 4, + 6, -1, -1, -4, 2, 6, 2, 3, + -3, 2, 5, 2, 4, 3, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 6, -2, -1, 0, -1, + 10, 6, 10, 0, 0, 0, 1, 0, + 0, 5, 0, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, 0, + 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, -11, -2, -1, -5, + -6, 0, 0, -9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, -11, -2, -1, + -5, -6, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, -3, 1, 0, -1, + 1, 2, 1, -4, 0, 0, -1, 1, + 0, 1, 0, 0, 0, 0, -3, 0, + -1, -1, -3, 0, -1, -5, 0, 8, + -1, 0, -3, -1, 0, -1, -2, 0, + -1, -4, -3, -2, 0, 0, 0, -2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, -11, + -2, -1, -5, -6, 0, 0, -9, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -2, 0, -4, -2, -1, 4, -1, -1, + -5, 0, -1, 0, -1, -3, 0, 3, + 0, 1, 0, 1, -3, -5, -2, 0, + -5, -2, -3, -5, -5, 0, -2, -3, + -2, -2, -1, -1, -2, -1, 0, -1, + 0, 2, 0, 2, -1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, -1, -1, 0, 0, + -3, 0, -1, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, -1, 0, -2, + 0, 0, 0, 0, -1, 0, 0, -2, + -1, 1, 0, -2, -2, -1, 0, -4, + -1, -3, -1, -2, 0, -2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -9, 0, 4, 0, 0, -2, 0, + 0, 0, 0, -2, 0, -1, 0, 0, + -1, 0, 0, -1, 0, -3, 0, 0, + 5, -2, -4, -4, 1, 1, 1, 0, + -4, 1, 2, 1, 4, 1, 4, -1, + -3, 0, 0, -5, 0, 0, -4, -3, + 0, 0, -3, 0, -2, -2, 0, -2, + 0, -2, 0, -1, 2, 0, -1, -4, + -1, 5, 0, 0, -1, 0, -3, 0, + 0, 2, -3, 0, 1, -1, 1, 0, + 0, -4, 0, -1, 0, 0, -1, 1, + -1, 0, 0, 0, -5, -2, -3, 0, + -4, 0, 0, -6, 0, 5, -1, 0, + -2, 0, 1, 0, -1, 0, -1, -4, + 0, -1, 1, 0, 0, 0, 0, -1, + 0, 0, 1, -2, 0, 0, 0, -2, + -1, 0, -2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -8, 0, 3, 0, + 0, -1, 0, 0, 0, 0, 0, 0, + -1, -1, 0, 0, 0, 3, 0, 3, + 0, 0, 0, 0, 0, -8, -7, 0, + 6, 4, 2, -5, 1, 5, 0, 5, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 +}; + +/*Collect the kern class' data in one place*/ +static const lv_font_fmt_txt_kern_classes_t kern_classes = +{ + .class_pair_values = kern_class_values, + .left_class_mapping = kern_left_class_mapping, + .right_class_mapping = kern_right_class_mapping, + .left_class_cnt = 61, + .right_class_cnt = 49, +}; + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_dsc_t font_dsc = { + .glyph_bitmap = gylph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = &kern_classes, + .kern_scale = 16, + .cmap_num = 2, + .bpp = 4, + .kern_classes = 1, + .bitmap_format = 1 +}; + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +lv_font_t font_1 = { + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 10, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + +#endif /*#if FONT_1*/ +#endif diff --git a/lib/lvgl/tests/src/test_fonts/font_1.fnt b/lib/lvgl/tests/src/test_fonts/font_1.fnt new file mode 100644 index 00000000..bc701d5f Binary files /dev/null and b/lib/lvgl/tests/src/test_fonts/font_1.fnt differ diff --git a/lib/lvgl/tests/src/test_fonts/font_2.c b/lib/lvgl/tests/src/test_fonts/font_2.c new file mode 100644 index 00000000..0bb10f2c --- /dev/null +++ b/lib/lvgl/tests/src/test_fonts/font_2.c @@ -0,0 +1,1410 @@ +#if LV_BUILD_TEST +#include "../../lvgl.h" + +/******************************************************************************* + * Size: 8 px + * Bpp: 4 + * Opts: --bpp 4 --size 8 --font ../Montserrat-Medium.ttf -r 0x20-0x7F,0xB0,0x2022 --font ../FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --no-compress --no-prefilter --force-fast-kern-format --format lvgl -o ..\generated_fonts/font_2.c + ******************************************************************************/ + +#ifndef FONT_2 +#define FONT_2 1 +#endif + +#if FONT_2 + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { + /* U+20 " " */ + + /* U+21 "!" */ + 0x58, 0x57, 0x46, 0x23, 0x46, + + /* U+22 "\"" */ + 0x73, 0x97, 0x29, 0x0, 0x0, + + /* U+23 "#" */ + 0x4, 0x52, 0x60, 0x4b, 0x9b, 0xa3, 0x8, 0x7, + 0x20, 0x6c, 0x8c, 0x81, 0x9, 0x9, 0x0, + + /* U+24 "$" */ + 0x0, 0x80, 0x2, 0xbd, 0xa2, 0x76, 0x80, 0x0, + 0x8d, 0x81, 0x0, 0x84, 0x95, 0xad, 0xb3, 0x0, + 0x80, 0x0, + + /* U+25 "%" */ + 0x58, 0x70, 0x63, 0x8, 0x8, 0x36, 0x0, 0x27, + 0x58, 0x67, 0x10, 0x8, 0x27, 0x26, 0x6, 0x20, + 0x88, 0x20, + + /* U+26 "&" */ + 0x9, 0x99, 0x0, 0xb, 0x3a, 0x0, 0x19, 0xc2, + 0x20, 0x83, 0x1a, 0xa0, 0x3a, 0x99, 0x92, 0x0, + 0x0, 0x0, + + /* U+27 "'" */ + 0x72, 0x72, 0x0, + + /* U+28 "(" */ + 0x8, 0x20, 0xb0, 0x1a, 0x3, 0x80, 0x1a, 0x0, + 0xb0, 0x8, 0x20, + + /* U+29 ")" */ + 0x73, 0x19, 0xb, 0xc, 0xb, 0x19, 0x73, + + /* U+2A "*" */ + 0x48, 0x40, 0x6e, 0x80, 0x15, 0x10, + + /* U+2B "+" */ + 0x0, 0x20, 0x0, 0xa, 0x0, 0x49, 0xd9, 0x10, + 0xa, 0x0, + + /* U+2C "," */ + 0x0, 0x75, 0x71, + + /* U+2D "-" */ + 0x5a, 0x60, + + /* U+2E "." */ + 0x0, 0x74, + + /* U+2F "/" */ + 0x0, 0xa, 0x0, 0x2, 0x80, 0x0, 0x82, 0x0, + 0xa, 0x0, 0x4, 0x60, 0x0, 0x91, 0x0, 0x19, + 0x0, 0x0, + + /* U+30 "0" */ + 0xa, 0xbb, 0x26, 0x60, 0x1b, 0x93, 0x0, 0xc6, + 0x60, 0x1b, 0xa, 0xbb, 0x20, + + /* U+31 "1" */ + 0x9e, 0x20, 0xa2, 0xa, 0x20, 0xa2, 0xa, 0x20, + + /* U+32 "2" */ + 0x6a, 0xb9, 0x0, 0x0, 0xc0, 0x0, 0x58, 0x0, + 0x87, 0x0, 0x9e, 0xaa, 0x30, + + /* U+33 "3" */ + 0x7a, 0xbe, 0x0, 0xa, 0x20, 0x4, 0xa9, 0x0, + 0x0, 0xa2, 0x8a, 0xa9, 0x0, + + /* U+34 "4" */ + 0x0, 0x49, 0x0, 0x3, 0xa0, 0x0, 0x1b, 0x8, + 0x20, 0x8b, 0xad, 0xb2, 0x0, 0x9, 0x30, + + /* U+35 "5" */ + 0x3d, 0xaa, 0x5, 0x60, 0x0, 0x5b, 0xa8, 0x0, + 0x0, 0x93, 0x7a, 0xaa, 0x0, + + /* U+36 "6" */ + 0x9, 0xaa, 0x36, 0x70, 0x0, 0x98, 0x9a, 0x26, + 0x80, 0x2a, 0x9, 0x9a, 0x40, + + /* U+37 "7" */ + 0xca, 0xad, 0x67, 0x0, 0xc0, 0x0, 0x67, 0x0, + 0xc, 0x0, 0x6, 0x70, 0x0, + + /* U+38 "8" */ + 0x1a, 0xab, 0x25, 0x60, 0x48, 0x1d, 0xad, 0x38, + 0x40, 0x1b, 0x3a, 0x9a, 0x40, + + /* U+39 "9" */ + 0x4a, 0x99, 0xb, 0x10, 0x95, 0x3a, 0x99, 0x80, + 0x0, 0x95, 0x3a, 0xb8, 0x0, + + /* U+3A ":" */ + 0x74, 0x0, 0x0, 0x74, + + /* U+3B ";" */ + 0x74, 0x0, 0x0, 0x75, 0x62, 0x0, + + /* U+3C "<" */ + 0x0, 0x1, 0x0, 0x49, 0x80, 0x5c, 0x30, 0x0, + 0x16, 0x91, 0x0, 0x0, 0x0, + + /* U+3D "=" */ + 0x49, 0x99, 0x10, 0x0, 0x0, 0x49, 0x99, 0x10, + + /* U+3E ">" */ + 0x10, 0x0, 0x3, 0x98, 0x20, 0x0, 0x6d, 0x14, + 0x94, 0x0, 0x0, 0x0, 0x0, + + /* U+3F "?" */ + 0x6a, 0xb9, 0x0, 0x0, 0xc0, 0x0, 0xa4, 0x0, + 0x3, 0x0, 0x2, 0x80, 0x0, + + /* U+40 "@" */ + 0x3, 0x87, 0x78, 0x50, 0x28, 0x4a, 0x9c, 0x75, + 0x80, 0xb0, 0xa, 0x28, 0x80, 0xb0, 0xa, 0x28, + 0x28, 0x49, 0x99, 0xa6, 0x3, 0x88, 0x75, 0x0, + + /* U+41 "A" */ + 0x0, 0xb, 0x90, 0x0, 0x3, 0x8a, 0x10, 0x0, + 0xb1, 0x39, 0x0, 0x4d, 0x99, 0xd1, 0xb, 0x10, + 0x3, 0x90, + + /* U+42 "B" */ + 0x2d, 0x99, 0xb1, 0x2a, 0x0, 0x84, 0x2d, 0x9a, + 0xd1, 0x2a, 0x0, 0x39, 0x2d, 0x99, 0xb4, + + /* U+43 "C" */ + 0x7, 0xba, 0xa2, 0x59, 0x0, 0x0, 0x93, 0x0, + 0x0, 0x59, 0x0, 0x0, 0x7, 0xba, 0xa2, + + /* U+44 "D" */ + 0x2e, 0xab, 0xb3, 0x2, 0xa0, 0x1, 0xc0, 0x2a, + 0x0, 0x9, 0x22, 0xa0, 0x1, 0xc0, 0x2e, 0xab, + 0xb3, 0x0, + + /* U+45 "E" */ + 0x2e, 0xaa, 0x82, 0xa0, 0x0, 0x2d, 0xaa, 0x42, + 0xa0, 0x0, 0x2e, 0xaa, 0x90, + + /* U+46 "F" */ + 0x2e, 0xaa, 0x82, 0xa0, 0x0, 0x2e, 0xaa, 0x42, + 0xa0, 0x0, 0x2a, 0x0, 0x0, + + /* U+47 "G" */ + 0x7, 0xba, 0xa2, 0x59, 0x0, 0x0, 0x93, 0x0, + 0x23, 0x59, 0x0, 0x47, 0x7, 0xba, 0xa3, + + /* U+48 "H" */ + 0x2a, 0x0, 0x2a, 0x2a, 0x0, 0x2a, 0x2e, 0xaa, + 0xba, 0x2a, 0x0, 0x2a, 0x2a, 0x0, 0x2a, + + /* U+49 "I" */ + 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, + + /* U+4A "J" */ + 0x5, 0xad, 0x50, 0x0, 0x75, 0x0, 0x7, 0x50, + 0x0, 0x84, 0x9, 0xab, 0x0, + + /* U+4B "K" */ + 0x2a, 0x1, 0xa2, 0x2a, 0x1b, 0x20, 0x2c, 0xc7, + 0x0, 0x2d, 0x19, 0x50, 0x2a, 0x0, 0xa4, + + /* U+4C "L" */ + 0x2a, 0x0, 0x2, 0xa0, 0x0, 0x2a, 0x0, 0x2, + 0xa0, 0x0, 0x2e, 0xaa, 0x70, + + /* U+4D "M" */ + 0x2c, 0x0, 0x3, 0xc2, 0xd7, 0x0, 0xbc, 0x29, + 0x92, 0x84, 0xc2, 0x91, 0xb9, 0xc, 0x29, 0x3, + 0x0, 0xc0, + + /* U+4E "N" */ + 0x2d, 0x10, 0x2a, 0x2c, 0xb0, 0x2a, 0x2a, 0x4b, + 0x2a, 0x2a, 0x5, 0xca, 0x2a, 0x0, 0x7a, + + /* U+4F "O" */ + 0x7, 0xbb, 0xb3, 0x5, 0x90, 0x1, 0xc1, 0x93, + 0x0, 0x8, 0x45, 0x90, 0x1, 0xc1, 0x7, 0xbb, + 0xb3, 0x0, + + /* U+50 "P" */ + 0x2e, 0xaa, 0x90, 0x2a, 0x0, 0x84, 0x2a, 0x0, + 0xa3, 0x2e, 0xaa, 0x60, 0x2a, 0x0, 0x0, + + /* U+51 "Q" */ + 0x7, 0xbb, 0xb3, 0x5, 0x90, 0x1, 0xc1, 0x93, + 0x0, 0x8, 0x45, 0x90, 0x0, 0xc1, 0x7, 0xbb, + 0xb3, 0x0, 0x0, 0x39, 0x93, + + /* U+52 "R" */ + 0x2e, 0xaa, 0x90, 0x2a, 0x0, 0x84, 0x2a, 0x0, + 0xa3, 0x2d, 0xac, 0x80, 0x2a, 0x1, 0xa1, + + /* U+53 "S" */ + 0x2a, 0xaa, 0x27, 0x60, 0x0, 0x8, 0x98, 0x10, + 0x0, 0x49, 0x5a, 0xaa, 0x30, + + /* U+54 "T" */ + 0xaa, 0xea, 0x60, 0xc, 0x0, 0x0, 0xc0, 0x0, + 0xc, 0x0, 0x0, 0xc0, 0x0, + + /* U+55 "U" */ + 0x39, 0x0, 0x48, 0x39, 0x0, 0x48, 0x39, 0x0, + 0x48, 0x1c, 0x0, 0x66, 0x6, 0xba, 0xa0, + + /* U+56 "V" */ + 0xb, 0x10, 0x5, 0x70, 0x49, 0x0, 0xb0, 0x0, + 0xc1, 0x57, 0x0, 0x4, 0x9c, 0x0, 0x0, 0xc, + 0x70, 0x0, + + /* U+57 "W" */ + 0x94, 0x0, 0xf1, 0x3, 0x93, 0xa0, 0x69, 0x70, + 0x93, 0xc, 0xb, 0xb, 0xb, 0x0, 0x79, 0x80, + 0x89, 0x70, 0x1, 0xf2, 0x2, 0xf1, 0x0, + + /* U+58 "X" */ + 0x58, 0x2, 0xa0, 0x8, 0x7b, 0x10, 0x0, 0xf5, + 0x0, 0xa, 0x4b, 0x10, 0x76, 0x2, 0xb0, + + /* U+59 "Y" */ + 0xa, 0x20, 0xb, 0x0, 0x1b, 0x9, 0x30, 0x0, + 0x5b, 0x80, 0x0, 0x0, 0xd0, 0x0, 0x0, 0xc, + 0x0, 0x0, + + /* U+5A "Z" */ + 0x6a, 0xac, 0xd0, 0x0, 0x1b, 0x10, 0x0, 0xb2, + 0x0, 0xb, 0x30, 0x0, 0x8d, 0xaa, 0xa0, + + /* U+5B "[" */ + 0x2d, 0x42, 0x90, 0x29, 0x2, 0x90, 0x29, 0x2, + 0x90, 0x2d, 0x40, + + /* U+5C "\\" */ + 0x19, 0x0, 0x0, 0xa0, 0x0, 0x5, 0x50, 0x0, + 0xa, 0x0, 0x0, 0x91, 0x0, 0x3, 0x70, 0x0, + 0xa, 0x0, + + /* U+5D "]" */ + 0x8c, 0xc, 0xc, 0xc, 0xc, 0xc, 0x8c, + + /* U+5E "^" */ + 0x3, 0xc0, 0x0, 0x94, 0x50, 0x27, 0x9, 0x0, + + /* U+5F "_" */ + 0x77, 0x77, + + /* U+60 "`" */ + 0x6, 0x60, + + /* U+61 "a" */ + 0x29, 0x98, 0x2, 0x98, 0xd0, 0x84, 0xc, 0x13, + 0xb9, 0xd1, + + /* U+62 "b" */ + 0x48, 0x0, 0x0, 0x48, 0x0, 0x0, 0x4c, 0xab, + 0x50, 0x4a, 0x0, 0xc0, 0x4a, 0x0, 0xc0, 0x4c, + 0xaa, 0x50, + + /* U+63 "c" */ + 0x1a, 0xaa, 0x18, 0x40, 0x0, 0x84, 0x0, 0x1, + 0xaa, 0xa1, + + /* U+64 "d" */ + 0x0, 0x0, 0xb0, 0x0, 0xb, 0x1a, 0xaa, 0xb9, + 0x40, 0x3b, 0x94, 0x2, 0xb1, 0xa9, 0x9b, + + /* U+65 "e" */ + 0x19, 0x99, 0x19, 0x98, 0x86, 0x85, 0x1, 0x1, + 0xaa, 0xb1, + + /* U+66 "f" */ + 0xa, 0xa0, 0x2a, 0x0, 0x9d, 0x70, 0x29, 0x0, + 0x29, 0x0, 0x29, 0x0, + + /* U+67 "g" */ + 0x1a, 0x99, 0xb9, 0x40, 0x1c, 0x94, 0x2, 0xc1, + 0xaa, 0xab, 0x18, 0x9a, 0x30, + + /* U+68 "h" */ + 0x48, 0x0, 0x4, 0x80, 0x0, 0x4c, 0x9b, 0x44, + 0x90, 0x1b, 0x48, 0x0, 0xc4, 0x80, 0xc, + + /* U+69 "i" */ + 0x37, 0x0, 0x48, 0x48, 0x48, 0x48, + + /* U+6A "j" */ + 0x3, 0x70, 0x0, 0x3, 0x80, 0x38, 0x3, 0x80, + 0x38, 0x6b, 0x40, + + /* U+6B "k" */ + 0x48, 0x0, 0x4, 0x80, 0x0, 0x48, 0xa, 0x44, + 0x9c, 0x30, 0x4d, 0x6a, 0x4, 0x80, 0x77, + + /* U+6C "l" */ + 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, + + /* U+6D "m" */ + 0x4c, 0x9b, 0x89, 0xb4, 0x49, 0x3, 0xb0, 0xb, + 0x48, 0x2, 0xa0, 0xc, 0x48, 0x2, 0xa0, 0xc, + + /* U+6E "n" */ + 0x4c, 0x9b, 0x44, 0x90, 0x1b, 0x48, 0x0, 0xc4, + 0x80, 0xc, + + /* U+6F "o" */ + 0x1a, 0xaa, 0x18, 0x40, 0x3a, 0x84, 0x3, 0xa1, + 0xaa, 0xa1, + + /* U+70 "p" */ + 0x4c, 0xab, 0x50, 0x4a, 0x0, 0xc0, 0x4a, 0x0, + 0xc0, 0x4c, 0xaa, 0x50, 0x48, 0x0, 0x0, + + /* U+71 "q" */ + 0x1a, 0xa9, 0xb9, 0x40, 0x3b, 0x94, 0x3, 0xb1, + 0xaa, 0x9b, 0x0, 0x0, 0xb0, + + /* U+72 "r" */ + 0x4b, 0xa0, 0x4a, 0x0, 0x48, 0x0, 0x48, 0x0, + + /* U+73 "s" */ + 0x5b, 0x95, 0x87, 0x30, 0x3, 0x79, 0x7a, 0xa6, + + /* U+74 "t" */ + 0x29, 0x0, 0x9d, 0x70, 0x29, 0x0, 0x29, 0x0, + 0xb, 0x90, + + /* U+75 "u" */ + 0x57, 0x1, 0xb5, 0x70, 0x1b, 0x48, 0x3, 0xb0, + 0xa9, 0x9b, + + /* U+76 "v" */ + 0xb, 0x0, 0x84, 0x5, 0x70, 0xb0, 0x0, 0xb7, + 0x50, 0x0, 0x6d, 0x0, + + /* U+77 "w" */ + 0xb0, 0xe, 0x20, 0xa0, 0x55, 0x59, 0x82, 0x80, + 0xa, 0xa0, 0xa8, 0x20, 0x9, 0x80, 0x6b, 0x0, + + /* U+78 "x" */ + 0x67, 0x1b, 0x0, 0x9b, 0x10, 0xa, 0xb2, 0x7, + 0x51, 0xb0, + + /* U+79 "y" */ + 0xb, 0x10, 0x83, 0x3, 0x81, 0xa0, 0x0, 0xaa, + 0x30, 0x0, 0x4a, 0x0, 0xa, 0xb2, 0x0, + + /* U+7A "z" */ + 0x59, 0xbb, 0x1, 0xb1, 0xb, 0x20, 0x9c, 0x98, + + /* U+7B "{" */ + 0xa, 0x60, 0xc0, 0xc, 0x5, 0xb0, 0xc, 0x0, + 0xc0, 0xa, 0x60, + + /* U+7C "|" */ + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, + + /* U+7D "}" */ + 0x97, 0x0, 0xb0, 0xb, 0x0, 0xd3, 0xb, 0x0, + 0xb0, 0x97, 0x0, + + /* U+7E "~" */ + 0x29, 0x35, 0x15, 0x6, 0x80, + + /* U+B0 "°" */ + 0x26, 0x47, 0x7, 0x27, 0x50, + + /* U+2022 "•" */ + 0x0, 0x5d, 0x2, + + /* U+F001 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, 0xbe, + 0x0, 0x8d, 0xff, 0xff, 0x0, 0xff, 0xe9, 0x5f, + 0x0, 0xf3, 0x0, 0xf, 0x0, 0xf0, 0x0, 0xf, + 0x0, 0xf0, 0xa, 0xff, 0xaf, 0xf0, 0xa, 0xfa, + 0xaf, 0xa0, 0x0, 0x0, + + /* U+F008 "" */ + 0xbd, 0xcc, 0xce, 0xab, 0x8b, 0x0, 0x7, 0x58, + 0xcd, 0x66, 0x6a, 0xac, 0xcd, 0x66, 0x6a, 0xac, + 0x8b, 0x0, 0x7, 0x58, 0xbd, 0xcc, 0xce, 0xab, + + /* U+F00B "" */ + 0x34, 0x14, 0x44, 0x43, 0xff, 0x7f, 0xff, 0xff, + 0xab, 0x4b, 0xbb, 0xba, 0xbc, 0x5c, 0xcc, 0xcb, + 0xff, 0x7f, 0xff, 0xff, 0x67, 0x17, 0x88, 0x86, + 0xff, 0x7f, 0xff, 0xff, 0xab, 0x4b, 0xbb, 0xba, + + /* U+F00C "" */ + 0x0, 0x0, 0x0, 0x9a, 0x0, 0x0, 0x9, 0xfa, + 0xa9, 0x0, 0x9f, 0xa0, 0xaf, 0x99, 0xfa, 0x0, + 0xa, 0xff, 0xa0, 0x0, 0x0, 0x99, 0x0, 0x0, + + /* U+F00D "" */ + 0x63, 0x0, 0x82, 0xcf, 0x4a, 0xf4, 0x1d, 0xff, + 0x60, 0xa, 0xff, 0x30, 0xaf, 0x7d, 0xf3, 0xa6, + 0x1, 0xb3, + + /* U+F011 "" */ + 0x0, 0xc, 0x51, 0x0, 0x1d, 0x7d, 0x6e, 0x70, + 0x8d, 0xd, 0x65, 0xf1, 0xc7, 0xd, 0x60, 0xe6, + 0xd7, 0x6, 0x20, 0xe6, 0x9d, 0x0, 0x4, 0xf2, + 0x1e, 0xc7, 0x8f, 0x80, 0x1, 0x9d, 0xc6, 0x0, + + /* U+F013 "" */ + 0x0, 0xc, 0xc0, 0x0, 0x18, 0x8f, 0xf8, 0x81, + 0x8f, 0xfe, 0xef, 0xf8, 0x2f, 0xe0, 0xe, 0xf2, + 0x2f, 0xe0, 0xe, 0xf2, 0x8f, 0xfe, 0xef, 0xf8, + 0x18, 0x8f, 0xf8, 0x81, 0x0, 0xc, 0xc0, 0x0, + + /* U+F015 "" */ + 0x0, 0x0, 0x30, 0x22, 0x0, 0x0, 0xaf, 0xaa, + 0xa0, 0x1, 0xda, 0x6a, 0xfa, 0x3, 0xe8, 0xbf, + 0xb8, 0xe3, 0xb6, 0xdf, 0xff, 0xd6, 0xb0, 0x8f, + 0xfb, 0xff, 0x80, 0x8, 0xfc, 0xc, 0xf8, 0x0, + 0x5b, 0x80, 0x8b, 0x50, + + /* U+F019 "" */ + 0x0, 0xf, 0xf0, 0x0, 0x0, 0xf, 0xf0, 0x0, + 0x0, 0xf, 0xf0, 0x0, 0x7, 0xff, 0xff, 0x70, + 0x0, 0x9f, 0xf9, 0x0, 0x78, 0x7a, 0xa7, 0x87, + 0xff, 0xfb, 0xbf, 0xff, 0xff, 0xff, 0xfb, 0xbf, + + /* U+F01C "" */ + 0x5, 0xff, 0xff, 0xf5, 0x1, 0xe3, 0x0, 0x3, + 0xe1, 0xa8, 0x0, 0x0, 0x8, 0xaf, 0xff, 0x60, + 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, + 0xff, 0xff, 0xfd, + + /* U+F021 "" */ + 0x0, 0x0, 0x0, 0x3, 0x2, 0xbf, 0xfb, 0x3f, + 0x2e, 0x91, 0x18, 0xff, 0x9a, 0x0, 0x6c, 0xff, + 0x31, 0x0, 0x24, 0x44, 0x44, 0x42, 0x0, 0x13, + 0xff, 0xc6, 0x0, 0xb9, 0xfe, 0xa5, 0x5b, 0xd1, + 0xf2, 0x8c, 0xc8, 0x10, 0x30, 0x0, 0x0, 0x0, + + /* U+F026 "" */ + 0x0, 0x9, 0x34, 0xcf, 0xff, 0xff, 0xff, 0xff, + 0xab, 0xff, 0x0, 0x4f, 0x0, 0x1, + + /* U+F027 "" */ + 0x0, 0x9, 0x0, 0x34, 0xcf, 0x1, 0xff, 0xff, + 0x1b, 0xff, 0xff, 0x1b, 0xbb, 0xff, 0x1, 0x0, + 0x4f, 0x0, 0x0, 0x1, 0x0, + + /* U+F028 "" */ + 0x0, 0x0, 0x0, 0x54, 0x0, 0x0, 0x90, 0x23, + 0xb3, 0x34, 0xcf, 0x2, 0xc3, 0xbf, 0xff, 0xf1, + 0xb5, 0x6c, 0xff, 0xff, 0x1b, 0x56, 0xca, 0xbf, + 0xf0, 0x2c, 0x3a, 0x0, 0x4f, 0x2, 0x3b, 0x30, + 0x0, 0x10, 0x5, 0x40, + + /* U+F03E "" */ + 0xdf, 0xff, 0xff, 0xfd, 0xf0, 0x7f, 0xff, 0xff, + 0xf8, 0xcf, 0xb1, 0xbf, 0xfb, 0x5b, 0x0, 0xf, + 0xf0, 0x0, 0x0, 0xf, 0xdf, 0xff, 0xff, 0xfd, + + /* U+F048 "" */ + 0x40, 0x0, 0x2f, 0x20, 0x8f, 0xf2, 0x9f, 0xff, + 0xcf, 0xff, 0xff, 0xff, 0xff, 0x5e, 0xff, 0xf2, + 0x2e, 0xfb, 0x10, 0x19, + + /* U+F04B "" */ + 0x0, 0x0, 0x0, 0xd, 0xa1, 0x0, 0x0, 0xff, + 0xf7, 0x0, 0xf, 0xff, 0xfd, 0x40, 0xff, 0xff, + 0xff, 0xaf, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xd4, + 0xf, 0xff, 0x70, 0x0, 0xda, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, + + /* U+F04C "" */ + 0x9b, 0x90, 0x9b, 0x9f, 0xff, 0xf, 0xff, 0xff, + 0xf0, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, 0xf0, + 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, 0xf0, 0xff, + 0xf2, 0x42, 0x2, 0x42, + + /* U+F04D "" */ + 0x24, 0x44, 0x44, 0x2f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0xbb, 0xbb, 0xb8, + + /* U+F051 "" */ + 0x20, 0x0, 0x4f, 0x80, 0x2f, 0xff, 0x92, 0xff, + 0xff, 0xcf, 0xff, 0xff, 0xff, 0xfe, 0x5f, 0xfd, + 0x22, 0xf9, 0x10, 0x1b, + + /* U+F052 "" */ + 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x8f, 0x80, + 0x0, 0x0, 0x7f, 0xff, 0x70, 0x0, 0x5f, 0xff, + 0xff, 0x50, 0xe, 0xff, 0xff, 0xfe, 0x0, 0x58, + 0x88, 0x88, 0x50, 0xf, 0xff, 0xff, 0xff, 0x0, + 0xab, 0xbb, 0xbb, 0xa0, + + /* U+F053 "" */ + 0x0, 0x6, 0x20, 0x7, 0xf4, 0x7, 0xf5, 0x5, + 0xf6, 0x0, 0x1e, 0xb0, 0x0, 0x2e, 0xb0, 0x0, + 0x2e, 0x60, 0x0, 0x10, + + /* U+F054 "" */ + 0x26, 0x0, 0x4, 0xf7, 0x0, 0x5, 0xf7, 0x0, + 0x6, 0xf5, 0x0, 0xbe, 0x10, 0xbe, 0x20, 0x6e, + 0x20, 0x0, 0x10, 0x0, + + /* U+F067 "" */ + 0x0, 0x4, 0x0, 0x0, 0x3, 0xf3, 0x0, 0x0, + 0x4f, 0x40, 0x7, 0x8a, 0xfa, 0x87, 0xef, 0xff, + 0xff, 0xe0, 0x4, 0xf4, 0x0, 0x0, 0x4f, 0x40, + 0x0, 0x1, 0xb1, 0x0, + + /* U+F068 "" */ + 0x78, 0x88, 0x88, 0x7e, 0xff, 0xff, 0xfe, + + /* U+F06E "" */ + 0x0, 0x8c, 0xcc, 0x80, 0x1, 0xdd, 0x16, 0x3d, + 0xd1, 0xcf, 0x55, 0xed, 0x5f, 0xcb, 0xf5, 0xdf, + 0xd5, 0xfc, 0x1d, 0xd3, 0x73, 0xdd, 0x10, 0x8, + 0xdc, 0xc8, 0x10, + + /* U+F070 "" */ + 0x1d, 0x30, 0x0, 0x0, 0x0, 0x0, 0x5e, 0x8c, + 0xcc, 0xa2, 0x0, 0x0, 0x2d, 0xb4, 0x49, 0xf4, + 0x0, 0x7a, 0x1a, 0xff, 0x3f, 0xe1, 0x7, 0xfa, + 0x6, 0xf7, 0xff, 0x10, 0xa, 0xf3, 0x3, 0xef, + 0x40, 0x0, 0x6, 0xcc, 0x71, 0xbb, 0x10, 0x0, + 0x0, 0x0, 0x0, 0x89, + + /* U+F071 "" */ + 0x0, 0x0, 0x3e, 0x30, 0x0, 0x0, 0x0, 0xc, + 0xfc, 0x0, 0x0, 0x0, 0x6, 0xfc, 0xf6, 0x0, + 0x0, 0x0, 0xed, 0xd, 0xe0, 0x0, 0x0, 0x8f, + 0xe0, 0xef, 0x80, 0x0, 0x2f, 0xff, 0x6f, 0xff, + 0x20, 0xb, 0xff, 0xe2, 0xef, 0xfa, 0x0, 0xdf, + 0xff, 0xff, 0xff, 0xd0, + + /* U+F074 "" */ + 0x0, 0x0, 0x0, 0x20, 0x44, 0x0, 0x4, 0xf5, + 0xef, 0xb1, 0xcf, 0xfd, 0x1, 0x8c, 0xd1, 0xc1, + 0x1, 0xdc, 0x81, 0xc1, 0xef, 0xc1, 0xbf, 0xfd, + 0x44, 0x0, 0x4, 0xf5, 0x0, 0x0, 0x0, 0x20, + + /* U+F077 "" */ + 0x0, 0x0, 0x0, 0x0, 0x4, 0xe4, 0x0, 0x4, + 0xfc, 0xf4, 0x4, 0xf8, 0x8, 0xf4, 0xb8, 0x0, + 0x8, 0xb0, 0x0, 0x0, 0x0, + + /* U+F078 "" */ + 0x0, 0x0, 0x0, 0xb, 0x80, 0x0, 0x8b, 0x4f, + 0x80, 0x8f, 0x40, 0x4f, 0xcf, 0x40, 0x0, 0x4e, + 0x40, 0x0, 0x0, 0x0, 0x0, + + /* U+F079 "" */ + 0x0, 0x94, 0x14, 0x44, 0x40, 0x0, 0xbf, 0xf8, + 0xbb, 0xbf, 0x10, 0x8, 0xb7, 0x60, 0x0, 0xe1, + 0x0, 0xb, 0x40, 0x0, 0x1e, 0x20, 0x0, 0xb7, + 0x44, 0x5e, 0xfd, 0x50, 0x7, 0xbb, 0xb8, 0x5f, + 0x80, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, + + /* U+F07B "" */ + 0xdf, 0xfb, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfd, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xfd, + + /* U+F093 "" */ + 0x0, 0x9, 0x90, 0x0, 0x0, 0x9f, 0xf9, 0x0, + 0x7, 0xff, 0xff, 0x70, 0x0, 0xf, 0xf0, 0x0, + 0x0, 0xf, 0xf0, 0x0, 0x78, 0x4f, 0xf4, 0x87, + 0xff, 0xe8, 0x8e, 0xff, 0xff, 0xff, 0xfb, 0xbf, + + /* U+F095 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, + 0xea, 0x0, 0x0, 0x0, 0xef, 0xe0, 0x0, 0x0, + 0xc, 0xfc, 0x0, 0x0, 0x0, 0x4f, 0x70, 0x0, + 0x0, 0x1d, 0xe0, 0x7, 0xdc, 0x4d, 0xf3, 0x0, + 0xef, 0xff, 0xe3, 0x0, 0xa, 0xec, 0x70, 0x0, + 0x0, + + /* U+F0C4 "" */ + 0x3, 0x0, 0x0, 0x0, 0xcd, 0xc0, 0x2d, 0xc0, + 0xe7, 0xf2, 0xee, 0x20, 0x4b, 0xff, 0xe2, 0x0, + 0x4, 0xff, 0xa0, 0x0, 0xcd, 0xf9, 0xf9, 0x0, + 0xe7, 0xe0, 0x7f, 0x90, 0x4a, 0x40, 0x4, 0x50, + + /* U+F0C5 "" */ + 0x0, 0xff, 0xf7, 0x47, 0x4f, 0xff, 0x47, 0xf8, + 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xf8, 0xff, + 0xff, 0xff, 0x8f, 0xff, 0xff, 0xfb, 0x78, 0x88, + 0x7f, 0xff, 0xff, 0x0, + + /* U+F0C7 "" */ + 0x24, 0x44, 0x41, 0xf, 0xbb, 0xbb, 0xe2, 0xf0, + 0x0, 0xf, 0xdf, 0x44, 0x44, 0xff, 0xff, 0xfc, + 0xff, 0xff, 0xf9, 0x9, 0xff, 0xff, 0xd5, 0xdf, + 0xf8, 0xbb, 0xbb, 0xb8, + + /* U+F0E7 "" */ + 0x7, 0xff, 0x60, 0x0, 0xaf, 0xf2, 0x0, 0xc, + 0xff, 0x87, 0x0, 0xef, 0xff, 0xb0, 0x7, 0x8e, + 0xf2, 0x0, 0x0, 0xf8, 0x0, 0x0, 0x3e, 0x0, + 0x0, 0x6, 0x50, 0x0, + + /* U+F0EA "" */ + 0x79, 0xb9, 0x70, 0xf, 0xfc, 0xff, 0x0, 0xff, + 0x68, 0x83, 0xf, 0xf8, 0xff, 0x8b, 0xff, 0x8f, + 0xf8, 0x8f, 0xf8, 0xff, 0xff, 0x78, 0x8f, 0xff, + 0xf0, 0x7, 0xff, 0xff, + + /* U+F0F3 "" */ + 0x0, 0xd, 0x0, 0x0, 0x4e, 0xfe, 0x30, 0xd, + 0xff, 0xfd, 0x0, 0xff, 0xff, 0xf0, 0x3f, 0xff, + 0xff, 0x3b, 0xff, 0xff, 0xfb, 0x78, 0x88, 0x88, + 0x60, 0x4, 0xf4, 0x0, + + /* U+F11C "" */ + 0xdf, 0xff, 0xff, 0xff, 0xdf, 0x18, 0x81, 0x88, + 0x1f, 0xfe, 0xaa, 0xca, 0xae, 0xff, 0xea, 0xac, + 0xaa, 0xef, 0xf1, 0x80, 0x0, 0x81, 0xfd, 0xff, + 0xff, 0xff, 0xfd, + + /* U+F124 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x4b, 0xc0, 0x0, 0x0, 0x5c, 0xff, 0xb0, 0x0, + 0x6e, 0xff, 0xff, 0x40, 0xd, 0xff, 0xff, 0xfc, + 0x0, 0x6, 0x88, 0xcf, 0xf5, 0x0, 0x0, 0x0, + 0x8f, 0xe0, 0x0, 0x0, 0x0, 0x8f, 0x60, 0x0, + 0x0, 0x0, 0x5d, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F15B "" */ + 0xff, 0xf8, 0xb0, 0xff, 0xf8, 0xfb, 0xff, 0xfc, + 0x88, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + + /* U+F1EB "" */ + 0x0, 0x4, 0x77, 0x40, 0x0, 0x9, 0xff, 0xcc, + 0xff, 0x90, 0xcd, 0x40, 0x0, 0x4, 0xdc, 0x20, + 0x4b, 0xff, 0xb4, 0x2, 0x1, 0xfa, 0x55, 0xaf, + 0x10, 0x0, 0x0, 0x21, 0x0, 0x0, 0x0, 0x0, + 0xee, 0x0, 0x0, 0x0, 0x0, 0x87, 0x0, 0x0, + + /* U+F240 "" */ + 0x24, 0x44, 0x44, 0x44, 0x40, 0xfb, 0xbb, 0xbb, + 0xbb, 0xda, 0xf7, 0xee, 0xee, 0xee, 0x5f, 0xf8, + 0xff, 0xff, 0xff, 0x2f, 0xf5, 0x66, 0x66, 0x66, + 0xab, 0x8b, 0xbb, 0xbb, 0xbb, 0xb3, + + /* U+F241 "" */ + 0x24, 0x44, 0x44, 0x44, 0x40, 0xfb, 0xbb, 0xbb, + 0xbb, 0xda, 0xf7, 0xee, 0xee, 0x70, 0x5f, 0xf8, + 0xff, 0xff, 0x80, 0x2f, 0xf5, 0x66, 0x66, 0x54, + 0xab, 0x8b, 0xbb, 0xbb, 0xbb, 0xb3, + + /* U+F242 "" */ + 0x24, 0x44, 0x44, 0x44, 0x40, 0xfb, 0xbb, 0xbb, + 0xbb, 0xda, 0xf7, 0xee, 0xe0, 0x0, 0x5f, 0xf8, + 0xff, 0xf0, 0x0, 0x2f, 0xf5, 0x66, 0x64, 0x44, + 0xab, 0x8b, 0xbb, 0xbb, 0xbb, 0xb3, + + /* U+F243 "" */ + 0x24, 0x44, 0x44, 0x44, 0x40, 0xfb, 0xbb, 0xbb, + 0xbb, 0xda, 0xf7, 0xe7, 0x0, 0x0, 0x5f, 0xf8, + 0xf8, 0x0, 0x0, 0x2f, 0xf5, 0x65, 0x44, 0x44, + 0xab, 0x8b, 0xbb, 0xbb, 0xbb, 0xb3, + + /* U+F244 "" */ + 0x24, 0x44, 0x44, 0x44, 0x40, 0xfb, 0xbb, 0xbb, + 0xbb, 0xd8, 0xf0, 0x0, 0x0, 0x0, 0x5f, 0xf0, + 0x0, 0x0, 0x0, 0x2f, 0xf4, 0x44, 0x44, 0x44, + 0xad, 0x8b, 0xbb, 0xbb, 0xbb, 0xb3, + + /* U+F287 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, + 0xd8, 0x0, 0x0, 0x0, 0x7, 0x36, 0x40, 0x0, + 0x9, 0xb1, 0x91, 0x11, 0x17, 0x20, 0xef, 0x88, + 0xd8, 0x88, 0xd9, 0x2, 0x20, 0x6, 0x48, 0x70, + 0x0, 0x0, 0x0, 0x6, 0xec, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, + + /* U+F293 "" */ + 0x6, 0xdd, 0xc3, 0x4, 0xff, 0x3e, 0xd0, 0x9c, + 0xb5, 0x5f, 0x2b, 0xf7, 0x1a, 0xf4, 0xbf, 0x81, + 0xbf, 0x39, 0xc9, 0x64, 0xf2, 0x4f, 0xf3, 0xde, + 0x0, 0x6d, 0xed, 0x30, + + /* U+F2ED "" */ + 0x78, 0xdf, 0xd8, 0x77, 0x88, 0x88, 0x87, 0x8f, + 0xff, 0xff, 0x88, 0xcc, 0x8c, 0xc8, 0x8c, 0xc8, + 0xcc, 0x88, 0xcc, 0x8c, 0xc8, 0x8c, 0xc8, 0xcc, + 0x85, 0xff, 0xff, 0xf5, + + /* U+F304 "" */ + 0x0, 0x0, 0x0, 0x7e, 0x30, 0x0, 0x0, 0x4b, + 0xfe, 0x0, 0x0, 0x8f, 0x9b, 0x70, 0x0, 0x8f, + 0xff, 0x40, 0x0, 0x8f, 0xff, 0x80, 0x0, 0x7f, + 0xff, 0x80, 0x0, 0xe, 0xff, 0x80, 0x0, 0x0, + 0xee, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F55A "" */ + 0x0, 0xaf, 0xff, 0xff, 0xfc, 0xb, 0xff, 0x9c, + 0xc9, 0xff, 0xaf, 0xff, 0xc1, 0x1c, 0xff, 0xaf, + 0xff, 0xc1, 0x1c, 0xff, 0xb, 0xff, 0x9c, 0xc9, + 0xff, 0x0, 0xaf, 0xff, 0xff, 0xfc, + + /* U+F7C2 "" */ + 0x7, 0xff, 0xfe, 0x17, 0xb6, 0x27, 0xc3, 0xfe, + 0xb9, 0xbe, 0x3f, 0xff, 0xff, 0xf3, 0xff, 0xff, + 0xff, 0x3f, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, + 0x3c, 0xff, 0xff, 0xe1, + + /* U+F8A2 "" */ + 0x0, 0x0, 0x0, 0x3, 0x0, 0x23, 0x0, 0x2, + 0xf0, 0x2e, 0x92, 0x22, 0x5f, 0xd, 0xff, 0xff, + 0xff, 0xf0, 0x2e, 0x92, 0x22, 0x21, 0x0, 0x23, + 0x0, 0x0, 0x0 +}; + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 34, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 0, .adv_w = 34, .box_w = 2, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5, .adv_w = 50, .box_w = 3, .box_h = 3, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 10, .adv_w = 90, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 25, .adv_w = 79, .box_w = 5, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 43, .adv_w = 108, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 61, .adv_w = 88, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 79, .adv_w = 27, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 82, .adv_w = 43, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 93, .adv_w = 43, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 100, .adv_w = 51, .box_w = 4, .box_h = 3, .ofs_x = 0, .ofs_y = 3}, + {.bitmap_index = 106, .adv_w = 74, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 116, .adv_w = 29, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 119, .adv_w = 49, .box_w = 3, .box_h = 1, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 121, .adv_w = 29, .box_w = 2, .box_h = 2, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 123, .adv_w = 45, .box_w = 5, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 141, .adv_w = 85, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 154, .adv_w = 47, .box_w = 3, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 162, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 175, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 188, .adv_w = 86, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 203, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 216, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 229, .adv_w = 77, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 242, .adv_w = 82, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 255, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 268, .adv_w = 29, .box_w = 2, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 272, .adv_w = 29, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 278, .adv_w = 74, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 291, .adv_w = 74, .box_w = 5, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 299, .adv_w = 74, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 312, .adv_w = 73, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 325, .adv_w = 132, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 349, .adv_w = 94, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 367, .adv_w = 97, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 382, .adv_w = 93, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 397, .adv_w = 106, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 415, .adv_w = 86, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 428, .adv_w = 81, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 441, .adv_w = 99, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 456, .adv_w = 104, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 471, .adv_w = 40, .box_w = 2, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 476, .adv_w = 66, .box_w = 5, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 489, .adv_w = 92, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 504, .adv_w = 76, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 517, .adv_w = 122, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 535, .adv_w = 104, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 550, .adv_w = 108, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 568, .adv_w = 92, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 583, .adv_w = 108, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 604, .adv_w = 93, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 619, .adv_w = 79, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 632, .adv_w = 75, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 645, .adv_w = 101, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 660, .adv_w = 91, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 678, .adv_w = 144, .box_w = 9, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 701, .adv_w = 86, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 716, .adv_w = 83, .box_w = 7, .box_h = 5, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 734, .adv_w = 84, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 749, .adv_w = 43, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 760, .adv_w = 45, .box_w = 5, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 778, .adv_w = 43, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 785, .adv_w = 75, .box_w = 5, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 793, .adv_w = 64, .box_w = 4, .box_h = 1, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 795, .adv_w = 77, .box_w = 3, .box_h = 1, .ofs_x = 0, .ofs_y = 5}, + {.bitmap_index = 797, .adv_w = 77, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 807, .adv_w = 87, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 825, .adv_w = 73, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 835, .adv_w = 87, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 850, .adv_w = 78, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 860, .adv_w = 45, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 872, .adv_w = 88, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 885, .adv_w = 87, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 900, .adv_w = 36, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 906, .adv_w = 36, .box_w = 3, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 917, .adv_w = 79, .box_w = 5, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 932, .adv_w = 36, .box_w = 2, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 938, .adv_w = 135, .box_w = 8, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 954, .adv_w = 87, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 964, .adv_w = 81, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 974, .adv_w = 87, .box_w = 6, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 989, .adv_w = 87, .box_w = 5, .box_h = 5, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1002, .adv_w = 52, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1010, .adv_w = 64, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1018, .adv_w = 53, .box_w = 4, .box_h = 5, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1028, .adv_w = 87, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1038, .adv_w = 72, .box_w = 6, .box_h = 4, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 1050, .adv_w = 115, .box_w = 8, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1066, .adv_w = 71, .box_w = 5, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1076, .adv_w = 72, .box_w = 6, .box_h = 5, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1091, .adv_w = 67, .box_w = 4, .box_h = 4, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1099, .adv_w = 45, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1110, .adv_w = 38, .box_w = 2, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1117, .adv_w = 45, .box_w = 3, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1128, .adv_w = 74, .box_w = 5, .box_h = 2, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 1133, .adv_w = 54, .box_w = 3, .box_h = 3, .ofs_x = 0, .ofs_y = 3}, + {.bitmap_index = 1138, .adv_w = 40, .box_w = 2, .box_h = 3, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1141, .adv_w = 128, .box_w = 8, .box_h = 9, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1177, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1201, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1233, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1257, .adv_w = 88, .box_w = 6, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1275, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1307, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1339, .adv_w = 144, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1375, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1407, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1434, .adv_w = 128, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1474, .adv_w = 64, .box_w = 4, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1488, .adv_w = 96, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1509, .adv_w = 144, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1545, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1569, .adv_w = 112, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1589, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1624, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1652, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1680, .adv_w = 112, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1700, .adv_w = 112, .box_w = 9, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1736, .adv_w = 80, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1756, .adv_w = 80, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1776, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1804, .adv_w = 112, .box_w = 7, .box_h = 2, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 1811, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1838, .adv_w = 160, .box_w = 11, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1882, .adv_w = 144, .box_w = 11, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1926, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1958, .adv_w = 112, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1979, .adv_w = 112, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2000, .adv_w = 160, .box_w = 11, .box_h = 7, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 2039, .adv_w = 128, .box_w = 8, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2063, .adv_w = 128, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2095, .adv_w = 128, .box_w = 9, .box_h = 9, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 2136, .adv_w = 112, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2168, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2196, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2224, .adv_w = 80, .box_w = 7, .box_h = 8, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 2252, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2280, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2308, .adv_w = 144, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2335, .adv_w = 128, .box_w = 10, .box_h = 10, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 2385, .adv_w = 96, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2409, .adv_w = 160, .box_w = 10, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2449, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2479, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2509, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2539, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2569, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2599, .adv_w = 160, .box_w = 11, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2643, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2671, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2699, .adv_w = 128, .box_w = 9, .box_h = 9, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 2740, .adv_w = 160, .box_w = 10, .box_h = 6, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2770, .adv_w = 96, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2798, .adv_w = 129, .box_w = 9, .box_h = 6, .ofs_x = 0, .ofs_y = 0} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + +static const uint16_t unicode_list_1[] = { + 0x0, 0x1f72, 0xef51, 0xef58, 0xef5b, 0xef5c, 0xef5d, 0xef61, + 0xef63, 0xef65, 0xef69, 0xef6c, 0xef71, 0xef76, 0xef77, 0xef78, + 0xef8e, 0xef98, 0xef9b, 0xef9c, 0xef9d, 0xefa1, 0xefa2, 0xefa3, + 0xefa4, 0xefb7, 0xefb8, 0xefbe, 0xefc0, 0xefc1, 0xefc4, 0xefc7, + 0xefc8, 0xefc9, 0xefcb, 0xefe3, 0xefe5, 0xf014, 0xf015, 0xf017, + 0xf037, 0xf03a, 0xf043, 0xf06c, 0xf074, 0xf0ab, 0xf13b, 0xf190, + 0xf191, 0xf192, 0xf193, 0xf194, 0xf1d7, 0xf1e3, 0xf23d, 0xf254, + 0xf4aa, 0xf712, 0xf7f2 +}; + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 32, .range_length = 95, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + }, + { + .range_start = 176, .range_length = 63475, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 59, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + } +}; + +/*----------------- + * KERNING + *----------------*/ + +/*Map glyph_ids to kern left classes*/ +static const uint8_t kern_left_class_mapping[] = +{ + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 0, 13, 14, 15, 16, 17, + 18, 19, 12, 20, 20, 0, 0, 0, + 21, 22, 23, 24, 25, 22, 26, 27, + 28, 29, 29, 30, 31, 32, 29, 29, + 22, 33, 34, 35, 3, 36, 30, 37, + 37, 38, 39, 40, 41, 42, 43, 0, + 44, 0, 45, 46, 47, 48, 49, 50, + 51, 45, 52, 52, 53, 48, 45, 45, + 46, 46, 54, 55, 56, 57, 51, 58, + 58, 59, 58, 60, 41, 0, 0, 9, + 61, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +/*Map glyph_ids to kern right classes*/ +static const uint8_t kern_right_class_mapping[] = +{ + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 12, + 18, 19, 20, 21, 21, 0, 0, 0, + 22, 23, 24, 25, 23, 25, 25, 25, + 23, 25, 25, 26, 25, 25, 25, 25, + 23, 25, 23, 25, 3, 27, 28, 29, + 29, 30, 31, 32, 33, 34, 35, 0, + 36, 0, 37, 38, 39, 39, 39, 0, + 39, 38, 40, 41, 38, 38, 42, 42, + 39, 42, 39, 42, 43, 44, 45, 46, + 46, 47, 46, 48, 0, 0, 35, 9, + 49, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +/*Kern values between classes*/ +static const int8_t kern_class_values[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 3, -3, 0, 0, + 0, 0, -7, -8, 1, 6, 3, 2, + -5, 1, 6, 0, 5, 1, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 1, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, -4, 0, 0, 0, 0, + 0, -3, 2, 3, 0, 0, -1, 0, + -1, 1, 0, -1, 0, -1, -1, -3, + 0, 0, 0, 0, -1, 0, 0, -2, + -2, 0, 0, -1, 0, -3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + -1, 0, -2, 0, -3, 0, -15, 0, + 0, -3, 0, 3, 4, 0, 0, -3, + 1, 1, 4, 3, -2, 3, 0, 0, + -7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -3, -2, -6, 0, -5, + -1, 0, 0, 0, 0, 0, 5, 0, + -4, -1, 0, 0, 0, -2, 0, 0, + -1, -9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -10, -1, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 4, + 0, 1, 0, 0, -3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 5, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 3, 1, 4, -1, 0, 0, 3, -1, + -4, -18, 1, 3, 3, 0, -2, 0, + 5, 0, 4, 0, 4, 0, -12, 0, + -2, 4, 0, 4, -1, 3, 1, 0, + 0, 0, -1, 0, 0, -2, 10, 0, + 10, 0, 4, 0, 5, 2, 2, 4, + 0, 0, 0, -5, 0, 0, 0, 0, + 0, -1, 0, 1, -2, -2, -3, 1, + 0, -1, 0, 0, 0, -5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -7, 0, -8, 0, 0, 0, + 0, -1, 0, 13, -2, -2, 1, 1, + -1, 0, -2, 1, 0, 0, -7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -12, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 8, 0, 0, -5, 0, + 4, 0, -9, -12, -9, -3, 4, 0, + 0, -9, 0, 2, -3, 0, -2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 4, -16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 1, 0, 0, 0, + 0, 0, 1, 1, -2, -3, 0, 0, + 0, -1, 0, 0, -1, 0, 0, 0, + -3, 0, -1, 0, -3, -3, 0, -3, + -4, -4, -2, 0, -3, 0, -3, 0, + 0, 0, 0, -1, 0, 0, 1, 0, + 1, -1, 0, 0, 0, 0, 0, 1, + -1, 0, 0, 0, -1, 1, 1, 0, + 0, 0, 0, -2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, -1, 0, + -2, 0, -2, 0, 0, -1, 0, 4, + 0, 0, -1, 0, 0, 0, 0, 0, + 0, 0, -1, -1, 0, 0, -1, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, -1, 0, -1, -2, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, -1, -1, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, -1, -2, 0, -2, 0, -4, + -1, -4, 3, 0, 0, -3, 1, 3, + 3, 0, -3, 0, -2, 0, 0, -6, + 1, -1, 1, -7, 1, 0, 0, 0, + -7, 0, -7, -1, -11, -1, 0, -6, + 0, 3, 4, 0, 2, 0, 0, 0, + 0, 0, 0, -2, -2, 0, -4, 0, + 0, 0, -1, 0, 0, 0, -1, 0, + 0, 0, 0, 0, -1, -1, 0, -1, + -2, 0, 0, 0, 0, 0, 0, 0, + -1, -1, 0, -1, -2, -1, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, -1, 0, -2, + 0, -1, 0, -3, 1, 0, 0, -2, + 1, 1, 1, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 1, + 0, 0, -1, 0, -1, -1, -2, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + -1, 0, 0, 0, 0, -1, -2, 0, + -2, 0, 4, -1, 0, -4, 0, 0, + 3, -6, -7, -5, -3, 1, 0, -1, + -8, -2, 0, -2, 0, -3, 2, -2, + -8, 0, -3, 0, 0, 1, 0, 1, + -1, 0, 1, 0, -4, -5, 0, -6, + -3, -3, -3, -4, -2, -3, 0, -2, + -3, 1, 0, 0, 0, -1, 0, 0, + 0, 1, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, -1, 0, 0, -1, 0, -2, -3, + -3, 0, 0, -4, 0, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, 1, + -1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + -2, 0, 0, 0, 0, -6, -4, 0, + 0, 0, -2, -6, 0, 0, -1, 1, + 0, -3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, -2, 0, + 0, 0, 0, 2, 0, 1, -3, -3, + 0, -1, -1, -2, 0, 0, 0, 0, + 0, 0, -4, 0, -1, 0, -2, -1, + 0, -3, -3, -4, -1, 0, -3, 0, + -4, 0, 0, 0, 0, 10, 0, 0, + 1, 0, 0, -2, 0, 1, 0, -6, + 0, 0, 0, 0, 0, -12, -2, 4, + 4, -1, -5, 0, 1, -2, 0, -6, + -1, -2, 1, -9, -1, 2, 0, 2, + -4, -2, -5, -4, -5, 0, 0, -8, + 0, 7, 0, 0, -1, 0, 0, 0, + -1, -1, -1, -3, -4, 0, -12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, -1, -2, 0, 0, + -3, 0, -1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, 3, + 0, 2, 0, -3, 1, -1, 0, -3, + -1, 0, -2, -1, -1, 0, -2, -2, + 0, 0, -1, 0, -1, -2, -2, 0, + 0, -1, 0, 1, -1, 0, -3, 0, + 0, 0, -3, 0, -2, 0, -2, -2, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, -3, 1, 0, -2, 0, -1, -2, + -4, -1, -1, -1, 0, -1, -2, 0, + 0, 0, 0, 0, 0, -1, -1, -1, + 0, 0, 0, 0, 2, -1, 0, -1, + 0, 0, 0, -1, -2, -1, -1, -2, + -1, 0, 1, 5, 0, 0, -3, 0, + -1, 3, 0, -1, -5, -2, 2, 0, + 0, -6, -2, 1, -2, 1, 0, -1, + -1, -4, 0, -2, 1, 0, 0, -2, + 0, 0, 0, 1, 1, -3, -2, 0, + -2, -1, -2, -1, -1, 0, -2, 1, + -2, -2, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + 0, 0, -1, -1, 0, 0, 0, 0, + -1, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, -1, 0, 0, 0, 0, + -2, 0, -3, 0, 0, 0, -4, 0, + 1, -3, 3, 0, -1, -6, 0, 0, + -3, -1, 0, -5, -3, -4, 0, 0, + -6, -1, -5, -5, -6, 0, -3, 0, + 1, 9, -2, 0, -3, -1, 0, -1, + -2, -3, -2, -5, -5, -3, -1, 0, + 0, -1, 0, 0, 0, 0, -9, -1, + 4, 3, -3, -5, 0, 0, -4, 0, + -6, -1, -1, 3, -12, -2, 0, 0, + 0, -8, -2, -7, -1, -9, 0, 0, + -9, 0, 8, 0, 0, -1, 0, 0, + 0, 0, -1, -1, -5, -1, 0, -8, + 0, 0, 0, 0, -4, 0, -1, 0, + 0, -4, -6, 0, 0, -1, -2, -4, + -1, 0, -1, 0, 0, 0, 0, -6, + -1, -4, -4, -1, -2, -3, -1, -2, + 0, -3, -1, -4, -2, 0, -2, -2, + -1, -2, 0, 1, 0, -1, -4, 0, + 3, 0, -2, 0, 0, 0, 0, 2, + 0, 1, -3, 5, 0, -1, -1, -2, + 0, 0, 0, 0, 0, 0, -4, 0, + -1, 0, -2, -1, 0, -3, -3, -4, + -1, 0, -3, 1, 5, 0, 0, 0, + 0, 10, 0, 0, 1, 0, 0, -2, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, -3, 0, 0, 0, 0, 0, -1, + 0, 0, 0, -1, -1, 0, 0, -3, + -1, 0, 0, -3, 0, 2, -1, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 2, 3, 1, -1, 0, -4, + -2, 0, 4, -4, -4, -3, -3, 5, + 2, 1, -11, -1, 3, -1, 0, -1, + 1, -1, -4, 0, -1, 1, -2, -1, + -4, -1, 0, 0, 4, 3, 0, -4, + 0, -7, -2, 4, -2, -5, 0, -2, + -4, -4, -1, 5, 1, 0, -2, 0, + -3, 0, 1, 4, -3, -5, -5, -3, + 4, 0, 0, -9, -1, 1, -2, -1, + -3, 0, -3, -5, -2, -2, -1, 0, + 0, -3, -3, -1, 0, 4, 3, -1, + -7, 0, -7, -2, 0, -4, -7, 0, + -4, -2, -4, -4, 3, 0, 0, -2, + 0, -3, -1, 0, -1, -2, 0, 2, + -4, 1, 0, 0, -7, 0, -1, -3, + -2, -1, -4, -3, -4, -3, 0, -4, + -1, -3, -2, -4, -1, 0, 0, 0, + 6, -2, 0, -4, -1, 0, -1, -3, + -3, -3, -4, -5, -2, -3, 3, 0, + -2, 0, -6, -2, 1, 3, -4, -5, + -3, -4, 4, -1, 1, -12, -2, 3, + -3, -2, -5, 0, -4, -5, -2, -1, + -1, -1, -3, -4, 0, 0, 0, 4, + 4, -1, -8, 0, -8, -3, 3, -5, + -9, -3, -4, -5, -6, -4, 3, 0, + 0, 0, 0, -2, 0, 0, 1, -2, + 3, 1, -2, 3, 0, 0, -4, 0, + 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 1, 4, 0, 0, -2, 0, 0, + 0, 0, -1, -1, -2, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 1, 0, + -1, 0, 5, 0, 2, 0, 0, -2, + 0, 3, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -8, 0, -1, 2, 0, 4, + 0, 0, 13, 2, -3, -3, 1, 1, + -1, 0, -6, 0, 0, 6, -8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -9, 5, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, 0, 0, -2, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, -3, 0, + 0, 0, 0, 0, 1, 17, -3, -1, + 4, 3, -3, 1, 0, 0, 1, 1, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -17, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -4, + 0, 0, 0, -3, 0, 0, 0, 0, + -3, -1, 0, 0, 0, -3, 0, -2, + 0, -6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, -2, 0, -2, 0, + -3, 0, 0, 0, -2, 1, -2, 0, + 0, -3, -1, -3, 0, 0, -3, 0, + -1, 0, -6, 0, -1, 0, 0, -10, + -2, -5, -1, -5, 0, 0, -9, 0, + -3, -1, 0, 0, 0, 0, 0, 0, + 0, 0, -2, -2, -1, -2, 0, 0, + 0, 0, -3, 0, -3, 2, -1, 3, + 0, -1, -3, -1, -2, -2, 0, -2, + -1, -1, 1, -3, 0, 0, 0, 0, + -11, -1, -2, 0, -3, 0, -1, -6, + -1, 0, 0, -1, -1, 0, 0, 0, + 0, 1, 0, -1, -2, -1, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, + 0, -3, 0, -1, 0, 0, 0, -3, + 1, 0, 0, 0, -3, -1, -3, 0, + 0, -4, 0, -1, 0, -6, 0, 0, + 0, 0, -12, 0, -3, -5, -6, 0, + 0, -9, 0, -1, -2, 0, 0, 0, + 0, 0, 0, 0, 0, -1, -2, -1, + -2, 0, 0, 0, 2, -2, 0, 4, + 6, -1, -1, -4, 2, 6, 2, 3, + -3, 2, 5, 2, 4, 3, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 6, -2, -1, 0, -1, + 10, 6, 10, 0, 0, 0, 1, 0, + 0, 5, 0, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, 0, + 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, -11, -2, -1, -5, + -6, 0, 0, -9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, -11, -2, -1, + -5, -6, 0, 0, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, -3, 1, 0, -1, + 1, 2, 1, -4, 0, 0, -1, 1, + 0, 1, 0, 0, 0, 0, -3, 0, + -1, -1, -3, 0, -1, -5, 0, 8, + -1, 0, -3, -1, 0, -1, -2, 0, + -1, -4, -3, -2, 0, 0, 0, -2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, -11, + -2, -1, -5, -6, 0, 0, -9, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -2, 0, -4, -2, -1, 4, -1, -1, + -5, 0, -1, 0, -1, -3, 0, 3, + 0, 1, 0, 1, -3, -5, -2, 0, + -5, -2, -3, -5, -5, 0, -2, -3, + -2, -2, -1, -1, -2, -1, 0, -1, + 0, 2, 0, 2, -1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, -1, -1, 0, 0, + -3, 0, -1, 0, -2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, -1, 0, -2, + 0, 0, 0, 0, -1, 0, 0, -2, + -1, 1, 0, -2, -2, -1, 0, -4, + -1, -3, -1, -2, 0, -2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -9, 0, 4, 0, 0, -2, 0, + 0, 0, 0, -2, 0, -1, 0, 0, + -1, 0, 0, -1, 0, -3, 0, 0, + 5, -2, -4, -4, 1, 1, 1, 0, + -4, 1, 2, 1, 4, 1, 4, -1, + -3, 0, 0, -5, 0, 0, -4, -3, + 0, 0, -3, 0, -2, -2, 0, -2, + 0, -2, 0, -1, 2, 0, -1, -4, + -1, 5, 0, 0, -1, 0, -3, 0, + 0, 2, -3, 0, 1, -1, 1, 0, + 0, -4, 0, -1, 0, 0, -1, 1, + -1, 0, 0, 0, -5, -2, -3, 0, + -4, 0, 0, -6, 0, 5, -1, 0, + -2, 0, 1, 0, -1, 0, -1, -4, + 0, -1, 1, 0, 0, 0, 0, -1, + 0, 0, 1, -2, 0, 0, 0, -2, + -1, 0, -2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -8, 0, 3, 0, + 0, -1, 0, 0, 0, 0, 0, 0, + -1, -1, 0, 0, 0, 3, 0, 3, + 0, 0, 0, 0, 0, -8, -7, 0, + 6, 4, 2, -5, 1, 5, 0, 5, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 +}; + +/*Collect the kern class' data in one place*/ +static const lv_font_fmt_txt_kern_classes_t kern_classes = +{ + .class_pair_values = kern_class_values, + .left_class_mapping = kern_left_class_mapping, + .right_class_mapping = kern_right_class_mapping, + .left_class_cnt = 61, + .right_class_cnt = 49, +}; + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_dsc_t font_dsc = { + .glyph_bitmap = gylph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = &kern_classes, + .kern_scale = 16, + .cmap_num = 2, + .bpp = 4, + .kern_classes = 1, + .bitmap_format = 0 +}; + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +lv_font_t font_2 = { + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 10, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + +#endif /*#if FONT_2*/ +#endif diff --git a/lib/lvgl/tests/src/test_fonts/font_2.fnt b/lib/lvgl/tests/src/test_fonts/font_2.fnt new file mode 100644 index 00000000..3b648e9d Binary files /dev/null and b/lib/lvgl/tests/src/test_fonts/font_2.fnt differ diff --git a/lib/lvgl/tests/src/test_fonts/font_3.c b/lib/lvgl/tests/src/test_fonts/font_3.c new file mode 100644 index 00000000..1f03794f --- /dev/null +++ b/lib/lvgl/tests/src/test_fonts/font_3.c @@ -0,0 +1,948 @@ +#if LV_BUILD_TEST +#include "../../lvgl.h" + +/******************************************************************************* + * Size: 20 px + * Bpp: 4 + * Opts: --bpp 4 --size 20 --font ../RobotoMono-Regular.ttf -r 0x20-0x7f --format lvgl -o ..\generated_fonts/font_3.c + ******************************************************************************/ + +#ifndef FONT_3 +#define FONT_3 1 +#endif + +#if FONT_3 + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { + /* U+20 " " */ + + /* U+21 "!" */ + 0x1f, 0xb0, 0xf, 0xfe, 0x69, 0x10, 0x76, 0x40, + 0x30, 0x81, 0x76, 0x98, 0xb0, + + /* U+22 "\"" */ + 0x8e, 0x0, 0x7b, 0x0, 0x7c, 0x60, 0x11, 0x80, + 0x80, 0x43, 0xca, 0x0, 0x37, + + /* U+23 "#" */ + 0x0, 0xc5, 0xe6, 0x7, 0xe6, 0x1, 0xc8, 0x6, + 0xa, 0x6, 0x1, 0xde, 0x40, 0xf, 0x30, 0xf, + 0x2a, 0x0, 0x15, 0x40, 0x15, 0x7f, 0x8d, 0xbf, + 0xc6, 0xde, 0xe1, 0xd2, 0xe0, 0xf2, 0xe0, 0xf2, + 0x80, 0x8d, 0x81, 0x2d, 0xa1, 0x2c, 0x60, 0x11, + 0x88, 0x80, 0x84, 0x40, 0x1d, 0xc4, 0x0, 0xd2, + 0x0, 0xc2, 0x25, 0x61, 0x13, 0x30, 0x40, 0xd, + 0xdc, 0x35, 0xee, 0x1a, 0xf6, 0x3, 0xdd, 0x4, + 0x5c, 0x84, 0xdf, 0x80, 0xa0, 0x1, 0x90, 0xc1, + 0x90, 0xc0, 0x2d, 0x21, 0xd, 0x20, 0xf, 0x1b, + 0x80, 0x11, 0x0, 0x18, + + /* U+24 "$" */ + 0x0, 0xcb, 0xe2, 0x1, 0xff, 0xc4, 0x78, 0xb, + 0x40, 0xd, 0xb0, 0x64, 0xb6, 0xe0, 0x8, 0x27, + 0xed, 0xd0, 0xc0, 0x82, 0x4, 0x0, 0xa, 0x41, + 0xc0, 0x40, 0x38, 0xc8, 0x0, 0xe0, 0xe0, 0x12, + 0x6b, 0x5, 0x84, 0x5a, 0x0, 0x70, 0xe9, 0xa5, + 0xea, 0x80, 0x62, 0xcc, 0x29, 0x54, 0x80, 0x71, + 0xd6, 0x93, 0x21, 0x29, 0x0, 0x45, 0x21, 0xaf, + 0x4a, 0x1, 0x9c, 0xd, 0x2, 0x44, 0x2, 0xa0, + 0xd1, 0x71, 0xf8, 0x86, 0x31, 0x38, 0x44, 0x9b, + 0xb8, 0x97, 0x0, 0x26, 0xd6, 0x1e, 0xa1, 0x0, + 0xe1, 0x0, 0xe0, + + /* U+25 "%" */ + 0x7, 0xee, 0x40, 0x7, 0xc9, 0x10, 0xb7, 0x50, + 0xf, 0x61, 0x32, 0xa7, 0x80, 0xf1, 0x80, 0x42, + 0x1, 0xd2, 0x66, 0x0, 0x69, 0x98, 0x97, 0x45, + 0xe0, 0x2, 0x55, 0x66, 0xab, 0xc1, 0x28, 0x6, + 0xae, 0xe5, 0x8b, 0x48, 0x7, 0x84, 0x41, 0x6, + 0x80, 0x1f, 0x89, 0xa0, 0x3, 0xfa, 0x11, 0x13, + 0xdc, 0x70, 0xc, 0x6b, 0xc, 0xca, 0x88, 0x20, + 0x5, 0x8, 0x78, 0xa8, 0xc5, 0x80, 0x13, 0x40, + 0x7, 0xfb, 0x4c, 0x31, 0x51, 0x8b, 0x0, 0x3c, + 0xcc, 0xa8, 0x82, 0x0, + + /* U+26 "&" */ + 0x0, 0x26, 0x7e, 0xb0, 0x7, 0x15, 0x9b, 0xc, + 0xa8, 0x6, 0xa0, 0xa9, 0xc1, 0xe0, 0xc, 0x40, + 0xe0, 0x13, 0x80, 0x63, 0x7, 0x6, 0x1b, 0x0, + 0xd4, 0x12, 0xf2, 0xae, 0x1, 0x8d, 0x8e, 0x1a, + 0x80, 0x38, 0x90, 0x1, 0x40, 0x1c, 0x38, 0x50, + 0x1a, 0x20, 0xbc, 0x70, 0x32, 0xf2, 0x34, 0x1a, + 0x22, 0x40, 0x60, 0x65, 0x47, 0x51, 0x23, 0x10, + 0xa, 0x8a, 0xa, 0x41, 0x5, 0x0, 0x2a, 0x0, + 0x30, 0x40, 0x5d, 0x45, 0xc0, 0x84, 0x1, 0x6a, + 0xa3, 0xb4, 0x71, 0xb2, 0x0, + + /* U+27 "'" */ + 0x2f, 0x50, 0xe, 0x10, 0x3, 0x81, 0x88, + + /* U+28 "(" */ + 0x0, 0xe1, 0x0, 0xd9, 0x20, 0x15, 0x8c, 0x80, + 0x1d, 0x38, 0x40, 0x10, 0xa6, 0x0, 0x70, 0x90, + 0xa, 0xc4, 0xc0, 0x2, 0x68, 0x1, 0x28, 0x68, + 0x4, 0x40, 0x20, 0x10, 0x81, 0x80, 0x70, 0x80, + 0x42, 0x2, 0x1, 0x18, 0x18, 0x4, 0xe1, 0xe0, + 0x11, 0xa, 0x80, 0x67, 0x31, 0x0, 0xac, 0x24, + 0x2, 0x25, 0x60, 0xd, 0x61, 0x40, 0x10, 0xea, + 0xb8, 0x4, 0x7a, 0x80, + + /* U+29 ")" */ + 0x20, 0xe, 0xe9, 0x0, 0xde, 0xd0, 0x1, 0x1c, + 0x39, 0x80, 0x4e, 0x5e, 0x1, 0xa8, 0xcc, 0x1, + 0x28, 0x50, 0x4, 0x42, 0x80, 0x19, 0x48, 0x40, + 0x21, 0x2, 0x0, 0x8c, 0x1c, 0x2, 0x10, 0xe, + 0x10, 0x70, 0x8, 0xc0, 0x80, 0x27, 0x11, 0x0, + 0x44, 0x80, 0x12, 0x87, 0x80, 0x5c, 0x2a, 0x0, + 0x34, 0x80, 0xb, 0x8d, 0x80, 0x14, 0x1a, 0x1, + 0x7e, 0x8, 0x4, + + /* U+2A "*" */ + 0x0, 0xd3, 0xe2, 0x1, 0xf0, 0x80, 0x80, 0x61, + 0x0, 0x78, 0x6, 0x12, 0xeb, 0x41, 0x10, 0x36, + 0xc0, 0xaa, 0xae, 0x47, 0xe4, 0xc0, 0xeb, 0xb0, + 0x0, 0xdb, 0xd2, 0x1, 0x50, 0xab, 0x98, 0x6, + 0x66, 0x45, 0x8d, 0x0, 0x43, 0x24, 0xc3, 0x8, + 0xe0, 0x1, 0xbe, 0x0, 0x3b, 0xc0, + + /* U+2B "+" */ + 0x0, 0xd1, 0x0, 0xf, 0xca, 0xc0, 0x1f, 0xfd, + 0x6d, 0xff, 0x88, 0x7f, 0xee, 0x62, 0x28, 0x0, + 0x45, 0xaf, 0x76, 0x21, 0xdd, 0xb0, 0x3, 0xff, + 0xa4, + + /* U+2C "," */ + 0xa, 0xf4, 0x1, 0x0, 0x9c, 0x18, 0x8, 0x49, + 0x46, 0x1, 0x69, 0x80, + + /* U+2D "-" */ + 0x78, 0x8f, 0x25, 0x3b, 0xfb, 0x40, + + /* U+2E "." */ + 0x8, 0xc3, 0x17, 0x39, 0x14, 0xf, + + /* U+2F "/" */ + 0x0, 0xf6, 0x68, 0x7, 0x88, 0xe8, 0x3, 0xd4, + 0xc, 0x1, 0xe6, 0x41, 0x0, 0xe4, 0x1e, 0x0, + 0xf7, 0x2, 0x80, 0x79, 0x58, 0x3, 0xcc, 0x14, + 0x1, 0xed, 0x23, 0x0, 0xe1, 0x4a, 0x0, 0xf3, + 0x2, 0x80, 0x7a, 0x90, 0x80, 0x38, 0xcb, 0x40, + 0x3d, 0x40, 0xc0, 0x1e, 0x65, 0x0, 0xf2, 0x87, + 0x0, 0x78, + + /* U+30 "0" */ + 0x0, 0x25, 0xff, 0xb1, 0x0, 0x25, 0xb5, 0x66, + 0x15, 0xa8, 0x2, 0xc7, 0xe6, 0x5e, 0x34, 0x8, + 0x32, 0x20, 0x1, 0x90, 0x53, 0x2, 0x0, 0xc2, + 0x1b, 0xe0, 0xc0, 0x14, 0x48, 0x8, 0x80, 0x21, + 0xb7, 0x50, 0xe, 0x3c, 0x4b, 0x80, 0xd, 0x58, + 0x1a, 0x80, 0x10, 0x83, 0x2e, 0x90, 0x8, 0x3, + 0xc1, 0xe8, 0x3, 0x84, 0xc3, 0xc0, 0x32, 0x86, + 0xa0, 0xc8, 0x80, 0x56, 0xa, 0x16, 0x3f, 0x32, + 0xe2, 0x90, 0x2, 0xda, 0xb3, 0xa, 0xd8, 0x0, + + /* U+31 "1" */ + 0x0, 0xc4, 0x80, 0x6, 0xcd, 0xc9, 0xf9, 0x30, + 0x3, 0x25, 0xd8, 0x1, 0xd6, 0x8e, 0x0, 0x10, + 0xf, 0xff, 0x78, + + /* U+32 "2" */ + 0x0, 0xc, 0xf7, 0xf4, 0x0, 0x62, 0xf6, 0x56, + 0x27, 0xd0, 0xa, 0x46, 0xed, 0x38, 0xa4, 0xe0, + 0x4, 0x34, 0x0, 0xa0, 0x30, 0x5, 0xe4, 0x3, + 0x18, 0x4, 0x30, 0xa0, 0x19, 0x3, 0x0, 0x3f, + 0x40, 0x30, 0x7, 0xd2, 0x52, 0x20, 0x1e, 0x76, + 0x56, 0x0, 0xf2, 0x41, 0xd0, 0x7, 0x8e, 0xcb, + 0x40, 0x3c, 0x3a, 0x3e, 0x20, 0x1e, 0xc1, 0xd2, + 0x0, 0xf5, 0x91, 0xa3, 0xbf, 0x18, 0x28, 0x1c, + 0x47, 0x94, + + /* U+33 "3" */ + 0x0, 0xc, 0xf7, 0xf4, 0x0, 0x43, 0xec, 0xae, + 0xaf, 0xa0, 0xb, 0x1a, 0xb8, 0xb7, 0x26, 0x4, + 0x15, 0x0, 0xa8, 0x30, 0x3b, 0x80, 0x1f, 0xfc, + 0x2b, 0xf, 0x0, 0x85, 0xe7, 0x59, 0xd4, 0x2, + 0x38, 0x62, 0x1c, 0x0, 0xc5, 0xfe, 0xb3, 0xb4, + 0x0, 0xf2, 0x78, 0x78, 0x8, 0x80, 0x31, 0xa, + 0x87, 0x60, 0x7, 0x9, 0x81, 0x92, 0x0, 0x4c, + 0x8, 0x1c, 0x17, 0x68, 0xb9, 0x28, 0x2, 0xe6, + 0x57, 0x57, 0xd1, + + /* U+34 "4" */ + 0x0, 0xf1, 0xff, 0x80, 0x3f, 0x78, 0x7, 0xf3, + 0x18, 0x7, 0xe1, 0x94, 0x30, 0xf, 0xac, 0x28, + 0x3, 0xe4, 0x58, 0x10, 0xf, 0xa4, 0x9c, 0x3, + 0xe7, 0x29, 0x0, 0xf8, 0xa1, 0x50, 0x3, 0xe9, + 0xb, 0x0, 0xf8, 0xd0, 0x3b, 0xfe, 0x30, 0xff, + 0xc, 0x47, 0x84, 0x1e, 0x9, 0xdf, 0xc4, 0x10, + 0xe0, 0x1f, 0xfc, 0xa0, + + /* U+35 "5" */ + 0x0, 0x7f, 0xfc, 0xa0, 0x20, 0x26, 0x7c, 0x20, + 0x60, 0xd9, 0x9c, 0x80, 0xc1, 0xc0, 0x1f, 0x8, + 0x18, 0x7, 0xc4, 0x7, 0x15, 0x6, 0x1, 0x78, + 0x4b, 0xab, 0xe3, 0x80, 0x38, 0xa7, 0xb9, 0x21, + 0x4, 0xd, 0xac, 0x22, 0x68, 0xa, 0x0, 0xf9, + 0x40, 0xc0, 0x3e, 0x30, 0x0, 0xfd, 0x80, 0x62, + 0x2, 0x13, 0x43, 0x0, 0xa0, 0x30, 0x38, 0x32, + 0xa7, 0x51, 0xa, 0x5, 0xaa, 0x8c, 0xf, 0x60, + + /* U+36 "6" */ + 0x0, 0x86, 0x37, 0xd4, 0x3, 0x27, 0x39, 0xa3, + 0x0, 0x45, 0x61, 0x5d, 0x66, 0x1, 0x48, 0x52, + 0x80, 0x70, 0xa1, 0xa8, 0x7, 0x90, 0x2c, 0x59, + 0xd4, 0x2, 0x20, 0xde, 0x98, 0xad, 0x10, 0xe0, + 0x58, 0xee, 0x31, 0x50, 0x5, 0xe, 0x22, 0x92, + 0x41, 0x0, 0x20, 0x6, 0x50, 0x51, 0x6, 0x0, + 0xde, 0x3, 0x81, 0xa0, 0x1b, 0x41, 0x90, 0x9c, + 0x80, 0x4, 0xa2, 0x61, 0xc1, 0xb5, 0x4d, 0xa, + 0x0, 0x1e, 0x22, 0xa9, 0x31, 0x0, + + /* U+37 "7" */ + 0xef, 0xff, 0xd6, 0xec, 0xde, 0x40, 0x39, 0x9f, + 0x88, 0x24, 0x3, 0xc2, 0xca, 0x20, 0x1e, 0x60, + 0x90, 0xf, 0xa4, 0x8c, 0x3, 0xca, 0x36, 0x1, + 0xf4, 0x8b, 0x0, 0x78, 0xcc, 0xc0, 0x1f, 0x48, + 0x50, 0x7, 0x85, 0x50, 0x80, 0x3d, 0x21, 0xe0, + 0x1f, 0x31, 0x20, 0x7, 0x98, 0x68, 0x3, 0xeb, + 0x6, 0x0, 0xe0, + + /* U+38 "8" */ + 0x0, 0x15, 0x77, 0xea, 0x80, 0x43, 0xaa, 0x8c, + 0x15, 0x20, 0xb, 0xa, 0xa4, 0xe9, 0x31, 0x2, + 0x2, 0x80, 0x54, 0x8, 0x6, 0x1, 0xf1, 0x82, + 0x2, 0x80, 0x54, 0x8, 0x12, 0x75, 0x49, 0xd2, + 0xa1, 0x0, 0x50, 0x2b, 0x11, 0xa0, 0x1, 0xe5, + 0x77, 0xe8, 0xb0, 0x42, 0xa, 0x88, 0x16, 0xc9, + 0x8c, 0x10, 0x3, 0x20, 0x60, 0x0, 0xc0, 0x31, + 0x80, 0xc, 0x54, 0x80, 0x2b, 0xd, 0xa, 0xd, + 0xa8, 0xc6, 0x36, 0x4, 0xc4, 0x57, 0x17, 0xc0, + + /* U+39 "9" */ + 0x0, 0x26, 0x7f, 0x51, 0x0, 0x4d, 0x64, 0xca, + 0xac, 0x10, 0x4, 0x8f, 0xcd, 0xc8, 0xd8, 0x28, + 0x48, 0x80, 0x18, 0x94, 0x34, 0xc, 0x3, 0x28, + 0x27, 0x80, 0x7b, 0x80, 0x48, 0xc, 0x3, 0x70, + 0x1a, 0x4, 0x88, 0x0, 0xdc, 0xc, 0x5c, 0x7e, + 0x6b, 0x4, 0x4, 0x22, 0x4d, 0x9e, 0x1c, 0x18, + 0x0, 0xdb, 0xfa, 0xea, 0x24, 0x1, 0xe3, 0x33, + 0x80, 0x79, 0x34, 0x60, 0x2, 0x5b, 0xeb, 0xd, + 0x10, 0xb, 0x54, 0x9f, 0xcc, 0x0, + + /* U+3A ":" */ + 0x5f, 0xb0, 0xf0, 0x42, 0x93, 0x62, 0x3c, 0x90, + 0xf, 0xfe, 0x29, 0xe4, 0x4, 0x9b, 0x97, 0x81, + 0x90, + + /* U+3B ";" */ + 0x6, 0xfa, 0x0, 0x68, 0x28, 0x3, 0xcd, 0xc0, + 0x9, 0x90, 0x1, 0xff, 0xcf, 0x4a, 0x60, 0x1, + 0x2f, 0x0, 0x4, 0x3, 0x70, 0x60, 0x1, 0x9, + 0x0, 0xf, 0xc0, 0x0, + + /* U+3C "<" */ + 0x0, 0xf9, 0x2c, 0x3, 0x9b, 0x6d, 0x40, 0x2, + 0xfd, 0x26, 0xd8, 0x33, 0xd0, 0x55, 0xd2, 0x48, + 0xc3, 0x78, 0xa0, 0x12, 0x28, 0xdd, 0x20, 0x4, + 0x35, 0xac, 0xb7, 0xae, 0x20, 0x2, 0x9e, 0x83, + 0x8f, 0x0, 0xc2, 0xfd, 0x24, 0x1, 0xf3, 0x60, + + /* U+3D "=" */ + 0x39, 0x9f, 0xc6, 0xec, 0xdf, 0x95, 0x3f, 0xff, + 0x30, 0x7, 0xf8, 0xa6, 0x7f, 0x1b, 0x37, 0xf2, + 0x80, + + /* U+3E ">" */ + 0x3a, 0x30, 0xf, 0x9d, 0x73, 0xa, 0x1, 0xc9, + 0x8c, 0x75, 0xae, 0x1, 0x8e, 0x7e, 0x9a, 0x3e, + 0x44, 0x3, 0x2d, 0xe1, 0x32, 0x0, 0x65, 0xbc, + 0x25, 0x40, 0x28, 0xea, 0x57, 0xea, 0x13, 0xd7, + 0x39, 0xe8, 0x10, 0x3, 0xa5, 0xeb, 0x0, 0x72, + 0x5a, 0x0, 0x7c, + + /* U+3F "?" */ + 0x0, 0x1d, 0xf7, 0xea, 0x80, 0x4b, 0x88, 0xaa, + 0x3a, 0x80, 0x5, 0x86, 0xdd, 0x78, 0xb8, 0x89, + 0xe0, 0x80, 0x2, 0xe0, 0x43, 0x2e, 0x1, 0x8c, + 0x4, 0x3, 0xc4, 0xa4, 0x40, 0xf, 0x70, 0x48, + 0x7, 0xb0, 0xe1, 0x0, 0x3a, 0x4d, 0xdc, 0x1, + 0xe7, 0x18, 0x0, 0xf8, 0x9c, 0x3, 0xf6, 0x48, + 0x7, 0xe1, 0x10, 0x7, 0xc3, 0xde, 0x1, 0xf8, + 0x48, 0x3, 0x0, + + /* U+40 "@" */ + 0x0, 0xd1, 0xbf, 0xae, 0x1, 0xc3, 0xab, 0x76, + 0xa9, 0xb0, 0xd, 0x4d, 0xac, 0x8f, 0xea, 0xc0, + 0x4, 0x5b, 0x9, 0xfd, 0x3b, 0xb0, 0x3, 0xe4, + 0x25, 0x2d, 0x95, 0x44, 0x20, 0x8a, 0x2d, 0xc8, + 0x2, 0x4, 0x43, 0x2, 0x41, 0x30, 0x72, 0x1, + 0x77, 0x8, 0x12, 0x80, 0x5, 0xc0, 0x21, 0x30, + 0xe2, 0x0, 0x10, 0x80, 0xb0, 0x98, 0x0, 0xc0, + 0x40, 0xc4, 0xc9, 0x44, 0x5e, 0x88, 0xa0, 0x29, + 0x40, 0x12, 0x67, 0xb, 0x26, 0xc5, 0xb0, 0x5, + 0xc9, 0xf7, 0x26, 0x5d, 0xa2, 0x0, 0x64, 0xd8, + 0x44, 0x3a, 0x80, 0x75, 0x4a, 0x55, 0xd9, 0xc0, + 0x20, + + /* U+41 "A" */ + 0x0, 0xec, 0xf0, 0xf, 0xe1, 0x30, 0x50, 0xf, + 0xce, 0x0, 0xf0, 0xf, 0xda, 0x8, 0x80, 0xf, + 0xc8, 0xba, 0x26, 0x1, 0xe4, 0xc, 0x70, 0xb0, + 0xf, 0x68, 0x38, 0x92, 0x80, 0x79, 0xcc, 0x41, + 0x48, 0x80, 0x18, 0xc6, 0xc0, 0x16, 0xa, 0x1, + 0xac, 0x32, 0x66, 0xc, 0x0, 0xca, 0x8, 0xcc, + 0x50, 0x41, 0x0, 0x11, 0x1b, 0xff, 0x50, 0x20, + 0x1, 0x43, 0x40, 0x32, 0x7, 0x80, 0x30, 0x10, + 0x3, 0x9, 0xa0, 0xa, 0x20, 0x3, 0xc8, 0x28, + + /* U+42 "B" */ + 0x4f, 0xfd, 0xd8, 0xa0, 0x18, 0xd9, 0x88, 0x55, + 0x40, 0xa, 0xe6, 0x55, 0xc6, 0xa8, 0x1, 0xf4, + 0x86, 0x0, 0x7c, 0x61, 0xe0, 0x1e, 0x1b, 0x5, + 0x0, 0x5c, 0x42, 0x7c, 0xa8, 0x80, 0x6, 0xee, + 0x61, 0x36, 0x0, 0xa3, 0xfe, 0xb1, 0xc3, 0x0, + 0xf2, 0x70, 0x40, 0x7, 0xc6, 0xa, 0x1, 0xf0, + 0x81, 0x80, 0x7d, 0x0, 0xa0, 0xb, 0x88, 0x4e, + 0xb1, 0xc0, 0x0, 0xdd, 0xcc, 0x11, 0x80, + + /* U+43 "C" */ + 0x0, 0x15, 0xff, 0xb1, 0x80, 0x24, 0xd5, 0x53, + 0x14, 0xc8, 0x1, 0x43, 0xf5, 0x3c, 0x6c, 0x6c, + 0x30, 0x20, 0x17, 0x84, 0xe8, 0x38, 0x6, 0x35, + 0x36, 0x11, 0x0, 0x75, 0x49, 0x18, 0x7, 0xff, + 0x40, 0x8c, 0x3, 0xf3, 0x8, 0x80, 0x3a, 0x63, + 0x41, 0xc0, 0x31, 0xb1, 0x30, 0xc0, 0x80, 0x50, + 0x12, 0x14, 0x3f, 0x32, 0xd4, 0x73, 0x4, 0xc5, + 0x76, 0x19, 0x80, + + /* U+44 "D" */ + 0x7f, 0xfb, 0xb1, 0x80, 0x3c, 0xae, 0xe1, 0x9d, + 0x10, 0xd, 0xf1, 0x3b, 0x25, 0x80, 0x1f, 0x99, + 0x84, 0xc0, 0x1f, 0xa0, 0x34, 0x3, 0xf0, 0x92, + 0x0, 0x7f, 0x8, 0x7, 0xf9, 0xc0, 0x40, 0x3f, + 0x38, 0x8, 0x7, 0xe1, 0x0, 0xfe, 0x12, 0x40, + 0xf, 0xd0, 0x1a, 0x1, 0xf3, 0xb1, 0xb0, 0x5, + 0xf1, 0x3b, 0x5, 0xa0, 0x19, 0x5d, 0xc3, 0x3a, + 0x20, 0x0, + + /* U+45 "E" */ + 0x3f, 0xff, 0xcc, 0x0, 0x26, 0x6f, 0x28, 0x1, + 0x26, 0x7c, 0x60, 0x1f, 0xfd, 0xe6, 0xff, 0xe8, + 0x0, 0x89, 0xdf, 0xb0, 0x2, 0x48, 0x8e, 0x40, + 0xf, 0xfe, 0xaa, 0x44, 0x79, 0x0, 0x4, 0xef, + 0xec, + + /* U+46 "F" */ + 0x2f, 0xff, 0xd2, 0x0, 0x26, 0x6f, 0x60, 0x1, + 0xe6, 0x7c, 0xa0, 0x1f, 0xfd, 0xe5, 0xff, 0xe9, + 0x0, 0x89, 0xdf, 0xb0, 0x2, 0x78, 0x8e, 0x50, + 0xf, 0xff, 0x38, + + /* U+47 "G" */ + 0x0, 0x8a, 0xff, 0xd8, 0xa0, 0x19, 0x35, 0x10, + 0xa5, 0x52, 0x1, 0x50, 0xed, 0xd7, 0x1b, 0x20, + 0x38, 0xc1, 0x0, 0x5e, 0x1e, 0x18, 0xe, 0x1, + 0x8e, 0x78, 0x14, 0x44, 0x1, 0xcc, 0xa0, 0x24, + 0x1, 0xff, 0xc2, 0x68, 0x89, 0xc0, 0x3d, 0xae, + 0xf4, 0x80, 0x90, 0x5, 0x7f, 0xe2, 0x0, 0x28, + 0x88, 0x3, 0xf6, 0x84, 0x80, 0x7e, 0x62, 0x74, + 0x0, 0x88, 0x80, 0x17, 0x8d, 0xda, 0x6f, 0x42, + 0x80, 0x5, 0xec, 0xac, 0xc7, 0xd4, + + /* U+48 "H" */ + 0x9f, 0x10, 0xc, 0x3f, 0x20, 0x1f, 0xff, 0x2e, + 0xff, 0xdc, 0x1, 0x99, 0xdf, 0x30, 0x6, 0x88, + 0xf0, 0x7, 0xff, 0xa0, + + /* U+49 "I" */ + 0x4f, 0xff, 0xc8, 0xcd, 0x80, 0xc, 0xd8, 0xa6, + 0x60, 0x19, 0x98, 0x80, 0x3f, 0xff, 0xe0, 0x1f, + 0xfc, 0xd2, 0x99, 0x80, 0x66, 0x62, 0x66, 0xc0, + 0x6, 0x6c, + + /* U+4A "J" */ + 0x0, 0xfd, 0x3e, 0x60, 0x1f, 0xff, 0xf0, 0xf, + 0xfe, 0x6b, 0xb0, 0x7, 0x18, 0x5, 0x52, 0x1, + 0xce, 0x6, 0x14, 0x12, 0x1, 0x39, 0x28, 0x1, + 0xcd, 0xb6, 0x72, 0xa, 0xc0, 0x2c, 0x80, 0x62, + 0x6c, 0x10, + + /* U+4B "K" */ + 0x4f, 0x80, 0xc, 0x9f, 0xa0, 0x1f, 0x15, 0x7, + 0x80, 0x7d, 0xc3, 0x44, 0x1, 0xe9, 0x36, 0x50, + 0xf, 0x2b, 0x14, 0x80, 0x78, 0xa8, 0x3c, 0x3, + 0xc3, 0xc1, 0x4, 0x1, 0xe6, 0x30, 0xa0, 0xf, + 0xc8, 0xa5, 0x0, 0x1e, 0x2a, 0xb1, 0x72, 0x0, + 0xe5, 0x11, 0x40, 0x70, 0x7, 0xe6, 0x33, 0x30, + 0x7, 0xee, 0x8, 0x10, 0xf, 0x89, 0xc6, 0xc0, + 0x3f, 0x41, 0x2a, 0x0, + + /* U+4C "L" */ + 0xf, 0xb0, 0xf, 0xff, 0xf8, 0x7, 0xff, 0xa9, + 0x62, 0x3c, 0xc0, 0x1, 0x77, 0xf6, 0x0, + + /* U+4D "M" */ + 0x8f, 0xd0, 0xd, 0x5f, 0x60, 0x2, 0x20, 0x4, + 0xa0, 0x1c, 0xa0, 0x5, 0x0, 0xe2, 0xb0, 0x7, + 0x88, 0x80, 0x24, 0x31, 0x5, 0x60, 0xd, 0xa0, + 0xea, 0x16, 0x1, 0x98, 0xb7, 0xc4, 0xc4, 0x3, + 0x2a, 0x2b, 0x80, 0x7a, 0xc0, 0x1a, 0x1, 0xc2, + 0x62, 0x24, 0x0, 0xf9, 0x98, 0x1, 0xfa, 0x20, + 0x1, 0xff, 0xd6, + + /* U+4E "N" */ + 0x9f, 0x70, 0xc, 0x7f, 0x20, 0x9, 0x0, 0xfe, + 0x17, 0x0, 0xfe, 0x90, 0xf, 0xca, 0x2e, 0x1, + 0xf7, 0xc, 0x80, 0x7c, 0xf0, 0x2c, 0x1, 0xf3, + 0xc, 0x0, 0x7e, 0x81, 0x60, 0xf, 0x98, 0x61, + 0xc0, 0x3e, 0x91, 0xe0, 0xf, 0x9c, 0x54, 0x3, + 0xf4, 0x80, 0x7f, 0x38, 0x80, 0x7f, 0x48, 0x0, + + /* U+4F "O" */ + 0x0, 0x1d, 0xff, 0xac, 0x80, 0x24, 0xc4, 0x33, + 0x26, 0x98, 0x2, 0x87, 0x73, 0x20, 0xd0, 0x61, + 0x92, 0x0, 0x1c, 0xb, 0x60, 0x30, 0x6, 0x60, + 0xc7, 0x11, 0x0, 0x61, 0x13, 0x91, 0x80, 0x78, + 0xcc, 0x2, 0x1, 0xf0, 0x80, 0x80, 0x7c, 0x24, + 0x60, 0x1e, 0x33, 0x38, 0x88, 0x3, 0x8, 0x9f, + 0x1, 0x80, 0x33, 0x6, 0x30, 0xc1, 0x80, 0xa, + 0x45, 0x82, 0x83, 0x2e, 0xda, 0x34, 0x0, 0x4d, + 0x44, 0xd8, 0x80, + + /* U+50 "P" */ + 0x2f, 0xfe, 0xe9, 0x10, 0xc, 0x4e, 0xf2, 0xb7, + 0x90, 0x4, 0xf1, 0x15, 0xc8, 0xc8, 0x7, 0xe6, + 0x24, 0x10, 0xf, 0xce, 0x6, 0x1, 0xf9, 0x80, + 0xc0, 0x3e, 0x53, 0x41, 0x0, 0x3c, 0x45, 0x74, + 0x32, 0x1, 0x13, 0xbc, 0xad, 0xe4, 0x1, 0x2f, + 0xfd, 0xd2, 0x20, 0x1f, 0xfe, 0xd0, + + /* U+51 "Q" */ + 0x0, 0x8e, 0xff, 0xd6, 0x60, 0x1c, 0x98, 0x86, + 0x64, 0xc4, 0x0, 0x86, 0xc7, 0x73, 0x1a, 0x36, + 0x20, 0x6, 0x8, 0x20, 0x1, 0x58, 0x30, 0x2, + 0xc1, 0x80, 0x32, 0x85, 0x80, 0xc, 0x80, 0x3c, + 0x46, 0x1, 0x30, 0x7, 0x98, 0x0, 0x20, 0x1f, + 0xe1, 0x10, 0x7, 0xf8, 0x40, 0xc, 0x1, 0xe6, + 0x0, 0x8c, 0x80, 0x3c, 0x46, 0x0, 0xb0, 0x50, + 0xc, 0xa1, 0x60, 0x6, 0xb, 0x20, 0x1, 0x58, + 0x30, 0x0, 0x6c, 0x76, 0xed, 0xa3, 0x42, 0x1, + 0x26, 0x22, 0x42, 0x1a, 0x1, 0xc7, 0x7f, 0xf1, + 0xbd, 0x0, 0x7e, 0x1c, 0x47, 0x10, 0xf, 0xeb, + 0xd1, + + /* U+52 "R" */ + 0x3f, 0xfe, 0xc6, 0x0, 0xe3, 0x77, 0x31, 0x4d, + 0x0, 0x64, 0x88, 0x4f, 0x1a, 0xa8, 0x3, 0xf7, + 0x87, 0x80, 0x7e, 0x20, 0x10, 0xf, 0xc4, 0x2, + 0x1, 0xfb, 0xc3, 0x80, 0x24, 0x88, 0x4f, 0x1b, + 0x20, 0x4, 0x6e, 0xe6, 0x19, 0x90, 0x6, 0x7f, + 0xf5, 0x7, 0x0, 0x7e, 0x51, 0x71, 0x0, 0xfd, + 0x0, 0xc0, 0x1f, 0x98, 0x64, 0x3, 0xfa, 0x45, + 0xc0, 0x3f, 0x30, 0x48, 0x0, + + /* U+53 "S" */ + 0x0, 0x1d, 0xf7, 0xe2, 0x80, 0x65, 0xc4, 0x55, + 0x15, 0x58, 0x0, 0x68, 0x76, 0xeb, 0x91, 0xe, + 0x8, 0xc, 0x40, 0x14, 0x85, 0x0, 0x42, 0x1, + 0x8a, 0x6c, 0x10, 0x19, 0x40, 0x33, 0x30, 0x6, + 0xc2, 0xb1, 0x84, 0x3, 0x93, 0x50, 0xe7, 0xa0, + 0x3, 0x8a, 0xfa, 0x5, 0xf4, 0x3, 0xc2, 0xfc, + 0xa5, 0x40, 0xac, 0x1, 0xd4, 0xa, 0x1d, 0x28, + 0x1, 0xfb, 0xc2, 0x44, 0x2, 0x70, 0x40, 0x47, + 0x2e, 0xa9, 0xc8, 0x19, 0x0, 0x45, 0xa2, 0x18, + 0x63, 0xc8, 0x0, + + /* U+54 "T" */ + 0x3f, 0xff, 0xf2, 0xb, 0x36, 0x0, 0x33, 0x71, + 0x4c, 0xe2, 0x19, 0x9c, 0x40, 0x1f, 0xff, 0xf0, + 0xf, 0xff, 0xc8, + + /* U+55 "U" */ + 0xaf, 0x10, 0xc, 0x5f, 0x20, 0x1f, 0xfc, 0x73, + 0x0, 0xff, 0xef, 0x18, 0x7, 0xff, 0x3c, 0xc0, + 0x40, 0x30, 0x81, 0xf8, 0x20, 0x6, 0x40, 0xf7, + 0x9, 0x20, 0x1, 0x48, 0x38, 0xd0, 0xed, 0x53, + 0x46, 0x84, 0x17, 0x11, 0x54, 0x98, 0xa0, + + /* U+56 "V" */ + 0x2f, 0xc0, 0xf, 0x6f, 0x89, 0x10, 0xc0, 0x38, + 0x48, 0xc4, 0x10, 0x14, 0x3, 0x38, 0x58, 0x3, + 0x43, 0x0, 0x36, 0x2, 0x0, 0x10, 0x1c, 0x3, + 0x20, 0x98, 0x4, 0xa2, 0x40, 0x3, 0x17, 0x0, + 0xde, 0x8, 0x0, 0xb0, 0xd0, 0xc, 0x81, 0xa0, + 0x4, 0x4, 0x0, 0xc2, 0x68, 0x2, 0x68, 0x1, + 0xeb, 0x4, 0x40, 0x68, 0x7, 0x94, 0x33, 0xc1, + 0xc0, 0x3c, 0x44, 0x54, 0x31, 0x0, 0xf9, 0x8, + 0x50, 0x3, 0xf6, 0x80, 0x2c, 0x3, 0xf2, 0x0, + 0x98, 0x6, + + /* U+57 "W" */ + 0x3f, 0x70, 0x5, 0xf8, 0x0, 0xfd, 0xc8, 0x38, + 0x0, 0xa0, 0x40, 0xc0, 0x42, 0x6, 0x2, 0x20, + 0x70, 0x30, 0x10, 0x16, 0x2, 0x0, 0x68, 0x70, + 0x30, 0x11, 0x1, 0x40, 0xc8, 0x4, 0x8, 0x18, + 0x43, 0xc9, 0x5c, 0x8, 0x40, 0x4, 0x2, 0x4f, + 0xe4, 0xc, 0x40, 0xe, 0x3, 0x52, 0x20, 0x11, + 0xb0, 0x0, 0x81, 0xc7, 0x54, 0x1c, 0x48, 0x0, + 0xe1, 0x80, 0xc2, 0x2c, 0xf, 0x0, 0x10, 0x38, + 0x18, 0x13, 0x81, 0x0, 0x4, 0x4, 0x80, 0xa, + 0x20, 0xc0, 0x11, 0x3, 0x0, 0x38, 0x0, 0x40, + 0x13, 0x1, 0x80, 0xc, 0x0, 0x20, 0x11, 0x7, + 0x0, 0x14, 0x8, 0x0, + + /* U+58 "X" */ + 0xc, 0xf5, 0x0, 0xc3, 0xfe, 0x10, 0xf0, 0x80, + 0xd, 0x61, 0x2, 0x6, 0xa4, 0xc0, 0x2, 0x51, + 0x70, 0xa, 0x2, 0x0, 0x12, 0x16, 0x1, 0x89, + 0xc5, 0xcd, 0xd, 0x40, 0x3a, 0x46, 0x7c, 0x3c, + 0x3, 0xc3, 0x2, 0x68, 0x60, 0x1f, 0x38, 0x3, + 0x80, 0x3f, 0x48, 0x2, 0x40, 0x3e, 0x17, 0x26, + 0x35, 0x0, 0xf5, 0x84, 0x40, 0x20, 0x3, 0x8d, + 0x49, 0x45, 0xc9, 0x80, 0x37, 0x84, 0x80, 0x24, + 0x20, 0x40, 0xa, 0x66, 0x40, 0x0, 0xb8, 0xc8, + 0x2, 0x3, 0xc0, 0x34, 0xb, 0x90, + + /* U+59 "Y" */ + 0x2f, 0xd0, 0xe, 0x1f, 0xe0, 0x24, 0x25, 0x0, + 0xd2, 0x12, 0x0, 0x80, 0x90, 0xc, 0xc0, 0xc0, + 0x3, 0x3c, 0x0, 0x61, 0x71, 0x0, 0xa0, 0x24, + 0x1, 0x61, 0x20, 0x19, 0x9, 0x45, 0x49, 0x84, + 0x3, 0xa0, 0x26, 0x41, 0x60, 0x1e, 0x52, 0x73, + 0x52, 0x0, 0xfa, 0xc0, 0x12, 0x1, 0xf9, 0x80, + 0xcc, 0x1, 0xff, 0xd6, 0x70, 0xf, 0xfe, 0x88, + + /* U+5A "Z" */ + 0xcf, 0xff, 0xc9, 0x6c, 0xde, 0x0, 0x33, 0xcc, + 0xf6, 0x2, 0x90, 0x7, 0xac, 0x2c, 0x3, 0xd0, + 0x30, 0x20, 0x1c, 0x4e, 0x4e, 0x1, 0xe9, 0x9, + 0x0, 0xf2, 0x21, 0x50, 0x3, 0xd2, 0x16, 0x1, + 0xe7, 0x28, 0x10, 0xe, 0x18, 0x27, 0x0, 0xf5, + 0x84, 0x0, 0x79, 0x15, 0x14, 0x3, 0xd0, 0x0, + 0x88, 0xf2, 0x8, 0x23, 0xbf, 0xb0, + + /* U+5B "[" */ + 0x68, 0x88, 0x2d, 0xde, 0x0, 0x17, 0xf8, 0x3, + 0xff, 0xfe, 0x0, 0x28, 0x80, 0x4, 0xee, 0x0, + + /* U+5C "\\" */ + 0x9f, 0x10, 0xe, 0xa0, 0x60, 0xe, 0x32, 0xa0, + 0xf, 0x51, 0x18, 0x7, 0x30, 0x58, 0x7, 0xa, + 0x30, 0x7, 0xb8, 0x50, 0x3, 0x94, 0x78, 0x3, + 0xce, 0xa2, 0x1, 0xd4, 0xe, 0x1, 0xc6, 0x54, + 0x1, 0xea, 0x32, 0x0, 0xe6, 0xa, 0x0, 0xe1, + 0x46, 0x0, 0xf7, 0xa, 0x0, 0x72, 0x87, 0x0, + + /* U+5D "]" */ + 0x8, 0x89, 0x81, 0xde, 0xb0, 0xff, 0x10, 0x7, + 0xff, 0xfc, 0x1, 0x10, 0x20, 0x3, 0xb8, 0x0, + + /* U+5E "^" */ + 0x0, 0xb7, 0x40, 0x1c, 0x64, 0x43, 0x0, 0xd4, + 0x0, 0xa0, 0xc, 0xca, 0xa6, 0x0, 0x98, 0x3b, + 0x80, 0xa0, 0xa, 0x14, 0x40, 0xc8, 0x11, 0xb0, + 0x1, 0x8c, 0xa8, 0x28, 0x1, 0x41, 0x40, + + /* U+5F "_" */ + 0x37, 0x7f, 0xc6, 0x91, 0x1f, 0x90, + + /* U+60 "`" */ + 0x57, 0x30, 0x4a, 0xe0, 0x1f, 0x39, + + /* U+61 "a" */ + 0x0, 0x26, 0x7f, 0x62, 0x80, 0x4d, 0x62, 0xee, + 0x3a, 0x60, 0x19, 0x2d, 0x89, 0xd0, 0x90, 0x4, + 0x48, 0x4, 0x48, 0x4, 0x2e, 0x80, 0x18, 0x40, + 0x21, 0x9d, 0xff, 0x94, 0x2, 0xc6, 0x4a, 0xbc, + 0x40, 0x3, 0x14, 0x4a, 0xa1, 0x88, 0x7, 0xe1, + 0x70, 0x3, 0x8c, 0x4b, 0xcf, 0x90, 0x8, 0xb1, + 0x5e, 0x16, 0x1c, 0x14, + + /* U+62 "b" */ + 0x4f, 0x80, 0xf, 0xfe, 0xe3, 0xef, 0xeb, 0x0, + 0x67, 0x87, 0x53, 0x97, 0x0, 0x87, 0x6a, 0x98, + 0x30, 0x20, 0x6, 0x20, 0x1, 0x48, 0x38, 0x7, + 0xc8, 0x1e, 0x1, 0xf0, 0x81, 0x80, 0x7c, 0x20, + 0x60, 0x1f, 0x28, 0x78, 0x1, 0x40, 0x35, 0x83, + 0x80, 0xb, 0x5d, 0xb0, 0xa0, 0x40, 0x10, 0xb3, + 0x21, 0x97, 0x0, + + /* U+63 "c" */ + 0x0, 0x1d, 0xf7, 0xea, 0x80, 0x49, 0x88, 0xec, + 0x15, 0x20, 0xa, 0xc, 0x99, 0x6a, 0x31, 0xa8, + 0xb9, 0x80, 0x5e, 0x4b, 0xa1, 0x80, 0x19, 0x35, + 0x84, 0x1c, 0x3, 0xe1, 0x7, 0x0, 0xfb, 0x43, + 0x0, 0x31, 0x42, 0x28, 0xb9, 0x0, 0x50, 0xee, + 0xa, 0xd, 0x98, 0xd5, 0x73, 0x4, 0xc4, 0x77, + 0xd, 0xc0, 0x0, + + /* U+64 "d" */ + 0x0, 0xfa, 0x3d, 0x0, 0x3f, 0xfa, 0x8b, 0xbf, + 0xce, 0x1, 0x9a, 0x89, 0x52, 0x1c, 0x0, 0x32, + 0x3b, 0x54, 0xd1, 0x0, 0x38, 0x31, 0x0, 0x9, + 0x80, 0x1e, 0x18, 0x1, 0xf1, 0x83, 0x80, 0x7c, + 0x60, 0xe0, 0x1f, 0x78, 0x60, 0x7, 0xce, 0xc, + 0x40, 0x1, 0x50, 0x0, 0xc8, 0xed, 0x53, 0xc8, + 0x2, 0x6a, 0x25, 0x46, 0x80, 0x0, + + /* U+65 "e" */ + 0x0, 0x15, 0x77, 0xe2, 0x80, 0x47, 0xaa, 0x8e, + 0x55, 0x0, 0xd, 0x1d, 0xa8, 0xe3, 0x72, 0x61, + 0x92, 0x0, 0xa4, 0x17, 0xc3, 0x26, 0x77, 0x87, + 0x18, 0x23, 0x36, 0x50, 0x30, 0x6, 0x7f, 0xfa, + 0xb4, 0x2c, 0x3, 0xe6, 0x7, 0x40, 0x8, 0xac, + 0x86, 0xc2, 0xea, 0x2b, 0x54, 0xc1, 0x35, 0x51, + 0xde, 0xf1, + + /* U+66 "f" */ + 0x0, 0xe2, 0x68, 0x74, 0x0, 0xe7, 0xd9, 0x78, + 0xb0, 0xc, 0x70, 0x57, 0xfe, 0xd0, 0xd, 0x61, + 0x8, 0x0, 0x20, 0xc, 0x20, 0xc0, 0x1d, 0x1f, + 0xe6, 0xc, 0xff, 0x90, 0x2e, 0x64, 0x60, 0xf3, + 0x32, 0x81, 0xb3, 0x14, 0x2d, 0x9a, 0x10, 0xf, + 0xff, 0xf8, 0x7, 0xff, 0x8, + + /* U+67 "g" */ + 0x0, 0x36, 0xff, 0x43, 0xfa, 0x3, 0xc8, 0x44, + 0xa4, 0x0, 0x6, 0x7, 0x1d, 0xd8, 0x60, 0x7, + 0x9, 0x10, 0x9, 0x0, 0x1e, 0x6, 0x1, 0xfc, + 0xe0, 0x1f, 0xce, 0x1, 0xf7, 0x86, 0x0, 0x7c, + 0xe0, 0xc4, 0x0, 0x16, 0x0, 0xc, 0x8e, 0xd5, + 0x3c, 0x40, 0x26, 0xa2, 0x57, 0x67, 0x0, 0xcb, + 0xbf, 0xb0, 0x40, 0xc1, 0xa, 0x1, 0x12, 0x91, + 0x0, 0xea, 0xe2, 0xb4, 0x24, 0x1, 0x72, 0xee, + 0x54, 0xc4, 0x0, + + /* U+68 "h" */ + 0x4f, 0x70, 0xf, 0xfe, 0xe1, 0xdf, 0xf4, 0x88, + 0x5, 0x78, 0xc, 0x6d, 0xa0, 0x11, 0x6d, 0xce, + 0x91, 0x98, 0x0, 0xc4, 0x1, 0x50, 0x28, 0x3, + 0xc0, 0x30, 0x80, 0x7f, 0x18, 0x7, 0xff, 0xa0, + + /* U+69 "i" */ + 0x0, 0xcd, 0xe8, 0x1, 0xf7, 0x1, 0x0, 0x7d, + 0x1c, 0xc0, 0x1f, 0x84, 0x3, 0xbf, 0xf9, 0x80, + 0x33, 0x34, 0x60, 0x1e, 0x99, 0xa8, 0x3, 0xff, + 0xed, 0x33, 0x50, 0x54, 0xc9, 0xc1, 0x9a, 0x30, + 0x36, 0x65, 0x0, + + /* U+6A "j" */ + 0x0, 0xd3, 0xc4, 0x1, 0x8c, 0x44, 0x1, 0xab, + 0x8c, 0x3, 0x84, 0x7, 0xff, 0x8c, 0x59, 0xa2, + 0x0, 0xa6, 0x65, 0x0, 0xff, 0xf9, 0x10, 0x7, + 0xa, 0x81, 0xc4, 0x27, 0xc2, 0x1, 0x5d, 0x8a, + 0x9c, 0x0, + + /* U+6B "k" */ + 0x4f, 0x80, 0xf, 0xff, 0x1a, 0xfe, 0x88, 0x7, + 0x92, 0x8b, 0x4, 0x3, 0x92, 0xc7, 0xc4, 0x3, + 0x8e, 0xc7, 0x8, 0x3, 0x8b, 0x42, 0xc8, 0x3, + 0xca, 0x21, 0x20, 0x1f, 0xad, 0x4e, 0x40, 0x3c, + 0xe9, 0x64, 0xca, 0x1, 0xf0, 0xf0, 0x51, 0x0, + 0x7c, 0x72, 0x1e, 0x1, 0xf9, 0x94, 0xa8, 0x0, + + /* U+6C "l" */ + 0xf, 0xfe, 0x60, 0xc, 0xcd, 0x18, 0x7, 0xa6, + 0x6a, 0x0, 0xff, 0xff, 0x80, 0x7f, 0xf4, 0xe6, + 0x6a, 0xa, 0x99, 0x38, 0x33, 0x46, 0x6, 0xcc, + 0xa0, + + /* U+6D "m" */ + 0x1f, 0x9b, 0xfd, 0x5b, 0xfd, 0x30, 0x9, 0xb1, + 0xca, 0x8a, 0xb, 0x80, 0x25, 0x78, 0x11, 0x4b, + 0xa9, 0x0, 0x46, 0x0, 0x33, 0x0, 0xc, 0x4, + 0x3, 0xff, 0xfe, 0x1, 0xfc, + + /* U+6E "n" */ + 0x4f, 0x54, 0xcf, 0xd9, 0x10, 0xb, 0xad, 0x98, + 0xd, 0xa0, 0x12, 0xed, 0x4e, 0x99, 0x88, 0x0, + 0xc4, 0x1, 0x58, 0x38, 0x3, 0xc0, 0x30, 0x81, + 0x80, 0x7f, 0xfc, 0x0, + + /* U+6F "o" */ + 0x0, 0x25, 0xff, 0xad, 0x0, 0x26, 0xb5, 0x66, + 0x2d, 0xb0, 0x14, 0x97, 0xcc, 0xbc, 0xa4, 0xa8, + 0x2c, 0x40, 0x3, 0x61, 0x46, 0xe, 0x1, 0x90, + 0xd, 0xc0, 0x40, 0x31, 0x3, 0xb8, 0x4, 0x3, + 0x8, 0x39, 0x82, 0x0, 0x64, 0x3, 0xa0, 0x81, + 0x0, 0xc, 0x5, 0x14, 0x97, 0xcc, 0xbc, 0xa4, + 0x81, 0xac, 0x99, 0x85, 0x6c, 0x0, + + /* U+70 "p" */ + 0x4f, 0x67, 0xdf, 0xd6, 0x0, 0xd1, 0x2e, 0xa5, + 0x2e, 0x1, 0x1f, 0xd5, 0x30, 0x20, 0x40, 0xa, + 0x20, 0x3, 0x70, 0x70, 0x7, 0x80, 0x6c, 0xe, + 0x0, 0xf9, 0xc0, 0x40, 0x3e, 0x70, 0x10, 0xf, + 0xb0, 0x34, 0x1, 0x60, 0x11, 0x30, 0x20, 0x0, + 0xf6, 0x65, 0xa3, 0x2, 0x0, 0x75, 0x76, 0x29, + 0x70, 0xb, 0xe3, 0xbf, 0x58, 0x3, 0xff, 0xa8, + + /* U+71 "q" */ + 0x0, 0x2e, 0xff, 0x4c, 0x7a, 0x3, 0xd0, 0x4c, + 0x2b, 0x80, 0x6, 0x7, 0x19, 0x98, 0x80, 0x7, + 0x9, 0x10, 0x8, 0xc0, 0x1e, 0x6, 0x1, 0xfc, + 0xe0, 0x1f, 0xce, 0x1, 0xf7, 0x86, 0x0, 0x7c, + 0xe0, 0xc4, 0x0, 0x15, 0x0, 0xc, 0xe, 0x4c, + 0xbc, 0x80, 0x27, 0xa3, 0x67, 0x67, 0x0, 0xcb, + 0xbf, 0xd0, 0x1, 0xff, 0xd5, + + /* U+72 "r" */ + 0xcf, 0x6, 0xdf, 0xe5, 0x0, 0x4c, 0x88, 0x82, + 0x20, 0x3, 0xdf, 0xef, 0xa0, 0x2, 0xd0, 0x3, + 0xca, 0x1, 0xff, 0xe9, + + /* U+73 "s" */ + 0x0, 0x1d, 0xf7, 0xeb, 0x80, 0x49, 0x8a, 0xec, + 0x11, 0x60, 0x9, 0xf, 0x99, 0x6a, 0x24, 0x1, + 0x8, 0x5, 0x34, 0xc1, 0x61, 0xce, 0x60, 0x4a, + 0x40, 0xd6, 0xb1, 0x9f, 0x44, 0x1, 0x25, 0xfd, + 0xb2, 0xe0, 0x93, 0xa0, 0x1, 0x26, 0x42, 0xc7, + 0x12, 0x20, 0x10, 0x80, 0x8a, 0xb, 0xe6, 0x2e, + 0x9, 0x81, 0xe9, 0x59, 0xd9, 0xf0, 0x0, + + /* U+74 "t" */ + 0x0, 0x99, 0xc0, 0x3f, 0x5c, 0x0, 0x7f, 0xf0, + 0xe7, 0xfc, 0x41, 0xff, 0x83, 0x66, 0x42, 0x13, + 0x38, 0x11, 0x98, 0x60, 0xcd, 0x80, 0x3f, 0xfd, + 0x4c, 0x8, 0x1, 0xf7, 0x5, 0xd4, 0xd9, 0x80, + 0x4b, 0x44, 0xac, 0xe0, + + /* U+75 "u" */ + 0x3f, 0x80, 0xd, 0x1e, 0x80, 0x1f, 0xfe, 0x81, + 0x0, 0xf8, 0x40, 0x3f, 0x88, 0x1c, 0x3, 0x28, + 0x4, 0xe3, 0x6c, 0xfa, 0x60, 0x14, 0x41, 0x66, + 0xae, 0x0, 0x0, + + /* U+76 "v" */ + 0xd, 0xf0, 0xe, 0x1f, 0xc0, 0xa0, 0x50, 0xc, + 0xe1, 0x40, 0xc1, 0xc0, 0x1a, 0x81, 0x80, 0x55, + 0x4, 0x0, 0x26, 0xc0, 0x17, 0x3, 0x0, 0x18, + 0x28, 0x2, 0x42, 0xa0, 0x5, 0x11, 0x80, 0x6a, + 0x22, 0xd4, 0x1, 0xcc, 0x15, 0x40, 0x60, 0xe, + 0x14, 0x65, 0x50, 0x80, 0x7b, 0xc4, 0xb8, 0x3, + 0xe4, 0x11, 0x20, 0x4, + + /* U+77 "w" */ + 0x6f, 0x20, 0x5, 0x58, 0x5, 0xf0, 0xa0, 0xe0, + 0x4, 0x40, 0x0, 0xc3, 0x4c, 0x34, 0x8, 0x40, + 0xc1, 0x41, 0x0, 0x88, 0xe, 0x24, 0x81, 0xc2, + 0x20, 0x47, 0xc, 0x57, 0xc0, 0x35, 0x0, 0x79, + 0x2, 0x66, 0x14, 0x14, 0xc0, 0xa, 0x8, 0x48, + 0x81, 0x31, 0xc0, 0x1, 0x87, 0x1, 0x90, 0xd0, + 0x28, 0x4, 0x6a, 0x80, 0x4, 0x71, 0x10, 0x4, + 0xa1, 0x80, 0xc, 0x15, 0x0, 0xde, 0x6, 0x0, + 0x40, 0xc0, 0x0, + + /* U+78 "x" */ + 0x7f, 0x90, 0xc, 0xff, 0x40, 0xe8, 0xca, 0x0, + 0x38, 0x2a, 0x0, 0x50, 0xd8, 0x87, 0x7, 0x0, + 0x43, 0x43, 0x52, 0x50, 0x60, 0x19, 0x1d, 0x19, + 0x1c, 0x3, 0xd2, 0x0, 0xf0, 0xf, 0xac, 0x1, + 0x20, 0x1e, 0x65, 0x54, 0x94, 0x80, 0x62, 0x91, + 0xa6, 0x46, 0x40, 0xb, 0x83, 0x40, 0x14, 0x34, + 0x21, 0x6, 0xe6, 0x0, 0x1b, 0x1a, 0x0, + + /* U+79 "y" */ + 0x1f, 0xe0, 0xf, 0x77, 0x88, 0x94, 0x54, 0x3, + 0x28, 0xa8, 0x84, 0x87, 0x0, 0x6e, 0x9, 0x0, + 0x19, 0x90, 0x80, 0x2, 0x86, 0x60, 0xa, 0x42, + 0xc0, 0xc, 0x12, 0x1, 0x94, 0x98, 0x1, 0x22, + 0xa0, 0x1d, 0x60, 0xc8, 0x32, 0x1, 0xe6, 0x1b, + 0xe0, 0x60, 0xf, 0x98, 0x95, 0x84, 0x3, 0xe9, + 0x0, 0x58, 0x7, 0xe1, 0x12, 0x10, 0x7, 0xe7, + 0x1f, 0x0, 0xfc, 0x50, 0x48, 0x1, 0xe3, 0xac, + 0xe, 0x0, 0xf9, 0x54, 0x76, 0x60, 0x1e, + + /* U+7A "z" */ + 0x5f, 0xff, 0xc6, 0xef, 0xe5, 0x0, 0x11, 0x22, + 0x39, 0xc2, 0x84, 0x3, 0xa8, 0x9d, 0x40, 0x39, + 0x94, 0xe0, 0x3, 0x8e, 0x47, 0x40, 0x38, 0x74, + 0x34, 0x40, 0x3a, 0x86, 0x4c, 0x3, 0xa1, 0x15, + 0x80, 0x39, 0x1c, 0x9, 0xdf, 0x90, 0x80, 0xf, + 0x11, 0xda, + + /* U+7B "{" */ + 0x0, 0xc9, 0x92, 0x1, 0x1d, 0xb5, 0x80, 0x50, + 0x14, 0x40, 0x12, 0x20, 0x3, 0x8, 0x7, 0xe1, + 0x0, 0xc6, 0x1, 0xe4, 0xd, 0x0, 0x13, 0x41, + 0x30, 0x3, 0xe4, 0xf0, 0x40, 0x12, 0xc5, 0x40, + 0x12, 0x4c, 0x22, 0x80, 0x64, 0xc, 0x0, 0xc4, + 0x6, 0x1, 0xe1, 0x0, 0xc2, 0xe, 0x1, 0xc6, + 0x60, 0xe, 0x80, 0x90, 0xc, 0x94, 0xd4, 0x1, + 0x97, 0xec, + + /* U+7C "|" */ + 0xbb, 0x0, 0x7f, 0xf6, 0x0, + + /* U+7D "}" */ + 0xac, 0x30, 0xd, 0xf, 0x86, 0x1, 0x15, 0x4, + 0x80, 0x61, 0x24, 0x0, 0xe1, 0x10, 0x7, 0xff, + 0x1, 0xc0, 0x40, 0x31, 0x82, 0x80, 0x69, 0x1a, + 0x52, 0x0, 0xe, 0x5, 0x48, 0x5, 0xc2, 0xfe, + 0x0, 0x73, 0x98, 0x40, 0x6, 0x3, 0x80, 0x67, + 0x1, 0x0, 0xff, 0x84, 0x40, 0x18, 0x49, 0x40, + 0x35, 0x4, 0x0, 0x58, 0xb6, 0x60, 0x16, 0xf2, + 0x0, 0x60, + + /* U+7E "~" */ + 0x3, 0xdf, 0xd5, 0x0, 0xcc, 0x63, 0xa6, 0xa7, + 0x52, 0x0, 0x29, 0x57, 0x1f, 0xae, 0x56, 0xea, + 0xc1, 0x64, 0xa1, 0x0, 0x54, 0x9a, 0x96, 0x0 +}; + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 192, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 0, .adv_w = 192, .box_w = 3, .box_h = 15, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 13, .adv_w = 192, .box_w = 6, .box_h = 5, .ofs_x = 3, .ofs_y = 10}, + {.bitmap_index = 26, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 110, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 193, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 269, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 346, .adv_w = 192, .box_w = 3, .box_h = 5, .ofs_x = 4, .ofs_y = 10}, + {.bitmap_index = 353, .adv_w = 192, .box_w = 6, .box_h = 22, .ofs_x = 3, .ofs_y = -5}, + {.bitmap_index = 413, .adv_w = 192, .box_w = 6, .box_h = 22, .ofs_x = 3, .ofs_y = -5}, + {.bitmap_index = 472, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 5}, + {.bitmap_index = 518, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 1}, + {.bitmap_index = 543, .adv_w = 192, .box_w = 4, .box_h = 6, .ofs_x = 3, .ofs_y = -4}, + {.bitmap_index = 555, .adv_w = 192, .box_w = 8, .box_h = 2, .ofs_x = 2, .ofs_y = 6}, + {.bitmap_index = 561, .adv_w = 192, .box_w = 4, .box_h = 3, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 567, .adv_w = 192, .box_w = 9, .box_h = 16, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 617, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 689, .adv_w = 192, .box_w = 6, .box_h = 15, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 708, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 774, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 841, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 893, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 957, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1027, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1078, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1150, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1220, .adv_w = 192, .box_w = 4, .box_h = 11, .ofs_x = 5, .ofs_y = 0}, + {.bitmap_index = 1237, .adv_w = 192, .box_w = 5, .box_h = 15, .ofs_x = 4, .ofs_y = -4}, + {.bitmap_index = 1265, .adv_w = 192, .box_w = 9, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, + {.bitmap_index = 1305, .adv_w = 192, .box_w = 10, .box_h = 6, .ofs_x = 1, .ofs_y = 4}, + {.bitmap_index = 1322, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, + {.bitmap_index = 1365, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1424, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1513, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1585, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1648, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1707, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1765, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1798, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1825, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1895, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1915, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1941, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1975, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2035, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2050, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2101, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2149, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2216, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2262, .adv_w = 192, .box_w = 12, .box_h = 18, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2351, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2412, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2487, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2506, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2545, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2619, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2711, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2789, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2845, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2899, .adv_w = 192, .box_w = 5, .box_h = 20, .ofs_x = 4, .ofs_y = -3}, + {.bitmap_index = 2915, .adv_w = 192, .box_w = 8, .box_h = 16, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 2963, .adv_w = 192, .box_w = 5, .box_h = 20, .ofs_x = 3, .ofs_y = -3}, + {.bitmap_index = 2979, .adv_w = 192, .box_w = 8, .box_h = 8, .ofs_x = 2, .ofs_y = 7}, + {.bitmap_index = 3010, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 3016, .adv_w = 192, .box_w = 4, .box_h = 3, .ofs_x = 4, .ofs_y = 12}, + {.bitmap_index = 3022, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3074, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3125, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3176, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3230, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3280, .adv_w = 192, .box_w = 11, .box_h = 16, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3325, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 3392, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3424, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3459, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -4}, + {.bitmap_index = 3493, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3541, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3566, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3595, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3623, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3677, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 3733, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 3786, .adv_w = 192, .box_w = 8, .box_h = 11, .ofs_x = 3, .ofs_y = 0}, + {.bitmap_index = 3806, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3861, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3897, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 3924, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3976, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4043, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 4098, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = -4}, + {.bitmap_index = 4169, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 4211, .adv_w = 192, .box_w = 7, .box_h = 20, .ofs_x = 3, .ofs_y = -4}, + {.bitmap_index = 4269, .adv_w = 192, .box_w = 2, .box_h = 19, .ofs_x = 5, .ofs_y = -4}, + {.bitmap_index = 4274, .adv_w = 192, .box_w = 7, .box_h = 20, .ofs_x = 3, .ofs_y = -4}, + {.bitmap_index = 4332, .adv_w = 192, .box_w = 12, .box_h = 4, .ofs_x = 0, .ofs_y = 4} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 32, .range_length = 95, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_dsc_t font_dsc = { + .glyph_bitmap = gylph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 1 +}; + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +lv_font_t font_3 = { + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 22, /*The maximum line height required by the font*/ + .base_line = 5, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + +#endif /*#if FONT_3*/ +#endif diff --git a/lib/lvgl/tests/src/test_fonts/font_3.fnt b/lib/lvgl/tests/src/test_fonts/font_3.fnt new file mode 100644 index 00000000..43c074d7 Binary files /dev/null and b/lib/lvgl/tests/src/test_fonts/font_3.fnt differ diff --git a/lib/lvgl/tests/unity/generate_test_runner.rb b/lib/lvgl/tests/unity/generate_test_runner.rb new file mode 100644 index 00000000..d1d8f91a --- /dev/null +++ b/lib/lvgl/tests/unity/generate_test_runner.rb @@ -0,0 +1,511 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + +class UnityTestRunnerGenerator + def initialize(options = nil) + @options = UnityTestRunnerGenerator.default_options + case options + when NilClass + @options + when String + @options.merge!(UnityTestRunnerGenerator.grab_config(options)) + when Hash + # Check if some of these have been specified + @options[:has_setup] = !options[:setup_name].nil? + @options[:has_teardown] = !options[:teardown_name].nil? + @options[:has_suite_setup] = !options[:suite_setup].nil? + @options[:has_suite_teardown] = !options[:suite_teardown].nil? + @options.merge!(options) + else + raise 'If you specify arguments, it should be a filename or a hash of options' + end + require_relative 'type_sanitizer' + end + + def self.default_options + { + includes: [], + defines: [], + plugins: [], + framework: :unity, + test_prefix: 'test|spec|should', + mock_prefix: 'Mock', + mock_suffix: '', + setup_name: 'setUp', + teardown_name: 'tearDown', + test_reset_name: 'resetTest', + test_verify_name: 'verifyTest', + main_name: 'main', # set to :auto to automatically generate each time + main_export_decl: '', + cmdline_args: false, + omit_begin_end: false, + use_param_tests: false, + include_extensions: '(?:hpp|hh|H|h)', + source_extensions: '(?:cpp|cc|ino|C|c)' + } + end + + def self.grab_config(config_file) + options = default_options + unless config_file.nil? || config_file.empty? + require 'yaml' + yaml_guts = YAML.load_file(config_file) + options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) + raise "No :unity or :cmock section found in #{config_file}" unless options + end + options + end + + def run(input_file, output_file, options = nil) + @options.merge!(options) unless options.nil? + + # pull required data from source file + source = File.read(input_file) + source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil) + tests = find_tests(source) + headers = find_includes(source) + testfile_includes = (headers[:local] + headers[:system]) + used_mocks = find_mocks(testfile_includes) + testfile_includes = (testfile_includes - used_mocks) + testfile_includes.delete_if { |inc| inc =~ /(unity|cmock)/ } + find_setup_and_teardown(source) + + # build runner file + generate(input_file, output_file, tests, used_mocks, testfile_includes) + + # determine which files were used to return them + all_files_used = [input_file, output_file] + all_files_used += testfile_includes.map { |filename| filename + '.c' } unless testfile_includes.empty? + all_files_used += @options[:includes] unless @options[:includes].empty? + all_files_used += headers[:linkonly] unless headers[:linkonly].empty? + all_files_used.uniq + end + + def generate(input_file, output_file, tests, used_mocks, testfile_includes) + File.open(output_file, 'w') do |output| + create_header(output, used_mocks, testfile_includes) + create_externs(output, tests, used_mocks) + create_mock_management(output, used_mocks) + create_setup(output) + create_teardown(output) + create_suite_setup(output) + create_suite_teardown(output) + create_reset(output) + create_run_test(output) unless tests.empty? + create_args_wrappers(output, tests) + create_main(output, input_file, tests, used_mocks) + end + + return unless @options[:header_file] && !@options[:header_file].empty? + + File.open(@options[:header_file], 'w') do |output| + create_h_file(output, @options[:header_file], tests, testfile_includes, used_mocks) + end + end + + def find_tests(source) + tests_and_line_numbers = [] + + # contains characters which will be substituted from within strings, doing + # this prevents these characters from interfering with scrubbers + # @ is not a valid C character, so there should be no clashes with files genuinely containing these markers + substring_subs = { '{' => '@co@', '}' => '@cc@', ';' => '@ss@', '/' => '@fs@' } + substring_re = Regexp.union(substring_subs.keys) + substring_unsubs = substring_subs.invert # the inverse map will be used to fix the strings afterwords + substring_unsubs['@quote@'] = '\\"' + substring_unsubs['@apos@'] = '\\\'' + substring_unre = Regexp.union(substring_unsubs.keys) + source_scrubbed = source.clone + source_scrubbed = source_scrubbed.gsub(/\\"/, '@quote@') # hide escaped quotes to allow capture of the full string/char + source_scrubbed = source_scrubbed.gsub(/\\'/, '@apos@') # hide escaped apostrophes to allow capture of the full string/char + source_scrubbed = source_scrubbed.gsub(/("[^"\n]*")|('[^'\n]*')/) { |s| s.gsub(substring_re, substring_subs) } # temporarily hide problematic characters within strings + source_scrubbed = source_scrubbed.gsub(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks + source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments + source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments (all that remain) + lines = source_scrubbed.split(/(^\s*\#.*$) | (;|\{|\}) /x) # Treat preprocessor directives as a logical line. Match ;, {, and } as end of lines + .map { |line| line.gsub(substring_unre, substring_unsubs) } # unhide the problematic characters previously removed + + lines.each_with_index do |line, _index| + # find tests + next unless line =~ /^((?:\s*(?:TEST_CASE|TEST_RANGE)\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/m + + arguments = Regexp.last_match(1) + name = Regexp.last_match(2) + call = Regexp.last_match(3) + params = Regexp.last_match(4) + args = nil + + if @options[:use_param_tests] && !arguments.empty? + args = [] + arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) { |a| args << a[0] } + + arguments.scan(/\s*TEST_RANGE\s*\((.*)\)\s*$/).flatten.each do |range_str| + args += range_str.scan(/\[\s*(-?\d+.?\d*),\s*(-?\d+.?\d*),\s*(-?\d+.?\d*)\s*\]/).map do |arg_values_str| + arg_values_str.map do |arg_value_str| + arg_value_str.include?('.') ? arg_value_str.to_f : arg_value_str.to_i + end + end.map do |arg_values| + (arg_values[0]..arg_values[1]).step(arg_values[2]).to_a + end.reduce do |result, arg_range_expanded| + result.product(arg_range_expanded) + end.map do |arg_combinations| + arg_combinations.flatten.join(', ') + end + end + end + + tests_and_line_numbers << { test: name, args: args, call: call, params: params, line_number: 0 } + end + + tests_and_line_numbers.uniq! { |v| v[:test] } + + # determine line numbers and create tests to run + source_lines = source.split("\n") + source_index = 0 + tests_and_line_numbers.size.times do |i| + source_lines[source_index..-1].each_with_index do |line, index| + next unless line =~ /\s+#{tests_and_line_numbers[i][:test]}(?:\s|\()/ + + source_index += index + tests_and_line_numbers[i][:line_number] = source_index + 1 + break + end + end + + tests_and_line_numbers + end + + def find_includes(source) + # remove comments (block and line, in three steps to ensure correct precedence) + source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks + source.gsub!(/\/\*.*?\*\//m, '') # remove block comments + source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain) + + # parse out includes + includes = { + local: source.scan(/^\s*#include\s+\"\s*(.+\.#{@options[:include_extensions]})\s*\"/).flatten, + system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" }, + linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+\.#{@options[:source_extensions]})\s*\"/).flatten + } + includes + end + + def find_mocks(includes) + mock_headers = [] + includes.each do |include_path| + include_file = File.basename(include_path) + mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}.*#{@options[:mock_suffix]}\.h$/i + end + mock_headers + end + + def find_setup_and_teardown(source) + @options[:has_setup] = source =~ /void\s+#{@options[:setup_name]}\s*\(/ + @options[:has_teardown] = source =~ /void\s+#{@options[:teardown_name]}\s*\(/ + @options[:has_suite_setup] ||= (source =~ /void\s+suiteSetUp\s*\(/) + @options[:has_suite_teardown] ||= (source =~ /int\s+suiteTearDown\s*\(int\s+([a-zA-Z0-9_])+\s*\)/) + end + + def create_header(output, mocks, testfile_includes = []) + output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') + output.puts("\n/*=======Automagically Detected Files To Include=====*/") + output.puts("#include \"#{@options[:framework]}.h\"") + output.puts('#include "cmock.h"') unless mocks.empty? + if @options[:defines] && !@options[:defines].empty? + @options[:defines].each { |d| output.puts("#ifndef #{d}\n#define #{d}\n#endif /* #{d} */") } + end + if @options[:header_file] && !@options[:header_file].empty? + output.puts("#include \"#{File.basename(@options[:header_file])}\"") + else + @options[:includes].flatten.uniq.compact.each do |inc| + output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") + end + testfile_includes.each do |inc| + output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") + end + end + mocks.each do |mock| + output.puts("#include \"#{mock}\"") + end + output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) + + return unless @options[:enforce_strict_ordering] + + output.puts('') + output.puts('int GlobalExpectCount;') + output.puts('int GlobalVerifyOrder;') + output.puts('char* GlobalOrderError;') + end + + def create_externs(output, tests, _mocks) + output.puts("\n/*=======External Functions This Runner Calls=====*/") + output.puts("extern void #{@options[:setup_name]}(void);") + output.puts("extern void #{@options[:teardown_name]}(void);") + output.puts("\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif") if @options[:externc] + tests.each do |test| + output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});") + end + output.puts("#ifdef __cplusplus\n}\n#endif") if @options[:externc] + output.puts('') + end + + def create_mock_management(output, mock_headers) + output.puts("\n/*=======Mock Management=====*/") + output.puts('static void CMock_Init(void)') + output.puts('{') + + if @options[:enforce_strict_ordering] + output.puts(' GlobalExpectCount = 0;') + output.puts(' GlobalVerifyOrder = 0;') + output.puts(' GlobalOrderError = NULL;') + end + + mocks = mock_headers.map { |mock| File.basename(mock, '.*') } + mocks.each do |mock| + mock_clean = TypeSanitizer.sanitize_c_identifier(mock) + output.puts(" #{mock_clean}_Init();") + end + output.puts("}\n") + + output.puts('static void CMock_Verify(void)') + output.puts('{') + mocks.each do |mock| + mock_clean = TypeSanitizer.sanitize_c_identifier(mock) + output.puts(" #{mock_clean}_Verify();") + end + output.puts("}\n") + + output.puts('static void CMock_Destroy(void)') + output.puts('{') + mocks.each do |mock| + mock_clean = TypeSanitizer.sanitize_c_identifier(mock) + output.puts(" #{mock_clean}_Destroy();") + end + output.puts("}\n") + end + + def create_setup(output) + return if @options[:has_setup] + + output.puts("\n/*=======Setup (stub)=====*/") + output.puts("void #{@options[:setup_name]}(void) {}") + end + + def create_teardown(output) + return if @options[:has_teardown] + + output.puts("\n/*=======Teardown (stub)=====*/") + output.puts("void #{@options[:teardown_name]}(void) {}") + end + + def create_suite_setup(output) + return if @options[:suite_setup].nil? + + output.puts("\n/*=======Suite Setup=====*/") + output.puts('void suiteSetUp(void)') + output.puts('{') + output.puts(@options[:suite_setup]) + output.puts('}') + end + + def create_suite_teardown(output) + return if @options[:suite_teardown].nil? + + output.puts("\n/*=======Suite Teardown=====*/") + output.puts('int suiteTearDown(int num_failures)') + output.puts('{') + output.puts(@options[:suite_teardown]) + output.puts('}') + end + + def create_reset(output) + output.puts("\n/*=======Test Reset Options=====*/") + output.puts("void #{@options[:test_reset_name]}(void);") + output.puts("void #{@options[:test_reset_name]}(void)") + output.puts('{') + output.puts(" #{@options[:teardown_name]}();") + output.puts(' CMock_Verify();') + output.puts(' CMock_Destroy();') + output.puts(' CMock_Init();') + output.puts(" #{@options[:setup_name]}();") + output.puts('}') + output.puts("void #{@options[:test_verify_name]}(void);") + output.puts("void #{@options[:test_verify_name]}(void)") + output.puts('{') + output.puts(' CMock_Verify();') + output.puts('}') + end + + def create_run_test(output) + require 'erb' + template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')), nil, '<>') + output.puts("\n" + template.result(binding)) + end + + def create_args_wrappers(output, tests) + return unless @options[:use_param_tests] + + output.puts("\n/*=======Parameterized Test Wrappers=====*/") + tests.each do |test| + next if test[:args].nil? || test[:args].empty? + + test[:args].each.with_index(1) do |args, idx| + output.puts("static void runner_args#{idx}_#{test[:test]}(void)") + output.puts('{') + output.puts(" #{test[:test]}(#{args});") + output.puts("}\n") + end + end + end + + def create_main(output, filename, tests, used_mocks) + output.puts("\n/*=======MAIN=====*/") + main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s + if @options[:cmdline_args] + if main_name != 'main' + output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);") + end + output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)") + output.puts('{') + output.puts(' int parse_status = UnityParseOptions(argc, argv);') + output.puts(' if (parse_status != 0)') + output.puts(' {') + output.puts(' if (parse_status < 0)') + output.puts(' {') + output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");") + output.puts(' UNITY_PRINT_EOL();') + tests.each do |test| + if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? + output.puts(" UnityPrint(\" #{test[:test]}\");") + output.puts(' UNITY_PRINT_EOL();') + else + test[:args].each do |args| + output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");") + output.puts(' UNITY_PRINT_EOL();') + end + end + end + output.puts(' return 0;') + output.puts(' }') + output.puts(' return parse_status;') + output.puts(' }') + else + main_return = @options[:omit_begin_end] ? 'void' : 'int' + if main_name != 'main' + output.puts("#{@options[:main_export_decl]} #{main_return} #{main_name}(void);") + end + output.puts("#{main_return} #{main_name}(void)") + output.puts('{') + end + output.puts(' suiteSetUp();') if @options[:has_suite_setup] + if @options[:omit_begin_end] + output.puts(" UnitySetTestFile(\"#{filename.gsub(/\\/, '\\\\\\')}\");") + else + output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");") + end + tests.each do |test| + if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? + output.puts(" run_test(#{test[:test]}, \"#{test[:test]}\", #{test[:line_number]});") + else + test[:args].each.with_index(1) do |args, idx| + wrapper = "runner_args#{idx}_#{test[:test]}" + testname = "#{test[:test]}(#{args})".dump + output.puts(" run_test(#{wrapper}, #{testname}, #{test[:line_number]});") + end + end + end + output.puts + output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty? + if @options[:has_suite_teardown] + if @options[:omit_begin_end] + output.puts(' (void) suite_teardown(0);') + else + output.puts(' return suiteTearDown(UnityEnd());') + end + else + output.puts(' return UnityEnd();') unless @options[:omit_begin_end] + end + output.puts('}') + end + + def create_h_file(output, filename, tests, testfile_includes, used_mocks) + filename = File.basename(filename).gsub(/[-\/\\\.\,\s]/, '_').upcase + output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') + output.puts("#ifndef _#{filename}") + output.puts("#define _#{filename}\n\n") + output.puts("#include \"#{@options[:framework]}.h\"") + output.puts('#include "cmock.h"') unless used_mocks.empty? + @options[:includes].flatten.uniq.compact.each do |inc| + output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") + end + testfile_includes.each do |inc| + output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") + end + output.puts "\n" + tests.each do |test| + if test[:params].nil? || test[:params].empty? + output.puts("void #{test[:test]}(void);") + else + output.puts("void #{test[:test]}(#{test[:params]});") + end + end + output.puts("#endif\n\n") + end +end + +if $0 == __FILE__ + options = { includes: [] } + + # parse out all the options first (these will all be removed as we go) + ARGV.reject! do |arg| + case arg + when '-cexception' + options[:plugins] = [:cexception] + true + when /\.*\.ya?ml$/ + options = UnityTestRunnerGenerator.grab_config(arg) + true + when /--(\w+)=\"?(.*)\"?/ + options[Regexp.last_match(1).to_sym] = Regexp.last_match(2) + true + when /\.*\.(?:hpp|hh|H|h)$/ + options[:includes] << arg + true + else false + end + end + + # make sure there is at least one parameter left (the input file) + unless ARGV[0] + puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)", + "\n input_test_file - this is the C file you want to create a runner for", + ' output - this is the name of the runner file to generate', + ' defaults to (input_test_file)_Runner', + ' files:', + ' *.yml / *.yaml - loads configuration from here in :unity or :cmock', + ' *.h - header files are added as #includes in runner', + ' options:', + ' -cexception - include cexception support', + ' -externc - add extern "C" for cpp support', + ' --setup_name="" - redefine setUp func name to something else', + ' --teardown_name="" - redefine tearDown func name to something else', + ' --main_name="" - redefine main func name to something else', + ' --test_prefix="" - redefine test prefix from default test|spec|should', + ' --test_reset_name="" - redefine resetTest func name to something else', + ' --test_verify_name="" - redefine verifyTest func name to something else', + ' --suite_setup="" - code to execute for setup of entire suite', + ' --suite_teardown="" - code to execute for teardown of entire suite', + ' --use_param_tests=1 - enable parameterized tests (disabled by default)', + ' --omit_begin_end=1 - omit calls to UnityBegin and UnityEnd (disabled by default)', + ' --header_file="" - path/name of test header file to generate too'].join("\n") + exit 1 + end + + # create the default test runner name if not specified + ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1] + + UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1]) +end diff --git a/lib/lvgl/tests/unity/run_test.erb b/lib/lvgl/tests/unity/run_test.erb new file mode 100644 index 00000000..f91b5669 --- /dev/null +++ b/lib/lvgl/tests/unity/run_test.erb @@ -0,0 +1,37 @@ +/*=======Test Runner Used To Run Each Test=====*/ +static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) +{ + Unity.CurrentTestName = name; + Unity.CurrentTestLineNumber = line_num; +#ifdef UNITY_USE_COMMAND_LINE_ARGS + if (!UnityTestMatches()) + return; +#endif + Unity.NumberOfTests++; + UNITY_CLR_DETAILS(); + UNITY_EXEC_TIME_START(); + CMock_Init(); + if (TEST_PROTECT()) + { +<% if @options[:plugins].include?(:cexception) %> + CEXCEPTION_T e; + Try { + <%= @options[:setup_name] %>(); + func(); + } Catch(e) { + TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); + } +<% else %> + <%= @options[:setup_name] %>(); + func(); +<% end %> + } + if (TEST_PROTECT()) + { + <%= @options[:teardown_name] %>(); + CMock_Verify(); + } + CMock_Destroy(); + UNITY_EXEC_TIME_STOP(); + UnityConcludeTest(); +} diff --git a/lib/lvgl/tests/unity/type_sanitizer.rb b/lib/lvgl/tests/unity/type_sanitizer.rb new file mode 100644 index 00000000..dafb8826 --- /dev/null +++ b/lib/lvgl/tests/unity/type_sanitizer.rb @@ -0,0 +1,6 @@ +module TypeSanitizer + def self.sanitize_c_identifier(unsanitized) + # convert filename to valid C identifier by replacing invalid chars with '_' + unsanitized.gsub(/[-\/\\\.\,\s]/, '_') + end +end diff --git a/lib/lvgl/tests/unity/unity.c b/lib/lvgl/tests/unity/unity.c new file mode 100644 index 00000000..efc9c57e --- /dev/null +++ b/lib/lvgl/tests/unity/unity.c @@ -0,0 +1,2113 @@ +/* ========================================================================= + Unity Project - A Test Framework for C + Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +============================================================================ */ +#if LV_BUILD_TEST +#define UNITY_INCLUDE_PRINT_FORMATTED 1 +#include "unity.h" +#include + +#ifdef AVR +#include +#else +#define PROGMEM +#endif + +/* If omitted from header, declare overrideable prototypes here so they're ready for use */ +#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION +void UNITY_OUTPUT_CHAR(int); +#endif + +/* Helpful macros for us to use here in Assert functions */ +#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } +#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } +#define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) TEST_ABORT() + +struct UNITY_STORAGE_T Unity; + +#ifdef UNITY_OUTPUT_COLOR +const char PROGMEM UnityStrOk[] = "\033[42mOK\033[00m"; +const char PROGMEM UnityStrPass[] = "\033[42mPASS\033[00m"; +const char PROGMEM UnityStrFail[] = "\033[41mFAIL\033[00m"; +const char PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[00m"; +#else +const char PROGMEM UnityStrOk[] = "OK"; +const char PROGMEM UnityStrPass[] = "PASS"; +const char PROGMEM UnityStrFail[] = "FAIL"; +const char PROGMEM UnityStrIgnore[] = "IGNORE"; +#endif +static const char PROGMEM UnityStrNull[] = "NULL"; +static const char PROGMEM UnityStrSpacer[] = ". "; +static const char PROGMEM UnityStrExpected[] = " Expected "; +static const char PROGMEM UnityStrWas[] = " Was "; +static const char PROGMEM UnityStrGt[] = " to be greater than "; +static const char PROGMEM UnityStrLt[] = " to be less than "; +static const char PROGMEM UnityStrOrEqual[] = "or equal to "; +static const char PROGMEM UnityStrNotEqual[] = " to be not equal to "; +static const char PROGMEM UnityStrElement[] = " Element "; +static const char PROGMEM UnityStrByte[] = " Byte "; +static const char PROGMEM UnityStrMemory[] = " Memory Mismatch."; +static const char PROGMEM UnityStrDelta[] = " Values Not Within Delta "; +static const char PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; +static const char PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; +static const char PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL"; +#ifndef UNITY_EXCLUDE_FLOAT +static const char PROGMEM UnityStrNot[] = "Not "; +static const char PROGMEM UnityStrInf[] = "Infinity"; +static const char PROGMEM UnityStrNegInf[] = "Negative Infinity"; +static const char PROGMEM UnityStrNaN[] = "NaN"; +static const char PROGMEM UnityStrDet[] = "Determinate"; +static const char PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait"; +#endif +const char PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled"; +const char PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled"; +const char PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled"; +const char PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled"; +static const char PROGMEM UnityStrBreaker[] = "-----------------------"; +static const char PROGMEM UnityStrResultsTests[] = " Tests "; +static const char PROGMEM UnityStrResultsFailures[] = " Failures "; +static const char PROGMEM UnityStrResultsIgnored[] = " Ignored "; +#ifndef UNITY_EXCLUDE_DETAILS +static const char PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; +static const char PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; +#endif +/*----------------------------------------------- + * Pretty Printers & Test Result Output Handlers + *-----------------------------------------------*/ + +/*-----------------------------------------------*/ +/* Local helper function to print characters. */ +static void UnityPrintChar(const char* pch) +{ + /* printable characters plus CR & LF are printed */ + if ((*pch <= 126) && (*pch >= 32)) + { + UNITY_OUTPUT_CHAR(*pch); + } + /* write escaped carriage returns */ + else if (*pch == 13) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('r'); + } + /* write escaped line feeds */ + else if (*pch == 10) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('n'); + } + /* unprintable characters are shown as codes */ + else + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)*pch, 2); + } +} + +/*-----------------------------------------------*/ +/* Local helper function to print ANSI escape strings e.g. "\033[42m". */ +#ifdef UNITY_OUTPUT_COLOR +static UNITY_UINT UnityPrintAnsiEscapeString(const char* string) +{ + const char* pch = string; + UNITY_UINT count = 0; + + while (*pch && (*pch != 'm')) + { + UNITY_OUTPUT_CHAR(*pch); + pch++; + count++; + } + UNITY_OUTPUT_CHAR('m'); + count++; + + return count; +} +#endif + +/*-----------------------------------------------*/ +void UnityPrint(const char* string) +{ + const char* pch = string; + + if (pch != NULL) + { + while (*pch) + { +#ifdef UNITY_OUTPUT_COLOR + /* print ANSI escape code */ + if ((*pch == 27) && (*(pch + 1) == '[')) + { + pch += UnityPrintAnsiEscapeString(pch); + continue; + } +#endif + UnityPrintChar(pch); + pch++; + } + } +} +/*-----------------------------------------------*/ +void UnityPrintLen(const char* string, const UNITY_UINT32 length) +{ + const char* pch = string; + + if (pch != NULL) + { + while (*pch && ((UNITY_UINT32)(pch - string) < length)) + { + /* printable characters plus CR & LF are printed */ + if ((*pch <= 126) && (*pch >= 32)) + { + UNITY_OUTPUT_CHAR(*pch); + } + /* write escaped carriage returns */ + else if (*pch == 13) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('r'); + } + /* write escaped line feeds */ + else if (*pch == 10) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('n'); + } + /* unprintable characters are shown as codes */ + else + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)*pch, 2); + } + pch++; + } + } +} + +/*-----------------------------------------------*/ +void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) +{ + if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) + { + if (style == UNITY_DISPLAY_STYLE_CHAR) + { + /* printable characters plus CR & LF are printed */ + UNITY_OUTPUT_CHAR('\''); + if ((number <= 126) && (number >= 32)) + { + UNITY_OUTPUT_CHAR((int)number); + } + /* write escaped carriage returns */ + else if (number == 13) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('r'); + } + /* write escaped line feeds */ + else if (number == 10) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('n'); + } + /* unprintable characters are shown as codes */ + else + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)number, 2); + } + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrintNumber(number); + } + } + else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) + { + UnityPrintNumberUnsigned((UNITY_UINT)number); + } + else + { + UNITY_OUTPUT_CHAR('0'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0xF) * 2)); + } +} + +/*-----------------------------------------------*/ +void UnityPrintNumber(const UNITY_INT number_to_print) +{ + UNITY_UINT number = (UNITY_UINT)number_to_print; + + if (number_to_print < 0) + { + /* A negative number, including MIN negative */ + UNITY_OUTPUT_CHAR('-'); + number = (~number) + 1; + } + UnityPrintNumberUnsigned(number); +} + +/*----------------------------------------------- + * basically do an itoa using as little ram as possible */ +void UnityPrintNumberUnsigned(const UNITY_UINT number) +{ + UNITY_UINT divisor = 1; + + /* figure out initial divisor */ + while (number / divisor > 9) + { + divisor *= 10; + } + + /* now mod and print, then divide divisor */ + do + { + UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); + divisor /= 10; + } while (divisor > 0); +} + +/*-----------------------------------------------*/ +void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print) +{ + int nibble; + char nibbles = nibbles_to_print; + + if ((unsigned)nibbles > UNITY_MAX_NIBBLES) + { + nibbles = UNITY_MAX_NIBBLES; + } + + while (nibbles > 0) + { + nibbles--; + nibble = (int)(number >> (nibbles * 4)) & 0x0F; + if (nibble <= 9) + { + UNITY_OUTPUT_CHAR((char)('0' + nibble)); + } + else + { + UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); + } + } +} + +/*-----------------------------------------------*/ +void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number) +{ + UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1); + UNITY_INT32 i; + + for (i = 0; i < UNITY_INT_WIDTH; i++) + { + if (current_bit & mask) + { + if (current_bit & number) + { + UNITY_OUTPUT_CHAR('1'); + } + else + { + UNITY_OUTPUT_CHAR('0'); + } + } + else + { + UNITY_OUTPUT_CHAR('X'); + } + current_bit = current_bit >> 1; + } +} + +/*-----------------------------------------------*/ +#ifndef UNITY_EXCLUDE_FLOAT_PRINT +/* + * This function prints a floating-point value in a format similar to + * printf("%.7g") on a single-precision machine or printf("%.9g") on a + * double-precision machine. The 7th digit won't always be totally correct + * in single-precision operation (for that level of accuracy, a more + * complicated algorithm would be needed). + */ +void UnityPrintFloat(const UNITY_DOUBLE input_number) +{ +#ifdef UNITY_INCLUDE_DOUBLE + static const int sig_digits = 9; + static const UNITY_INT32 min_scaled = 100000000; + static const UNITY_INT32 max_scaled = 1000000000; +#else + static const int sig_digits = 7; + static const UNITY_INT32 min_scaled = 1000000; + static const UNITY_INT32 max_scaled = 10000000; +#endif + + UNITY_DOUBLE number = input_number; + + /* print minus sign (does not handle negative zero) */ + if (number < 0.0f) + { + UNITY_OUTPUT_CHAR('-'); + number = -number; + } + + /* handle zero, NaN, and +/- infinity */ + if (number == 0.0f) + { + UnityPrint("0"); + } + else if (isnan(number)) + { + UnityPrint("nan"); + } + else if (isinf(number)) + { + UnityPrint("inf"); + } + else + { + UNITY_INT32 n_int = 0, n; + int exponent = 0; + int decimals, digits; + char buf[16] = {0}; + + /* + * Scale up or down by powers of 10. To minimize rounding error, + * start with a factor/divisor of 10^10, which is the largest + * power of 10 that can be represented exactly. Finally, compute + * (exactly) the remaining power of 10 and perform one more + * multiplication or division. + */ + if (number < 1.0f) + { + UNITY_DOUBLE factor = 1.0f; + + while (number < (UNITY_DOUBLE)max_scaled / 1e10f) { number *= 1e10f; exponent -= 10; } + while (number * factor < (UNITY_DOUBLE)min_scaled) { factor *= 10.0f; exponent--; } + + number *= factor; + } + else if (number > (UNITY_DOUBLE)max_scaled) + { + UNITY_DOUBLE divisor = 1.0f; + + while (number > (UNITY_DOUBLE)min_scaled * 1e10f) { number /= 1e10f; exponent += 10; } + while (number / divisor > (UNITY_DOUBLE)max_scaled) { divisor *= 10.0f; exponent++; } + + number /= divisor; + } + else + { + /* + * In this range, we can split off the integer part before + * doing any multiplications. This reduces rounding error by + * freeing up significant bits in the fractional part. + */ + UNITY_DOUBLE factor = 1.0f; + n_int = (UNITY_INT32)number; + number -= (UNITY_DOUBLE)n_int; + + while (n_int < min_scaled) { n_int *= 10; factor *= 10.0f; exponent--; } + + number *= factor; + } + + /* round to nearest integer */ + n = ((UNITY_INT32)(number + number) + 1) / 2; + +#ifndef UNITY_ROUND_TIES_AWAY_FROM_ZERO + /* round to even if exactly between two integers */ + if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f)) + n--; +#endif + + n += n_int; + + if (n >= max_scaled) + { + n = min_scaled; + exponent++; + } + + /* determine where to place decimal point */ + decimals = ((exponent <= 0) && (exponent >= -(sig_digits + 3))) ? (-exponent) : (sig_digits - 1); + exponent += decimals; + + /* truncate trailing zeroes after decimal point */ + while ((decimals > 0) && ((n % 10) == 0)) + { + n /= 10; + decimals--; + } + + /* build up buffer in reverse order */ + digits = 0; + while ((n != 0) || (digits < (decimals + 1))) + { + buf[digits++] = (char)('0' + n % 10); + n /= 10; + } + while (digits > 0) + { + if (digits == decimals) { UNITY_OUTPUT_CHAR('.'); } + UNITY_OUTPUT_CHAR(buf[--digits]); + } + + /* print exponent if needed */ + if (exponent != 0) + { + UNITY_OUTPUT_CHAR('e'); + + if (exponent < 0) + { + UNITY_OUTPUT_CHAR('-'); + exponent = -exponent; + } + else + { + UNITY_OUTPUT_CHAR('+'); + } + + digits = 0; + while ((exponent != 0) || (digits < 2)) + { + buf[digits++] = (char)('0' + exponent % 10); + exponent /= 10; + } + while (digits > 0) + { + UNITY_OUTPUT_CHAR(buf[--digits]); + } + } + } +} +#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ + +/*-----------------------------------------------*/ +static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) +{ +#ifdef UNITY_OUTPUT_FOR_ECLIPSE + UNITY_OUTPUT_CHAR('('); + UnityPrint(file); + UNITY_OUTPUT_CHAR(':'); + UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(')'); + UNITY_OUTPUT_CHAR(' '); + UnityPrint(Unity.CurrentTestName); + UNITY_OUTPUT_CHAR(':'); +#else +#ifdef UNITY_OUTPUT_FOR_IAR_WORKBENCH + UnityPrint("'); + UnityPrint(Unity.CurrentTestName); + UnityPrint(" "); +#else +#ifdef UNITY_OUTPUT_FOR_QT_CREATOR + UnityPrint("file://"); + UnityPrint(file); + UNITY_OUTPUT_CHAR(':'); + UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(' '); + UnityPrint(Unity.CurrentTestName); + UNITY_OUTPUT_CHAR(':'); +#else + UnityPrint(file); + UNITY_OUTPUT_CHAR(':'); + UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(':'); + UnityPrint(Unity.CurrentTestName); + UNITY_OUTPUT_CHAR(':'); +#endif +#endif +#endif +} + +/*-----------------------------------------------*/ +static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) +{ + UnityTestResultsBegin(Unity.TestFile, line); + UnityPrint(UnityStrFail); + UNITY_OUTPUT_CHAR(':'); +} + +/*-----------------------------------------------*/ +void UnityConcludeTest(void) +{ + if (Unity.CurrentTestIgnored) + { + Unity.TestIgnores++; + } + else if (!Unity.CurrentTestFailed) + { + UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); + UnityPrint(UnityStrPass); + } + else + { + Unity.TestFailures++; + } + + Unity.CurrentTestFailed = 0; + Unity.CurrentTestIgnored = 0; + UNITY_PRINT_EXEC_TIME(); + UNITY_PRINT_EOL(); + UNITY_FLUSH_CALL(); +} + +/*-----------------------------------------------*/ +static void UnityAddMsgIfSpecified(const char* msg) +{ + if (msg) + { + UnityPrint(UnityStrSpacer); + +#ifdef UNITY_PRINT_TEST_CONTEXT + UNITY_PRINT_TEST_CONTEXT(); +#endif +#ifndef UNITY_EXCLUDE_DETAILS + if (Unity.CurrentDetail1) + { + UnityPrint(UnityStrDetail1Name); + UnityPrint(Unity.CurrentDetail1); + if (Unity.CurrentDetail2) + { + UnityPrint(UnityStrDetail2Name); + UnityPrint(Unity.CurrentDetail2); + } + UnityPrint(UnityStrSpacer); + } +#endif + UnityPrint(msg); + } +} + +/*-----------------------------------------------*/ +static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) +{ + UnityPrint(UnityStrExpected); + if (expected != NULL) + { + UNITY_OUTPUT_CHAR('\''); + UnityPrint(expected); + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrint(UnityStrNull); + } + UnityPrint(UnityStrWas); + if (actual != NULL) + { + UNITY_OUTPUT_CHAR('\''); + UnityPrint(actual); + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrint(UnityStrNull); + } +} + +/*-----------------------------------------------*/ +static void UnityPrintExpectedAndActualStringsLen(const char* expected, + const char* actual, + const UNITY_UINT32 length) +{ + UnityPrint(UnityStrExpected); + if (expected != NULL) + { + UNITY_OUTPUT_CHAR('\''); + UnityPrintLen(expected, length); + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrint(UnityStrNull); + } + UnityPrint(UnityStrWas); + if (actual != NULL) + { + UNITY_OUTPUT_CHAR('\''); + UnityPrintLen(actual, length); + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrint(UnityStrNull); + } +} + +/*----------------------------------------------- + * Assertion & Control Helpers + *-----------------------------------------------*/ + +/*-----------------------------------------------*/ +static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_LINE_TYPE lineNumber, + const char* msg) +{ + /* Both are NULL or same pointer */ + if (expected == actual) { return 0; } + + /* print and return true if just expected is NULL */ + if (expected == NULL) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrNullPointerForExpected); + UnityAddMsgIfSpecified(msg); + return 1; + } + + /* print and return true if just actual is NULL */ + if (actual == NULL) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrNullPointerForActual); + UnityAddMsgIfSpecified(msg); + return 1; + } + + return 0; /* return false if neither is NULL */ +} + +/*----------------------------------------------- + * Assertion Functions + *-----------------------------------------------*/ + +/*-----------------------------------------------*/ +void UnityAssertBits(const UNITY_INT mask, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if ((mask & expected) != (mask & actual)) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected); + UnityPrint(UnityStrWas); + UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertEqualNumber(const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if (expected != actual) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(expected, style); + UnityPrint(UnityStrWas); + UnityPrintNumberByStyle(actual, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, + const UNITY_INT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + int failed = 0; + RETURN_IF_FAIL_OR_IGNORE; + + if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; } + if ((threshold == actual)) { failed = 1; } + + if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) + { + if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } + if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } + } + else /* UINT or HEX */ + { + if (((UNITY_UINT)actual > (UNITY_UINT)threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } + if (((UNITY_UINT)actual < (UNITY_UINT)threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } + } + + if (failed) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(actual, style); + if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); } + if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); } + if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); } + if (compare == UNITY_NOT_EQUAL) { UnityPrint(UnityStrNotEqual); } + UnityPrintNumberByStyle(threshold, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +#define UnityPrintPointlessAndBail() \ +{ \ + UnityTestResultsFailBegin(lineNumber); \ + UnityPrint(UnityStrPointless); \ + UnityAddMsgIfSpecified(msg); \ + UNITY_FAIL_AND_BAIL; } + +/*-----------------------------------------------*/ +void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style, + const UNITY_FLAGS_T flags) +{ + UNITY_UINT32 elements = num_elements; + unsigned int length = style & 0xF; + unsigned int increment = 0; + + RETURN_IF_FAIL_OR_IGNORE; + + if (num_elements == 0) + { + UnityPrintPointlessAndBail(); + } + + if (expected == actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + while ((elements > 0) && (elements--)) + { + UNITY_INT expect_val; + UNITY_INT actual_val; + + switch (length) + { + case 1: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; + increment = sizeof(UNITY_INT8); + break; + + case 2: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; + increment = sizeof(UNITY_INT16); + break; + +#ifdef UNITY_SUPPORT_64 + case 8: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; + increment = sizeof(UNITY_INT64); + break; +#endif + + default: /* default is length 4 bytes */ + case 4: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; + increment = sizeof(UNITY_INT32); + length = 4; + break; + } + + if (expect_val != actual_val) + { + if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) + { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ + UNITY_INT mask = 1; + mask = (mask << 8 * length) - 1; + expect_val &= mask; + actual_val &= mask; + } + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(num_elements - elements - 1); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(expect_val, style); + UnityPrint(UnityStrWas); + UnityPrintNumberByStyle(actual_val, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + /* Walk through array by incrementing the pointers */ + if (flags == UNITY_ARRAY_TO_ARRAY) + { + expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); + } + actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); + } +} + +/*-----------------------------------------------*/ +#ifndef UNITY_EXCLUDE_FLOAT +/* Wrap this define in a function with variable types as float or double */ +#define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \ + if (isinf(expected) && isinf(actual) && (((expected) < 0) == ((actual) < 0))) return 1; \ + if (UNITY_NAN_CHECK) return 1; \ + (diff) = (actual) - (expected); \ + if ((diff) < 0) (diff) = -(diff); \ + if ((delta) < 0) (delta) = -(delta); \ + return !(isnan(diff) || isinf(diff) || ((diff) > (delta))) + /* This first part of this condition will catch any NaN or Infinite values */ +#ifndef UNITY_NAN_NOT_EQUAL_NAN + #define UNITY_NAN_CHECK isnan(expected) && isnan(actual) +#else + #define UNITY_NAN_CHECK 0 +#endif + +#ifndef UNITY_EXCLUDE_FLOAT_PRINT + #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ + { \ + UnityPrint(UnityStrExpected); \ + UnityPrintFloat(expected); \ + UnityPrint(UnityStrWas); \ + UnityPrintFloat(actual); } +#else + #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ + UnityPrint(UnityStrDelta) +#endif /* UNITY_EXCLUDE_FLOAT_PRINT */ + +/*-----------------------------------------------*/ +static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual) +{ + UNITY_FLOAT diff; + UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); +} + +/*-----------------------------------------------*/ +void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected, + UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags) +{ + UNITY_UINT32 elements = num_elements; + UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected; + UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual; + + RETURN_IF_FAIL_OR_IGNORE; + + if (elements == 0) + { + UnityPrintPointlessAndBail(); + } + + if (expected == actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + while (elements--) + { + if (!UnityFloatsWithin(*ptr_expected * UNITY_FLOAT_PRECISION, *ptr_expected, *ptr_actual)) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(num_elements - elements - 1); + UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + if (flags == UNITY_ARRAY_TO_ARRAY) + { + ptr_expected++; + } + ptr_actual++; + } +} + +/*-----------------------------------------------*/ +void UnityAssertFloatsWithin(const UNITY_FLOAT delta, + const UNITY_FLOAT expected, + const UNITY_FLOAT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber) +{ + RETURN_IF_FAIL_OR_IGNORE; + + + if (!UnityFloatsWithin(delta, expected, actual)) + { + UnityTestResultsFailBegin(lineNumber); + UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertFloatSpecial(const UNITY_FLOAT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLOAT_TRAIT_T style) +{ + const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; + UNITY_INT should_be_trait = ((UNITY_INT)style & 1); + UNITY_INT is_trait = !should_be_trait; + UNITY_INT trait_index = (UNITY_INT)(style >> 1); + + RETURN_IF_FAIL_OR_IGNORE; + + switch (style) + { + case UNITY_FLOAT_IS_INF: + case UNITY_FLOAT_IS_NOT_INF: + is_trait = isinf(actual) && (actual > 0); + break; + case UNITY_FLOAT_IS_NEG_INF: + case UNITY_FLOAT_IS_NOT_NEG_INF: + is_trait = isinf(actual) && (actual < 0); + break; + + case UNITY_FLOAT_IS_NAN: + case UNITY_FLOAT_IS_NOT_NAN: + is_trait = isnan(actual) ? 1 : 0; + break; + + case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ + case UNITY_FLOAT_IS_NOT_DET: + is_trait = !isinf(actual) && !isnan(actual); + break; + + default: /* including UNITY_FLOAT_INVALID_TRAIT */ + trait_index = 0; + trait_names[0] = UnityStrInvalidFloatTrait; + break; + } + + if (is_trait != should_be_trait) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + if (!should_be_trait) + { + UnityPrint(UnityStrNot); + } + UnityPrint(trait_names[trait_index]); + UnityPrint(UnityStrWas); +#ifndef UNITY_EXCLUDE_FLOAT_PRINT + UnityPrintFloat((UNITY_DOUBLE)actual); +#else + if (should_be_trait) + { + UnityPrint(UnityStrNot); + } + UnityPrint(trait_names[trait_index]); +#endif + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +#endif /* not UNITY_EXCLUDE_FLOAT */ + +/*-----------------------------------------------*/ +#ifndef UNITY_EXCLUDE_DOUBLE +static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual) +{ + UNITY_DOUBLE diff; + UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); +} + +/*-----------------------------------------------*/ +void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, + UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags) +{ + UNITY_UINT32 elements = num_elements; + UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected; + UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual; + + RETURN_IF_FAIL_OR_IGNORE; + + if (elements == 0) + { + UnityPrintPointlessAndBail(); + } + + if (expected == actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + while (elements--) + { + if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual)) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(num_elements - elements - 1); + UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + if (flags == UNITY_ARRAY_TO_ARRAY) + { + ptr_expected++; + } + ptr_actual++; + } +} + +/*-----------------------------------------------*/ +void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, + const UNITY_DOUBLE expected, + const UNITY_DOUBLE actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if (!UnityDoublesWithin(delta, expected, actual)) + { + UnityTestResultsFailBegin(lineNumber); + UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLOAT_TRAIT_T style) +{ + const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; + UNITY_INT should_be_trait = ((UNITY_INT)style & 1); + UNITY_INT is_trait = !should_be_trait; + UNITY_INT trait_index = (UNITY_INT)(style >> 1); + + RETURN_IF_FAIL_OR_IGNORE; + + switch (style) + { + case UNITY_FLOAT_IS_INF: + case UNITY_FLOAT_IS_NOT_INF: + is_trait = isinf(actual) && (actual > 0); + break; + case UNITY_FLOAT_IS_NEG_INF: + case UNITY_FLOAT_IS_NOT_NEG_INF: + is_trait = isinf(actual) && (actual < 0); + break; + + case UNITY_FLOAT_IS_NAN: + case UNITY_FLOAT_IS_NOT_NAN: + is_trait = isnan(actual) ? 1 : 0; + break; + + case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ + case UNITY_FLOAT_IS_NOT_DET: + is_trait = !isinf(actual) && !isnan(actual); + break; + + default: /* including UNITY_FLOAT_INVALID_TRAIT */ + trait_index = 0; + trait_names[0] = UnityStrInvalidFloatTrait; + break; + } + + if (is_trait != should_be_trait) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + if (!should_be_trait) + { + UnityPrint(UnityStrNot); + } + UnityPrint(trait_names[trait_index]); + UnityPrint(UnityStrWas); +#ifndef UNITY_EXCLUDE_FLOAT_PRINT + UnityPrintFloat(actual); +#else + if (should_be_trait) + { + UnityPrint(UnityStrNot); + } + UnityPrint(trait_names[trait_index]); +#endif + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +#endif /* not UNITY_EXCLUDE_DOUBLE */ + +/*-----------------------------------------------*/ +void UnityAssertNumbersWithin(const UNITY_UINT delta, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) + { + if (actual > expected) + { + Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); + } + else + { + Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); + } + } + else + { + if ((UNITY_UINT)actual > (UNITY_UINT)expected) + { + Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); + } + else + { + Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); + } + } + + if (Unity.CurrentTestFailed) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrDelta); + UnityPrintNumberByStyle((UNITY_INT)delta, style); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(expected, style); + UnityPrint(UnityStrWas); + UnityPrintNumberByStyle(actual, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, + UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style, + const UNITY_FLAGS_T flags) +{ + UNITY_UINT32 elements = num_elements; + unsigned int length = style & 0xF; + unsigned int increment = 0; + + RETURN_IF_FAIL_OR_IGNORE; + + if (num_elements == 0) + { + UnityPrintPointlessAndBail(); + } + + if (expected == actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + while ((elements > 0) && (elements--)) + { + UNITY_INT expect_val; + UNITY_INT actual_val; + + switch (length) + { + case 1: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; + increment = sizeof(UNITY_INT8); + break; + + case 2: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; + increment = sizeof(UNITY_INT16); + break; + +#ifdef UNITY_SUPPORT_64 + case 8: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; + increment = sizeof(UNITY_INT64); + break; +#endif + + default: /* default is length 4 bytes */ + case 4: + expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; + actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; + increment = sizeof(UNITY_INT32); + length = 4; + break; + } + + if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) + { + if (actual_val > expect_val) + { + Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); + } + else + { + Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); + } + } + else + { + if ((UNITY_UINT)actual_val > (UNITY_UINT)expect_val) + { + Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); + } + else + { + Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); + } + } + + if (Unity.CurrentTestFailed) + { + if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) + { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ + UNITY_INT mask = 1; + mask = (mask << 8 * length) - 1; + expect_val &= mask; + actual_val &= mask; + } + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrDelta); + UnityPrintNumberByStyle((UNITY_INT)delta, style); + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(num_elements - elements - 1); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(expect_val, style); + UnityPrint(UnityStrWas); + UnityPrintNumberByStyle(actual_val, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + /* Walk through array by incrementing the pointers */ + if (flags == UNITY_ARRAY_TO_ARRAY) + { + expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); + } + actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); + } +} + +/*-----------------------------------------------*/ +void UnityAssertEqualString(const char* expected, + const char* actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber) +{ + UNITY_UINT32 i; + + RETURN_IF_FAIL_OR_IGNORE; + + /* if both pointers not null compare the strings */ + if (expected && actual) + { + for (i = 0; expected[i] || actual[i]; i++) + { + if (expected[i] != actual[i]) + { + Unity.CurrentTestFailed = 1; + break; + } + } + } + else + { /* handle case of one pointers being null (if both null, test should pass) */ + if (expected != actual) + { + Unity.CurrentTestFailed = 1; + } + } + + if (Unity.CurrentTestFailed) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrintExpectedAndActualStrings(expected, actual); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertEqualStringLen(const char* expected, + const char* actual, + const UNITY_UINT32 length, + const char* msg, + const UNITY_LINE_TYPE lineNumber) +{ + UNITY_UINT32 i; + + RETURN_IF_FAIL_OR_IGNORE; + + /* if both pointers not null compare the strings */ + if (expected && actual) + { + for (i = 0; (i < length) && (expected[i] || actual[i]); i++) + { + if (expected[i] != actual[i]) + { + Unity.CurrentTestFailed = 1; + break; + } + } + } + else + { /* handle case of one pointers being null (if both null, test should pass) */ + if (expected != actual) + { + Unity.CurrentTestFailed = 1; + } + } + + if (Unity.CurrentTestFailed) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrintExpectedAndActualStringsLen(expected, actual, length); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +/*-----------------------------------------------*/ +void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected, + const char** actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags) +{ + UNITY_UINT32 i = 0; + UNITY_UINT32 j = 0; + const char* expd = NULL; + const char* act = NULL; + + RETURN_IF_FAIL_OR_IGNORE; + + /* if no elements, it's an error */ + if (num_elements == 0) + { + UnityPrintPointlessAndBail(); + } + + if ((const void*)expected == (const void*)actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + if (flags != UNITY_ARRAY_TO_ARRAY) + { + expd = (const char*)expected; + } + + do + { + act = actual[j]; + if (flags == UNITY_ARRAY_TO_ARRAY) + { + expd = ((const char* const*)expected)[j]; + } + + /* if both pointers not null compare the strings */ + if (expd && act) + { + for (i = 0; expd[i] || act[i]; i++) + { + if (expd[i] != act[i]) + { + Unity.CurrentTestFailed = 1; + break; + } + } + } + else + { /* handle case of one pointers being null (if both null, test should pass) */ + if (expd != act) + { + Unity.CurrentTestFailed = 1; + } + } + + if (Unity.CurrentTestFailed) + { + UnityTestResultsFailBegin(lineNumber); + if (num_elements > 1) + { + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(j); + } + UnityPrintExpectedAndActualStrings(expd, act); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + } while (++j < num_elements); +} + +/*-----------------------------------------------*/ +void UnityAssertEqualMemory(UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 length, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags) +{ + UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; + UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; + UNITY_UINT32 elements = num_elements; + UNITY_UINT32 bytes; + + RETURN_IF_FAIL_OR_IGNORE; + + if ((elements == 0) || (length == 0)) + { + UnityPrintPointlessAndBail(); + } + + if (expected == actual) + { + return; /* Both are NULL or same pointer */ + } + + if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) + { + UNITY_FAIL_AND_BAIL; + } + + while (elements--) + { + bytes = length; + while (bytes--) + { + if (*ptr_exp != *ptr_act) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrMemory); + if (num_elements > 1) + { + UnityPrint(UnityStrElement); + UnityPrintNumberUnsigned(num_elements - elements - 1); + } + UnityPrint(UnityStrByte); + UnityPrintNumberUnsigned(length - bytes - 1); + UnityPrint(UnityStrExpected); + UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); + UnityPrint(UnityStrWas); + UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } + ptr_exp++; + ptr_act++; + } + if (flags == UNITY_ARRAY_TO_VAL) + { + ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; + } + } +} + +/*-----------------------------------------------*/ + +static union +{ + UNITY_INT8 i8; + UNITY_INT16 i16; + UNITY_INT32 i32; +#ifdef UNITY_SUPPORT_64 + UNITY_INT64 i64; +#endif +#ifndef UNITY_EXCLUDE_FLOAT + float f; +#endif +#ifndef UNITY_EXCLUDE_DOUBLE + double d; +#endif +} UnityQuickCompare; + +UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size) +{ + switch(size) + { + case 1: + UnityQuickCompare.i8 = (UNITY_INT8)num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i8); + + case 2: + UnityQuickCompare.i16 = (UNITY_INT16)num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i16); + +#ifdef UNITY_SUPPORT_64 + case 8: + UnityQuickCompare.i64 = (UNITY_INT64)num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i64); +#endif + + default: /* 4 bytes */ + UnityQuickCompare.i32 = (UNITY_INT32)num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i32); + } +} + +#ifndef UNITY_EXCLUDE_FLOAT +/*-----------------------------------------------*/ +UNITY_INTERNAL_PTR UnityFloatToPtr(const float num) +{ + UnityQuickCompare.f = num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.f); +} +#endif + +#ifndef UNITY_EXCLUDE_DOUBLE +/*-----------------------------------------------*/ +UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num) +{ + UnityQuickCompare.d = num; + return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.d); +} +#endif + +/*----------------------------------------------- + * printf helper function + *-----------------------------------------------*/ +#ifdef UNITY_INCLUDE_PRINT_FORMATTED +static void UnityPrintFVA(const char* format, va_list va) +{ + const char* pch = format; + if (pch != NULL) + { + while (*pch) + { + /* format identification character */ + if (*pch == '%') + { + pch++; + + if (pch != NULL) + { + switch (*pch) + { + case 'd': + case 'i': + { + const int number = va_arg(va, int); + UnityPrintNumber((UNITY_INT)number); + break; + } +#ifndef UNITY_EXCLUDE_FLOAT_PRINT + case 'f': + case 'g': + { + const double number = va_arg(va, double); + UnityPrintFloat((UNITY_DOUBLE)number); + break; + } +#endif + case 'u': + { + const unsigned int number = va_arg(va, unsigned int); + UnityPrintNumberUnsigned((UNITY_UINT)number); + break; + } + case 'b': + { + const unsigned int number = va_arg(va, unsigned int); + const UNITY_UINT mask = (UNITY_UINT)0 - (UNITY_UINT)1; + UNITY_OUTPUT_CHAR('0'); + UNITY_OUTPUT_CHAR('b'); + UnityPrintMask(mask, (UNITY_UINT)number); + break; + } + case 'x': + case 'X': + case 'p': + { + const unsigned int number = va_arg(va, unsigned int); + UNITY_OUTPUT_CHAR('0'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)number, 8); + break; + } + case 'c': + { + const int ch = va_arg(va, int); + UnityPrintChar((const char *)&ch); + break; + } + case 's': + { + const char * string = va_arg(va, const char *); + UnityPrint(string); + break; + } + case '%': + { + UnityPrintChar(pch); + break; + } + default: + { + /* print the unknown format character */ + UNITY_OUTPUT_CHAR('%'); + UnityPrintChar(pch); + break; + } + } + } + } +#ifdef UNITY_OUTPUT_COLOR + /* print ANSI escape code */ + else if ((*pch == 27) && (*(pch + 1) == '[')) + { + pch += UnityPrintAnsiEscapeString(pch); + continue; + } +#endif + else if (*pch == '\n') + { + UNITY_PRINT_EOL(); + } + else + { + UnityPrintChar(pch); + } + + pch++; + } + } +} + +void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...) +{ + UnityTestResultsBegin(Unity.TestFile, line); + UnityPrint("INFO"); + if(format != NULL) + { + UnityPrint(": "); + va_list va; + va_start(va, format); + UnityPrintFVA(format, va); + va_end(va); + } + UNITY_PRINT_EOL(); +} +#endif /* ! UNITY_INCLUDE_PRINT_FORMATTED */ + + +/*----------------------------------------------- + * Control Functions + *-----------------------------------------------*/ + +/*-----------------------------------------------*/ +void UnityFail(const char* msg, const UNITY_LINE_TYPE line) +{ + RETURN_IF_FAIL_OR_IGNORE; + + UnityTestResultsBegin(Unity.TestFile, line); + UnityPrint(UnityStrFail); + if (msg != NULL) + { + UNITY_OUTPUT_CHAR(':'); + +#ifdef UNITY_PRINT_TEST_CONTEXT + UNITY_PRINT_TEST_CONTEXT(); +#endif +#ifndef UNITY_EXCLUDE_DETAILS + if (Unity.CurrentDetail1) + { + UnityPrint(UnityStrDetail1Name); + UnityPrint(Unity.CurrentDetail1); + if (Unity.CurrentDetail2) + { + UnityPrint(UnityStrDetail2Name); + UnityPrint(Unity.CurrentDetail2); + } + UnityPrint(UnityStrSpacer); + } +#endif + if (msg[0] != ' ') + { + UNITY_OUTPUT_CHAR(' '); + } + UnityPrint(msg); + } + + UNITY_FAIL_AND_BAIL; +} + +/*-----------------------------------------------*/ +void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) +{ + RETURN_IF_FAIL_OR_IGNORE; + + UnityTestResultsBegin(Unity.TestFile, line); + UnityPrint(UnityStrIgnore); + if (msg != NULL) + { + UNITY_OUTPUT_CHAR(':'); + UNITY_OUTPUT_CHAR(' '); + UnityPrint(msg); + } + UNITY_IGNORE_AND_BAIL; +} + +/*-----------------------------------------------*/ +void UnityMessage(const char* msg, const UNITY_LINE_TYPE line) +{ + UnityTestResultsBegin(Unity.TestFile, line); + UnityPrint("INFO"); + if (msg != NULL) + { + UNITY_OUTPUT_CHAR(':'); + UNITY_OUTPUT_CHAR(' '); + UnityPrint(msg); + } + UNITY_PRINT_EOL(); +} + +/*-----------------------------------------------*/ +/* If we have not defined our own test runner, then include our default test runner to make life easier */ +#ifndef UNITY_SKIP_DEFAULT_RUNNER +void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) +{ + Unity.CurrentTestName = FuncName; + Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; + Unity.NumberOfTests++; + UNITY_CLR_DETAILS(); + UNITY_EXEC_TIME_START(); + if (TEST_PROTECT()) + { + setUp(); + Func(); + } + if (TEST_PROTECT()) + { + tearDown(); + } + UNITY_EXEC_TIME_STOP(); + UnityConcludeTest(); +} +#endif + +/*-----------------------------------------------*/ +void UnitySetTestFile(const char* filename) +{ + Unity.TestFile = filename; +} + +/*-----------------------------------------------*/ +void UnityBegin(const char* filename) +{ + Unity.TestFile = filename; + Unity.CurrentTestName = NULL; + Unity.CurrentTestLineNumber = 0; + Unity.NumberOfTests = 0; + Unity.TestFailures = 0; + Unity.TestIgnores = 0; + Unity.CurrentTestFailed = 0; + Unity.CurrentTestIgnored = 0; + + UNITY_CLR_DETAILS(); + UNITY_OUTPUT_START(); +} + +/*-----------------------------------------------*/ +int UnityEnd(void) +{ + UNITY_PRINT_EOL(); + UnityPrint(UnityStrBreaker); + UNITY_PRINT_EOL(); + UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests)); + UnityPrint(UnityStrResultsTests); + UnityPrintNumber((UNITY_INT)(Unity.TestFailures)); + UnityPrint(UnityStrResultsFailures); + UnityPrintNumber((UNITY_INT)(Unity.TestIgnores)); + UnityPrint(UnityStrResultsIgnored); + UNITY_PRINT_EOL(); + if (Unity.TestFailures == 0U) + { + UnityPrint(UnityStrOk); + } + else + { + UnityPrint(UnityStrFail); +#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL + UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D'); +#endif + } + UNITY_PRINT_EOL(); + UNITY_FLUSH_CALL(); + UNITY_OUTPUT_COMPLETE(); + return (int)(Unity.TestFailures); +} + +/*----------------------------------------------- + * Command Line Argument Support + *-----------------------------------------------*/ +#ifdef UNITY_USE_COMMAND_LINE_ARGS + +char* UnityOptionIncludeNamed = NULL; +char* UnityOptionExcludeNamed = NULL; +int UnityVerbosity = 1; + +/*-----------------------------------------------*/ +int UnityParseOptions(int argc, char** argv) +{ + int i; + UnityOptionIncludeNamed = NULL; + UnityOptionExcludeNamed = NULL; + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + switch (argv[i][1]) + { + case 'l': /* list tests */ + return -1; + case 'n': /* include tests with name including this string */ + case 'f': /* an alias for -n */ + if (argv[i][2] == '=') + { + UnityOptionIncludeNamed = &argv[i][3]; + } + else if (++i < argc) + { + UnityOptionIncludeNamed = argv[i]; + } + else + { + UnityPrint("ERROR: No Test String to Include Matches For"); + UNITY_PRINT_EOL(); + return 1; + } + break; + case 'q': /* quiet */ + UnityVerbosity = 0; + break; + case 'v': /* verbose */ + UnityVerbosity = 2; + break; + case 'x': /* exclude tests with name including this string */ + if (argv[i][2] == '=') + { + UnityOptionExcludeNamed = &argv[i][3]; + } + else if (++i < argc) + { + UnityOptionExcludeNamed = argv[i]; + } + else + { + UnityPrint("ERROR: No Test String to Exclude Matches For"); + UNITY_PRINT_EOL(); + return 1; + } + break; + default: + UnityPrint("ERROR: Unknown Option "); + UNITY_OUTPUT_CHAR(argv[i][1]); + UNITY_PRINT_EOL(); + return 1; + } + } + } + + return 0; +} + +/*-----------------------------------------------*/ +int IsStringInBiggerString(const char* longstring, const char* shortstring) +{ + const char* lptr = longstring; + const char* sptr = shortstring; + const char* lnext = lptr; + + if (*sptr == '*') + { + return 1; + } + + while (*lptr) + { + lnext = lptr + 1; + + /* If they current bytes match, go on to the next bytes */ + while (*lptr && *sptr && (*lptr == *sptr)) + { + lptr++; + sptr++; + + /* We're done if we match the entire string or up to a wildcard */ + if (*sptr == '*') + return 1; + if (*sptr == ',') + return 1; + if (*sptr == '"') + return 1; + if (*sptr == '\'') + return 1; + if (*sptr == ':') + return 2; + if (*sptr == 0) + return 1; + } + + /* Otherwise we start in the long pointer 1 character further and try again */ + lptr = lnext; + sptr = shortstring; + } + + return 0; +} + +/*-----------------------------------------------*/ +int UnityStringArgumentMatches(const char* str) +{ + int retval; + const char* ptr1; + const char* ptr2; + const char* ptrf; + + /* Go through the options and get the substrings for matching one at a time */ + ptr1 = str; + while (ptr1[0] != 0) + { + if ((ptr1[0] == '"') || (ptr1[0] == '\'')) + { + ptr1++; + } + + /* look for the start of the next partial */ + ptr2 = ptr1; + ptrf = 0; + do + { + ptr2++; + if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')) + { + ptrf = &ptr2[1]; + } + } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')); + + while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ','))) + { + ptr2++; + } + + /* done if complete filename match */ + retval = IsStringInBiggerString(Unity.TestFile, ptr1); + if (retval == 1) + { + return retval; + } + + /* done if testname match after filename partial match */ + if ((retval == 2) && (ptrf != 0)) + { + if (IsStringInBiggerString(Unity.CurrentTestName, ptrf)) + { + return 1; + } + } + + /* done if complete testname match */ + if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1) + { + return 1; + } + + ptr1 = ptr2; + } + + /* we couldn't find a match for any substrings */ + return 0; +} + +/*-----------------------------------------------*/ +int UnityTestMatches(void) +{ + /* Check if this test name matches the included test pattern */ + int retval; + if (UnityOptionIncludeNamed) + { + retval = UnityStringArgumentMatches(UnityOptionIncludeNamed); + } + else + { + retval = 1; + } + + /* Check if this test name matches the excluded test pattern */ + if (UnityOptionExcludeNamed) + { + if (UnityStringArgumentMatches(UnityOptionExcludeNamed)) + { + retval = 0; + } + } + + return retval; +} + +#endif /* UNITY_USE_COMMAND_LINE_ARGS */ +/*-----------------------------------------------*/ +#endif /*LV_BUILD_TEST*/ + diff --git a/lib/lvgl/tests/unity/unity.h b/lib/lvgl/tests/unity/unity.h new file mode 100644 index 00000000..bf8eceae --- /dev/null +++ b/lib/lvgl/tests/unity/unity.h @@ -0,0 +1,668 @@ +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ +#if LV_BUILD_TEST +#define UNITY_INCLUDE_PRINT_FORMATTED 1 + +#ifndef UNITY_FRAMEWORK_H +#define UNITY_FRAMEWORK_H +#define UNITY + +#define UNITY_VERSION_MAJOR 2 +#define UNITY_VERSION_MINOR 5 +#define UNITY_VERSION_BUILD 2 +#define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "unity_internals.h" + +/*------------------------------------------------------- + * Test Setup / Teardown + *-------------------------------------------------------*/ + +/* These functions are intended to be called before and after each test. + * If using unity directly, these will need to be provided for each test + * executable built. If you are using the test runner generator and/or + * Ceedling, these are optional. */ +void setUp(void); +void tearDown(void); + +/* These functions are intended to be called at the beginning and end of an + * entire test suite. suiteTearDown() is passed the number of tests that + * failed, and its return value becomes the exit code of main(). If using + * Unity directly, you're in charge of calling these if they are desired. + * If using Ceedling or the test runner generator, these will be called + * automatically if they exist. */ +void suiteSetUp(void); +int suiteTearDown(int num_failures); + +/*------------------------------------------------------- + * Test Reset and Verify + *-------------------------------------------------------*/ + +/* These functions are intended to be called before during tests in order + * to support complex test loops, etc. Both are NOT built into Unity. Instead + * the test runner generator will create them. resetTest will run teardown and + * setup again, verifying any end-of-test needs between. verifyTest will only + * run the verification. */ +void resetTest(void); +void verifyTest(void); + +/*------------------------------------------------------- + * Configuration Options + *------------------------------------------------------- + * All options described below should be passed as a compiler flag to all files using Unity. If you must add #defines, place them BEFORE the #include above. + + * Integers/longs/pointers + * - Unity attempts to automatically discover your integer sizes + * - define UNITY_EXCLUDE_STDINT_H to stop attempting to look in + * - define UNITY_EXCLUDE_LIMITS_H to stop attempting to look in + * - If you cannot use the automatic methods above, you can force Unity by using these options: + * - define UNITY_SUPPORT_64 + * - set UNITY_INT_WIDTH + * - set UNITY_LONG_WIDTH + * - set UNITY_POINTER_WIDTH + + * Floats + * - define UNITY_EXCLUDE_FLOAT to disallow floating point comparisons + * - define UNITY_FLOAT_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_FLOAT + * - define UNITY_FLOAT_TYPE to specify doubles instead of single precision floats + * - define UNITY_INCLUDE_DOUBLE to allow double floating point comparisons + * - define UNITY_EXCLUDE_DOUBLE to disallow double floating point comparisons (default) + * - define UNITY_DOUBLE_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_DOUBLE + * - define UNITY_DOUBLE_TYPE to specify something other than double + * - define UNITY_EXCLUDE_FLOAT_PRINT to trim binary size, won't print floating point values in errors + + * Output + * - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired + * - define UNITY_DIFFERENTIATE_FINAL_FAIL to print FAILED (vs. FAIL) at test end summary - for automated search for failure + + * Optimization + * - by default, line numbers are stored in unsigned shorts. Define UNITY_LINE_TYPE with a different type if your files are huge + * - by default, test and failure counters are unsigned shorts. Define UNITY_COUNTER_TYPE with a different type if you want to save space or have more than 65535 Tests. + + * Test Cases + * - define UNITY_SUPPORT_TEST_CASES to include the TEST_CASE macro, though really it's mostly about the runner generator script + + * Parameterized Tests + * - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing + + * Tests with Arguments + * - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity + + *------------------------------------------------------- + * Basic Fail and Ignore + *-------------------------------------------------------*/ + +#define TEST_FAIL_MESSAGE(message) UNITY_TEST_FAIL(__LINE__, (message)) +#define TEST_FAIL() UNITY_TEST_FAIL(__LINE__, NULL) +#define TEST_IGNORE_MESSAGE(message) UNITY_TEST_IGNORE(__LINE__, (message)) +#define TEST_IGNORE() UNITY_TEST_IGNORE(__LINE__, NULL) +#define TEST_MESSAGE(message) UnityMessage((message), __LINE__) +#define TEST_ONLY() +#ifdef UNITY_INCLUDE_PRINT_FORMATTED +#define TEST_PRINTF(message, ...) UnityPrintF(__LINE__, (message), __VA_ARGS__) +#endif + +/* It is not necessary for you to call PASS. A PASS condition is assumed if nothing fails. + * This method allows you to abort a test immediately with a PASS state, ignoring the remainder of the test. */ +#define TEST_PASS() TEST_ABORT() +#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while(0) + +/* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out + * which files should be linked to in order to perform a test. Use it like TEST_FILE("sandwiches.c") */ +#define TEST_FILE(a) + +/*------------------------------------------------------- + * Test Asserts (simple) + *-------------------------------------------------------*/ + +/* Boolean */ +#define TEST_ASSERT(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expression Evaluated To FALSE") +#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE") +#define TEST_ASSERT_UNLESS(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expression Evaluated To TRUE") +#define TEST_ASSERT_FALSE(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expected FALSE Was TRUE") +#define TEST_ASSERT_NULL(pointer) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, " Expected NULL") +#define TEST_ASSERT_NOT_NULL(pointer) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, " Expected Non-NULL") +#define TEST_ASSERT_EMPTY(pointer) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, " Expected Empty") +#define TEST_ASSERT_NOT_EMPTY(pointer) UNITY_TEST_ASSERT_NOT_EMPTY((pointer), __LINE__, " Expected Non-Empty") + +/* Integers (of all sizes) */ +#define TEST_ASSERT_EQUAL_INT(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_size_t(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX8(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX16(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_CHAR(expected, actual) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT)(-1), (actual), __LINE__, NULL) +#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT)(0), (actual), __LINE__, NULL) +#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT)1 << (bit)), (UNITY_UINT)(-1), (actual), __LINE__, NULL) +#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT)1 << (bit)), (UNITY_UINT)(0), (actual), __LINE__, NULL) + +/* Integer Not Equal To (of all sizes) */ +#define TEST_ASSERT_NOT_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (actual), __LINE__, NULL) + +/* Integer Greater Than/ Less Than (of all sizes) */ +#define TEST_ASSERT_GREATER_THAN(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, NULL) + +#define TEST_ASSERT_LESS_THAN(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, NULL) + +#define TEST_ASSERT_GREATER_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL) + +#define TEST_ASSERT_LESS_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL) + +/* Integer Ranges (of all sizes) */ +#define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_INT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_INT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_INT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_INT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_UINT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_UINT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_UINT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_UINT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_UINT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_size_t_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_HEX_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_HEX8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_HEX16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_HEX32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_HEX64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_CHAR_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, NULL) + +/* Integer Array Ranges (of all sizes) */ +#define TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_size_t_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_HEX_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) + + +/* Structs and Strings */ +#define TEST_ASSERT_EQUAL_PTR(expected, actual) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_STRING(expected, actual) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, NULL) + +/* Arrays */ +#define TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_size_t_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) + +/* Arrays Compared To Single Value */ +#define TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_size_t(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_HEX(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, NULL) + +/* Floating Point (If Enabled) */ +#define TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_FLOAT(expected, actual) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NOT_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, NULL) +#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, NULL) + +/* Double (If Enabled) */ +#define TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_DOUBLE(expected, actual) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NOT_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, NULL) +#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, NULL) + +/* Shorthand */ +#ifdef UNITY_SHORTHAND_AS_OLD +#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") +#endif +#ifdef UNITY_SHORTHAND_AS_INT +#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif +#ifdef UNITY_SHORTHAND_AS_MEM +#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, NULL) +#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif +#ifdef UNITY_SHORTHAND_AS_RAW +#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, " Expected Equal") +#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") +#endif +#ifdef UNITY_SHORTHAND_AS_NONE +#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif + +/*------------------------------------------------------- + * Test Asserts (with additional messages) + *-------------------------------------------------------*/ + +/* Boolean */ +#define TEST_ASSERT_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) +#define TEST_ASSERT_TRUE_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) +#define TEST_ASSERT_UNLESS_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) +#define TEST_ASSERT_FALSE_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) +#define TEST_ASSERT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, (message)) +#define TEST_ASSERT_NOT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, (message)) +#define TEST_ASSERT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, (message)) +#define TEST_ASSERT_NOT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_EMPTY((pointer), __LINE__, (message)) + +/* Integers (of all sizes) */ +#define TEST_ASSERT_EQUAL_INT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_size_t_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_BITS_MESSAGE(mask, expected, actual, message) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) +#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message)) +#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) +#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_CHAR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, (message)) + +/* Integer Not Equal To (of all sizes) */ +#define TEST_ASSERT_NOT_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (actual), __LINE__, (message)) + + +/* Integer Greater Than/ Less Than (of all sizes) */ +#define TEST_ASSERT_GREATER_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, (message)) + +#define TEST_ASSERT_LESS_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, (message)) + +#define TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message)) + +#define TEST_ASSERT_LESS_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message)) + +/* Integer Ranges (of all sizes) */ +#define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_INT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_INT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_INT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_INT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_UINT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_UINT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_UINT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_UINT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_UINT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_size_t_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_HEX_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_HEX8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_HEX16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_HEX32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_HEX64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_CHAR_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, (message)) + +/* Integer Array Ranges (of all sizes) */ +#define TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_INT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_UINT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_size_t_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_HEX_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) + + +/* Structs and Strings */ +#define TEST_ASSERT_EQUAL_PTR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_MEMORY_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, (message)) + +/* Arrays */ +#define TEST_ASSERT_EQUAL_INT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_INT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_UINT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_size_t_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_HEX64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_PTR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_STRING_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_MEMORY_ARRAY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_CHAR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) + +/* Arrays Compared To Single Value*/ +#define TEST_ASSERT_EACH_EQUAL_INT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_INT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_INT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_INT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_INT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_UINT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_UINT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_UINT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_UINT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_UINT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_size_t_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_HEX_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_HEX8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_HEX16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_HEX32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_HEX64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_PTR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_STRING_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_MEMORY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_CHAR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, (message)) + +/* Floating Point (If Enabled) */ +#define TEST_ASSERT_FLOAT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_FLOAT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_FLOAT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_FLOAT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, (message)) +#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, (message)) + +/* Double (If Enabled) */ +#define TEST_ASSERT_DOUBLE_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_DOUBLE_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_DOUBLE_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, (message)) +#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, (message)) + +/* Shorthand */ +#ifdef UNITY_SHORTHAND_AS_OLD +#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, (message)) +#endif +#ifdef UNITY_SHORTHAND_AS_INT +#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, message) +#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif +#ifdef UNITY_SHORTHAND_AS_MEM +#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, message) +#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif +#ifdef UNITY_SHORTHAND_AS_RAW +#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, message) +#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, message) +#endif +#ifdef UNITY_SHORTHAND_AS_NONE +#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +#endif + +/* end of UNITY_FRAMEWORK_H */ +#ifdef __cplusplus +} +#endif +#endif + + +#include "unity_support.h" + +#endif /*LV_BUILD_TEST*/ diff --git a/lib/lvgl/tests/unity/unity_internals.h b/lib/lvgl/tests/unity/unity_internals.h new file mode 100644 index 00000000..46eb1dd7 --- /dev/null +++ b/lib/lvgl/tests/unity/unity_internals.h @@ -0,0 +1,1042 @@ +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ +#if LV_BUILD_TEST + +#ifndef UNITY_INTERNALS_H +#define UNITY_INTERNALS_H + +#ifdef UNITY_INCLUDE_CONFIG_H +#include "unity_config.h" +#endif + +#ifndef UNITY_EXCLUDE_SETJMP_H +#include +#endif + +#ifndef UNITY_EXCLUDE_MATH_H +#include +#endif + +#ifndef UNITY_EXCLUDE_STDDEF_H +#include +#endif + +#ifdef UNITY_INCLUDE_PRINT_FORMATTED +#include +#endif + +/* Unity Attempts to Auto-Detect Integer Types + * Attempt 1: UINT_MAX, ULONG_MAX in , or default to 32 bits + * Attempt 2: UINTPTR_MAX in , or default to same size as long + * The user may override any of these derived constants: + * UNITY_INT_WIDTH, UNITY_LONG_WIDTH, UNITY_POINTER_WIDTH */ +#ifndef UNITY_EXCLUDE_STDINT_H +#include +#endif + +#ifndef UNITY_EXCLUDE_LIMITS_H +#include +#endif + +#if defined(__GNUC__) || defined(__clang__) + #define UNITY_FUNCTION_ATTR(a) __attribute__((a)) +#else + #define UNITY_FUNCTION_ATTR(a) /* ignore */ +#endif + +/*------------------------------------------------------- + * Guess Widths If Not Specified + *-------------------------------------------------------*/ + +/* Determine the size of an int, if not already specified. + * We cannot use sizeof(int), because it is not yet defined + * at this stage in the translation of the C program. + * Also sizeof(int) does return the size in addressable units on all platforms, + * which may not necessarily be the size in bytes. + * Therefore, infer it from UINT_MAX if possible. */ +#ifndef UNITY_INT_WIDTH + #ifdef UINT_MAX + #if (UINT_MAX == 0xFFFF) + #define UNITY_INT_WIDTH (16) + #elif (UINT_MAX == 0xFFFFFFFF) + #define UNITY_INT_WIDTH (32) + #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF) + #define UNITY_INT_WIDTH (64) + #endif + #else /* Set to default */ + #define UNITY_INT_WIDTH (32) + #endif /* UINT_MAX */ +#endif + +/* Determine the size of a long, if not already specified. */ +#ifndef UNITY_LONG_WIDTH + #ifdef ULONG_MAX + #if (ULONG_MAX == 0xFFFF) + #define UNITY_LONG_WIDTH (16) + #elif (ULONG_MAX == 0xFFFFFFFF) + #define UNITY_LONG_WIDTH (32) + #elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF) + #define UNITY_LONG_WIDTH (64) + #endif + #else /* Set to default */ + #define UNITY_LONG_WIDTH (32) + #endif /* ULONG_MAX */ +#endif + +/* Determine the size of a pointer, if not already specified. */ +#ifndef UNITY_POINTER_WIDTH + #ifdef UINTPTR_MAX + #if (UINTPTR_MAX <= 0xFFFF) + #define UNITY_POINTER_WIDTH (16) + #elif (UINTPTR_MAX <= 0xFFFFFFFF) + #define UNITY_POINTER_WIDTH (32) + #elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF) + #define UNITY_POINTER_WIDTH (64) + #endif + #else /* Set to default */ + #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH + #endif /* UINTPTR_MAX */ +#endif + +/*------------------------------------------------------- + * Int Support (Define types based on detected sizes) + *-------------------------------------------------------*/ + +#if (UNITY_INT_WIDTH == 32) + typedef unsigned char UNITY_UINT8; + typedef unsigned short UNITY_UINT16; + typedef unsigned int UNITY_UINT32; + typedef signed char UNITY_INT8; + typedef signed short UNITY_INT16; + typedef signed int UNITY_INT32; +#elif (UNITY_INT_WIDTH == 16) + typedef unsigned char UNITY_UINT8; + typedef unsigned int UNITY_UINT16; + typedef unsigned long UNITY_UINT32; + typedef signed char UNITY_INT8; + typedef signed int UNITY_INT16; + typedef signed long UNITY_INT32; +#else + #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported) +#endif + +/*------------------------------------------------------- + * 64-bit Support + *-------------------------------------------------------*/ + +/* Auto-detect 64 Bit Support */ +#ifndef UNITY_SUPPORT_64 + #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64 + #define UNITY_SUPPORT_64 + #endif +#endif + +/* 64-Bit Support Dependent Configuration */ +#ifndef UNITY_SUPPORT_64 + /* No 64-bit Support */ + typedef UNITY_UINT32 UNITY_UINT; + typedef UNITY_INT32 UNITY_INT; + #define UNITY_MAX_NIBBLES (8) /* Maximum number of nibbles in a UNITY_(U)INT */ +#else + /* 64-bit Support */ + #if (UNITY_LONG_WIDTH == 32) + typedef unsigned long long UNITY_UINT64; + typedef signed long long UNITY_INT64; + #elif (UNITY_LONG_WIDTH == 64) + typedef unsigned long UNITY_UINT64; + typedef signed long UNITY_INT64; + #else + #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported) + #endif + typedef UNITY_UINT64 UNITY_UINT; + typedef UNITY_INT64 UNITY_INT; + #define UNITY_MAX_NIBBLES (16) /* Maximum number of nibbles in a UNITY_(U)INT */ +#endif + +/*------------------------------------------------------- + * Pointer Support + *-------------------------------------------------------*/ + +#if (UNITY_POINTER_WIDTH == 32) + #define UNITY_PTR_TO_INT UNITY_INT32 + #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32 +#elif (UNITY_POINTER_WIDTH == 64) + #define UNITY_PTR_TO_INT UNITY_INT64 + #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64 +#elif (UNITY_POINTER_WIDTH == 16) + #define UNITY_PTR_TO_INT UNITY_INT16 + #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16 +#else + #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported) +#endif + +#ifndef UNITY_PTR_ATTRIBUTE + #define UNITY_PTR_ATTRIBUTE +#endif + +#ifndef UNITY_INTERNAL_PTR + #define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void* +#endif + +/*------------------------------------------------------- + * Float Support + *-------------------------------------------------------*/ + +#ifdef UNITY_EXCLUDE_FLOAT + +/* No Floating Point Support */ +#ifndef UNITY_EXCLUDE_DOUBLE +#define UNITY_EXCLUDE_DOUBLE /* Remove double when excluding float support */ +#endif +#ifndef UNITY_EXCLUDE_FLOAT_PRINT +#define UNITY_EXCLUDE_FLOAT_PRINT +#endif + +#else + +/* Floating Point Support */ +#ifndef UNITY_FLOAT_PRECISION +#define UNITY_FLOAT_PRECISION (0.00001f) +#endif +#ifndef UNITY_FLOAT_TYPE +#define UNITY_FLOAT_TYPE float +#endif +typedef UNITY_FLOAT_TYPE UNITY_FLOAT; + +/* isinf & isnan macros should be provided by math.h */ +#ifndef isinf +/* The value of Inf - Inf is NaN */ +#define isinf(n) (isnan((n) - (n)) && !isnan(n)) +#endif + +#ifndef isnan +/* NaN is the only floating point value that does NOT equal itself. + * Therefore if n != n, then it is NaN. */ +#define isnan(n) ((n != n) ? 1 : 0) +#endif + +#endif + +/*------------------------------------------------------- + * Double Float Support + *-------------------------------------------------------*/ + +/* unlike float, we DON'T include by default */ +#if defined(UNITY_EXCLUDE_DOUBLE) || !defined(UNITY_INCLUDE_DOUBLE) + + /* No Floating Point Support */ + #ifndef UNITY_EXCLUDE_DOUBLE + #define UNITY_EXCLUDE_DOUBLE + #else + #undef UNITY_INCLUDE_DOUBLE + #endif + + #ifndef UNITY_EXCLUDE_FLOAT + #ifndef UNITY_DOUBLE_TYPE + #define UNITY_DOUBLE_TYPE double + #endif + typedef UNITY_FLOAT UNITY_DOUBLE; + /* For parameter in UnityPrintFloat(UNITY_DOUBLE), which aliases to double or float */ + #endif + +#else + + /* Double Floating Point Support */ + #ifndef UNITY_DOUBLE_PRECISION + #define UNITY_DOUBLE_PRECISION (1e-12) + #endif + + #ifndef UNITY_DOUBLE_TYPE + #define UNITY_DOUBLE_TYPE double + #endif + typedef UNITY_DOUBLE_TYPE UNITY_DOUBLE; + +#endif + +/*------------------------------------------------------- + * Output Method: stdout (DEFAULT) + *-------------------------------------------------------*/ +#ifndef UNITY_OUTPUT_CHAR + /* Default to using putchar, which is defined in stdio.h */ + #include + #define UNITY_OUTPUT_CHAR(a) (void)putchar(a) +#else + /* If defined as something else, make sure we declare it here so it's ready for use */ + #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION + extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION; + #endif +#endif + +#ifndef UNITY_OUTPUT_FLUSH + #ifdef UNITY_USE_FLUSH_STDOUT + /* We want to use the stdout flush utility */ + #include + #define UNITY_OUTPUT_FLUSH() (void)fflush(stdout) + #else + /* We've specified nothing, therefore flush should just be ignored */ + #define UNITY_OUTPUT_FLUSH() + #endif +#else + /* If defined as something else, make sure we declare it here so it's ready for use */ + #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION + extern void UNITY_OUTPUT_FLUSH_HEADER_DECLARATION; + #endif +#endif + +#ifndef UNITY_OUTPUT_FLUSH +#define UNITY_FLUSH_CALL() +#else +#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH() +#endif + +#ifndef UNITY_PRINT_EOL +#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n') +#endif + +#ifndef UNITY_OUTPUT_START +#define UNITY_OUTPUT_START() +#endif + +#ifndef UNITY_OUTPUT_COMPLETE +#define UNITY_OUTPUT_COMPLETE() +#endif + +#ifdef UNITY_INCLUDE_EXEC_TIME + #if !defined(UNITY_EXEC_TIME_START) && \ + !defined(UNITY_EXEC_TIME_STOP) && \ + !defined(UNITY_PRINT_EXEC_TIME) && \ + !defined(UNITY_TIME_TYPE) + /* If none any of these macros are defined then try to provide a default implementation */ + + #if defined(UNITY_CLOCK_MS) + /* This is a simple way to get a default implementation on platforms that support getting a millisecond counter */ + #define UNITY_TIME_TYPE UNITY_UINT + #define UNITY_EXEC_TIME_START() Unity.CurrentTestStartTime = UNITY_CLOCK_MS() + #define UNITY_EXEC_TIME_STOP() Unity.CurrentTestStopTime = UNITY_CLOCK_MS() + #define UNITY_PRINT_EXEC_TIME() { \ + UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ + UnityPrint(" ("); \ + UnityPrintNumberUnsigned(execTimeMs); \ + UnityPrint(" ms)"); \ + } + #elif defined(_WIN32) + #include + #define UNITY_TIME_TYPE clock_t + #define UNITY_GET_TIME(t) t = (clock_t)((clock() * 1000) / CLOCKS_PER_SEC) + #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) + #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) + #define UNITY_PRINT_EXEC_TIME() { \ + UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ + UnityPrint(" ("); \ + UnityPrintNumberUnsigned(execTimeMs); \ + UnityPrint(" ms)"); \ + } + #elif defined(__unix__) || defined(__APPLE__) + #include + #define UNITY_TIME_TYPE struct timespec + #define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t) + #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) + #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) + #define UNITY_PRINT_EXEC_TIME() { \ + UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \ + execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \ + UnityPrint(" ("); \ + UnityPrintNumberUnsigned(execTimeMs); \ + UnityPrint(" ms)"); \ + } + #endif + #endif +#endif + +#ifndef UNITY_EXEC_TIME_START +#define UNITY_EXEC_TIME_START() do{}while(0) +#endif + +#ifndef UNITY_EXEC_TIME_STOP +#define UNITY_EXEC_TIME_STOP() do{}while(0) +#endif + +#ifndef UNITY_TIME_TYPE +#define UNITY_TIME_TYPE UNITY_UINT +#endif + +#ifndef UNITY_PRINT_EXEC_TIME +#define UNITY_PRINT_EXEC_TIME() do{}while(0) +#endif + +/*------------------------------------------------------- + * Footprint + *-------------------------------------------------------*/ + +#ifndef UNITY_LINE_TYPE +#define UNITY_LINE_TYPE UNITY_UINT +#endif + +#ifndef UNITY_COUNTER_TYPE +#define UNITY_COUNTER_TYPE UNITY_UINT +#endif + +/*------------------------------------------------------- + * Internal Structs Needed + *-------------------------------------------------------*/ + +typedef void (*UnityTestFunction)(void); + +#define UNITY_DISPLAY_RANGE_INT (0x10) +#define UNITY_DISPLAY_RANGE_UINT (0x20) +#define UNITY_DISPLAY_RANGE_HEX (0x40) +#define UNITY_DISPLAY_RANGE_CHAR (0x80) + +typedef enum +{ + UNITY_DISPLAY_STYLE_INT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_INT, + UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT, + UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT, + UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT, +#ifdef UNITY_SUPPORT_64 + UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT, +#endif + + UNITY_DISPLAY_STYLE_UINT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_UINT, + UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT, + UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT, + UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT, +#ifdef UNITY_SUPPORT_64 + UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT, +#endif + + UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX, + UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX, + UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX, +#ifdef UNITY_SUPPORT_64 + UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX, +#endif + + UNITY_DISPLAY_STYLE_CHAR = 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT, + + UNITY_DISPLAY_STYLE_UNKNOWN +} UNITY_DISPLAY_STYLE_T; + +typedef enum +{ + UNITY_WITHIN = 0x0, + UNITY_EQUAL_TO = 0x1, + UNITY_GREATER_THAN = 0x2, + UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO, + UNITY_SMALLER_THAN = 0x4, + UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO, + UNITY_NOT_EQUAL = 0x0, + UNITY_UNKNOWN +} UNITY_COMPARISON_T; + +#ifndef UNITY_EXCLUDE_FLOAT +typedef enum UNITY_FLOAT_TRAIT +{ + UNITY_FLOAT_IS_NOT_INF = 0, + UNITY_FLOAT_IS_INF, + UNITY_FLOAT_IS_NOT_NEG_INF, + UNITY_FLOAT_IS_NEG_INF, + UNITY_FLOAT_IS_NOT_NAN, + UNITY_FLOAT_IS_NAN, + UNITY_FLOAT_IS_NOT_DET, + UNITY_FLOAT_IS_DET, + UNITY_FLOAT_INVALID_TRAIT +} UNITY_FLOAT_TRAIT_T; +#endif + +typedef enum +{ + UNITY_ARRAY_TO_VAL = 0, + UNITY_ARRAY_TO_ARRAY, + UNITY_ARRAY_UNKNOWN +} UNITY_FLAGS_T; + +struct UNITY_STORAGE_T +{ + const char* TestFile; + const char* CurrentTestName; +#ifndef UNITY_EXCLUDE_DETAILS + const char* CurrentDetail1; + const char* CurrentDetail2; +#endif + UNITY_LINE_TYPE CurrentTestLineNumber; + UNITY_COUNTER_TYPE NumberOfTests; + UNITY_COUNTER_TYPE TestFailures; + UNITY_COUNTER_TYPE TestIgnores; + UNITY_COUNTER_TYPE CurrentTestFailed; + UNITY_COUNTER_TYPE CurrentTestIgnored; +#ifdef UNITY_INCLUDE_EXEC_TIME + UNITY_TIME_TYPE CurrentTestStartTime; + UNITY_TIME_TYPE CurrentTestStopTime; +#endif +#ifndef UNITY_EXCLUDE_SETJMP_H + jmp_buf AbortFrame; +#endif +}; + +extern struct UNITY_STORAGE_T Unity; + +/*------------------------------------------------------- + * Test Suite Management + *-------------------------------------------------------*/ + +void UnityBegin(const char* filename); +int UnityEnd(void); +void UnitySetTestFile(const char* filename); +void UnityConcludeTest(void); + +#ifndef RUN_TEST +void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum); +#else +#define UNITY_SKIP_DEFAULT_RUNNER +#endif + +/*------------------------------------------------------- + * Details Support + *-------------------------------------------------------*/ + +#ifdef UNITY_EXCLUDE_DETAILS +#define UNITY_CLR_DETAILS() +#define UNITY_SET_DETAIL(d1) +#define UNITY_SET_DETAILS(d1,d2) +#else +#define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; } +#define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = 0; } +#define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = (d2); } + +#ifndef UNITY_DETAIL1_NAME +#define UNITY_DETAIL1_NAME "Function" +#endif + +#ifndef UNITY_DETAIL2_NAME +#define UNITY_DETAIL2_NAME "Argument" +#endif +#endif + +#ifdef UNITY_PRINT_TEST_CONTEXT +void UNITY_PRINT_TEST_CONTEXT(void); +#endif + +/*------------------------------------------------------- + * Test Output + *-------------------------------------------------------*/ + +void UnityPrint(const char* string); + +#ifdef UNITY_INCLUDE_PRINT_FORMATTED +void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...); +#endif + +void UnityPrintLen(const char* string, const UNITY_UINT32 length); +void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number); +void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style); +void UnityPrintNumber(const UNITY_INT number_to_print); +void UnityPrintNumberUnsigned(const UNITY_UINT number); +void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print); + +#ifndef UNITY_EXCLUDE_FLOAT_PRINT +void UnityPrintFloat(const UNITY_DOUBLE input_number); +#endif + +/*------------------------------------------------------- + * Test Assertion Functions + *------------------------------------------------------- + * Use the macros below this section instead of calling + * these directly. The macros have a consistent naming + * convention and will pull in file and line information + * for you. */ + +void UnityAssertEqualNumber(const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, + const UNITY_INT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style, + const UNITY_FLAGS_T flags); + +void UnityAssertBits(const UNITY_INT mask, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber); + +void UnityAssertEqualString(const char* expected, + const char* actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber); + +void UnityAssertEqualStringLen(const char* expected, + const char* actual, + const UNITY_UINT32 length, + const char* msg, + const UNITY_LINE_TYPE lineNumber); + +void UnityAssertEqualStringArray( UNITY_INTERNAL_PTR expected, + const char** actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags); + +void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 length, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags); + +void UnityAssertNumbersWithin(const UNITY_UINT delta, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, + UNITY_INTERNAL_PTR expected, + UNITY_INTERNAL_PTR actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style, + const UNITY_FLAGS_T flags); + +#ifndef UNITY_EXCLUDE_SETJMP_H +void UnityFail(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn); +void UnityIgnore(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn); +#else +void UnityFail(const char* message, const UNITY_LINE_TYPE line); +void UnityIgnore(const char* message, const UNITY_LINE_TYPE line); +#endif + +void UnityMessage(const char* message, const UNITY_LINE_TYPE line); + +#ifndef UNITY_EXCLUDE_FLOAT +void UnityAssertFloatsWithin(const UNITY_FLOAT delta, + const UNITY_FLOAT expected, + const UNITY_FLOAT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber); + +void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected, + UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags); + +void UnityAssertFloatSpecial(const UNITY_FLOAT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLOAT_TRAIT_T style); +#endif + +#ifndef UNITY_EXCLUDE_DOUBLE +void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, + const UNITY_DOUBLE expected, + const UNITY_DOUBLE actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber); + +void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, + UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, + const UNITY_UINT32 num_elements, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLAGS_T flags); + +void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_FLOAT_TRAIT_T style); +#endif + +/*------------------------------------------------------- + * Helpers + *-------------------------------------------------------*/ + +UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size); +#ifndef UNITY_EXCLUDE_FLOAT +UNITY_INTERNAL_PTR UnityFloatToPtr(const float num); +#endif +#ifndef UNITY_EXCLUDE_DOUBLE +UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num); +#endif + +/*------------------------------------------------------- + * Error Strings We Might Need + *-------------------------------------------------------*/ + +extern const char UnityStrOk[]; +extern const char UnityStrPass[]; +extern const char UnityStrFail[]; +extern const char UnityStrIgnore[]; + +extern const char UnityStrErrFloat[]; +extern const char UnityStrErrDouble[]; +extern const char UnityStrErr64[]; +extern const char UnityStrErrShorthand[]; + +/*------------------------------------------------------- + * Test Running Macros + *-------------------------------------------------------*/ + +#ifndef UNITY_EXCLUDE_SETJMP_H +#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0) +#define TEST_ABORT() longjmp(Unity.AbortFrame, 1) +#else +#define TEST_PROTECT() 1 +#define TEST_ABORT() return +#endif + +/* This tricky series of macros gives us an optional line argument to treat it as RUN_TEST(func, num=__LINE__) */ +#ifndef RUN_TEST +#ifdef __STDC_VERSION__ +#if __STDC_VERSION__ >= 199901L +#define UNITY_SUPPORT_VARIADIC_MACROS +#endif +#endif +#ifdef UNITY_SUPPORT_VARIADIC_MACROS +#define RUN_TEST(...) RUN_TEST_AT_LINE(__VA_ARGS__, __LINE__, throwaway) +#define RUN_TEST_AT_LINE(func, line, ...) UnityDefaultTestRun(func, #func, line) +#endif +#endif + +/* If we can't do the tricky version, we'll just have to require them to always include the line number */ +#ifndef RUN_TEST +#ifdef CMOCK +#define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num) +#else +#define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__) +#endif +#endif + +#define TEST_LINE_NUM (Unity.CurrentTestLineNumber) +#define TEST_IS_IGNORED (Unity.CurrentTestIgnored) +#define UNITY_NEW_TEST(a) \ + Unity.CurrentTestName = (a); \ + Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \ + Unity.NumberOfTests++; + +#ifndef UNITY_BEGIN +#define UNITY_BEGIN() UnityBegin(__FILE__) +#endif + +#ifndef UNITY_END +#define UNITY_END() UnityEnd() +#endif + +#ifndef UNITY_SHORTHAND_AS_INT +#ifndef UNITY_SHORTHAND_AS_MEM +#ifndef UNITY_SHORTHAND_AS_NONE +#ifndef UNITY_SHORTHAND_AS_RAW +#define UNITY_SHORTHAND_AS_OLD +#endif +#endif +#endif +#endif + +/*----------------------------------------------- + * Command Line Argument Support + *-----------------------------------------------*/ + +#ifdef UNITY_USE_COMMAND_LINE_ARGS +int UnityParseOptions(int argc, char** argv); +int UnityTestMatches(void); +#endif + +/*------------------------------------------------------- + * Basic Fail and Ignore + *-------------------------------------------------------*/ + +#define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line)) +#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line)) + +/*------------------------------------------------------- + * Test Asserts + *-------------------------------------------------------*/ + +#define UNITY_TEST_ASSERT(condition, line, message) do {if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));}} while(0) +#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message)) +#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message)) +#define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message)) +#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (UNITY_LINE_TYPE)(line), (message)) + +#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) +#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line)) + +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16) (threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32) (threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_INT16) (expected), (UNITY_INT)(UNITY_INT16) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_INT32) (expected), (UNITY_INT)(UNITY_INT32) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) + + +#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) +#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line)) +#define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (UNITY_UINT32)(len), (message), (UNITY_LINE_TYPE)(line)) +#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) + +#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) + +#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT16)(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT32)(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_PTR_TO_INT) (expected), (UNITY_POINTER_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_VAL) + +#ifdef UNITY_SUPPORT_64 +#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) +#else +#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +#endif + +#ifdef UNITY_EXCLUDE_FLOAT +#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) +#else +#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UnityAssertFloatsWithin((UNITY_FLOAT)(delta), (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line)) +#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((UNITY_FLOAT)(expected) * (UNITY_FLOAT)UNITY_FLOAT_PRECISION, (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (UNITY_LINE_TYPE)(line), (message)) +#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((UNITY_FLOAT*)(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray(UnityFloatToPtr(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) +#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) +#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) +#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) +#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) +#endif + +#ifdef UNITY_EXCLUDE_DOUBLE +#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) +#else +#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UnityAssertDoublesWithin((UNITY_DOUBLE)(delta), (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line)) +#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((UNITY_DOUBLE)(expected) * (UNITY_DOUBLE)UNITY_DOUBLE_PRECISION, (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (UNITY_LINE_TYPE)(line), (message)) +#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((UNITY_DOUBLE*)(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray(UnityDoubleToPtr(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) +#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) +#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) +#endif + +/* End of UNITY_INTERNALS_H */ +#endif + +#endif /*LV_BUILD_TEST*/ diff --git a/lib/lvgl/tests/unity/unity_support.c b/lib/lvgl/tests/unity/unity_support.c new file mode 100644 index 00000000..6906bd22 --- /dev/null +++ b/lib/lvgl/tests/unity/unity_support.c @@ -0,0 +1,237 @@ +/** + * @file lv_test_assert.c + * + * Copyright 2002-2010 Guillaume Cottenceau. + * + * This software may be freely redistributed under the terms + * of the X11 license. + * + */ + +/********************* + * INCLUDES + *********************/ +#if LV_BUILD_TEST +#include "../lvgl.h" + +#include +#include +#include +#include +#include +#include "unity.h" +#define PNG_DEBUG 3 +#include + +/********************* + * DEFINES + *********************/ +//#define REF_IMGS_PATH "lvgl/tests/lv_test_ref_imgs/" +#define REF_IMGS_PATH "ref_imgs/" + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + int width, height; + png_byte color_type; + png_byte bit_depth; + + png_structp png_ptr; + png_infop info_ptr; + int number_of_passes; + png_bytep * row_pointers; +}png_img_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +static int read_png_file(png_img_t * p, const char* file_name); +static void png_release(png_img_t * p); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +bool lv_test_assert_img_eq(const char * fn_ref) +{ + char fn_ref_full[512]; + sprintf(fn_ref_full, "%s%s", REF_IMGS_PATH, fn_ref); + + png_img_t p; + int res = read_png_file(&p, fn_ref_full); + if(res < 0) return false; + uint8_t * screen_buf; + + lv_obj_invalidate(lv_scr_act()); + lv_refr_now(NULL); + + extern lv_color_t test_fb[]; + + screen_buf = (uint8_t *)test_fb; + + uint8_t * ptr_act = NULL; + const png_byte* ptr_ref = NULL; + + bool err = false; + int x, y, i_buf = 0; + for (y = 0; y < p.height; y++) { + png_byte* row = p.row_pointers[y]; + + for (x = 0; x < p.width; x++) { + ptr_ref = &(row[x*3]); + ptr_act = &(screen_buf[i_buf*4]); + + uint32_t ref_px = 0; + uint32_t act_px = 0; + memcpy(&ref_px, ptr_ref, 3); + memcpy(&act_px, ptr_act, 3); + //printf("0xFF%06x, ", act_px); + + uint8_t act_swap[3] = {ptr_act[2], ptr_act[1], ptr_act[0]}; + + if(memcmp(act_swap, ptr_ref, 3) != 0) { + err = true; + break; + } + i_buf++; + } + if(err) break; + } + + if(err) { + uint32_t ref_px = 0; + uint32_t act_px = 0; + memcpy(&ref_px, ptr_ref, 3); + memcpy(&act_px, ptr_act, 3); + + FILE * f = fopen("../test_screenshot_error.h", "w"); + + fprintf(f, "//Diff in %s at (%d;%d), %x instead of %x)\n\n", fn_ref, x, y, act_px, ref_px); + fprintf(f, "static const uint32_t test_screenshot_error_data[] = {\n"); + + i_buf = 0; + for (y = 0; y < 480; y++) { + fprintf(f, "\n"); + for (x = 0; x < 800; x++) { + ptr_act = &(screen_buf[i_buf * 4]); + act_px = 0; + memcpy(&act_px, ptr_act, 3); + fprintf(f, "0xFF%06X, ", act_px); + i_buf++; + } + } + fprintf(f, "};\n\n"); + + fprintf(f, "static lv_img_dsc_t test_screenshot_error_dsc = { \n" + " .header.w = 800,\n" + " .header.h = 480,\n" + " .header.always_zero = 0,\n" + " .header.cf = LV_IMG_CF_TRUE_COLOR,\n" + " .data_size = 800 * 480 * 4,\n" + " .data = test_screenshot_error_data};\n\n" + "static inline void test_screenshot_error_show(void)\n" + "{\n" + " lv_obj_t * img = lv_img_create(lv_scr_act());\n" + " lv_img_set_src(img, &test_screenshot_error_dsc);\n" + "}\n"); + + fclose(f); + + } + + + png_release(&p); + + return !err; + +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static int read_png_file(png_img_t * p, const char* file_name) +{ + char header[8]; // 8 is the maximum size that can be checked + + /*open file and test for it being a png*/ + FILE *fp = fopen(file_name, "rb"); + if (!fp) { + TEST_PRINTF("%s", "PNG file %s could not be opened for reading"); + return -1; + } + + size_t rcnt = fread(header, 1, 8, fp); + if (rcnt != 8 || png_sig_cmp((png_const_bytep)header, 0, 8)) { + TEST_PRINTF("%s is not recognized as a PNG file", file_name); + return -1; + } + + /*initialize stuff*/ + p->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + + if (!p->png_ptr) { + TEST_PRINTF("%s", "png_create_read_struct failed"); + return -1; + } + + p->info_ptr = png_create_info_struct(p->png_ptr); + if (!p->info_ptr) { + TEST_PRINTF("%s", "png_create_info_struct failed"); + return -1; + } + if (setjmp(png_jmpbuf(p->png_ptr))) { + TEST_PRINTF("%s", "Error during init_io"); + return -1; + } + png_init_io(p->png_ptr, fp); + png_set_sig_bytes(p->png_ptr, 8); + + png_read_info(p->png_ptr, p->info_ptr); + + p->width = png_get_image_width(p->png_ptr, p->info_ptr); + p->height = png_get_image_height(p->png_ptr, p->info_ptr); + p->color_type = png_get_color_type(p->png_ptr, p->info_ptr); + p->bit_depth = png_get_bit_depth(p->png_ptr, p->info_ptr); + + p->number_of_passes = png_set_interlace_handling(p->png_ptr); + png_read_update_info(p->png_ptr, p->info_ptr); + + /*read file*/ + if (setjmp(png_jmpbuf(p->png_ptr))) { + TEST_PRINTF("%s", "Error during read_image"); + return -1; + } + p->row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * p->height); + + int y; + for (y=0; yheight; y++) + p->row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(p->png_ptr,p->info_ptr)); + + png_read_image(p->png_ptr, p->row_pointers); + + fclose(fp); + return 0; +} + +static void png_release(png_img_t * p) +{ + int y; + for (y=0; yheight; y++) free(p->row_pointers[y]); + + free(p->row_pointers); + + png_destroy_read_struct(&p->png_ptr, &p->info_ptr, NULL); +} + + +#endif 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 +#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*/ + -- cgit v1.2.3