10 bits is already enough for normally used ease functions(ease, ease-in, ease-out, ease-in-out).
14 bits provides more accuracy and requires additional shift operation.
>14bits provices more accuracy but requires 64bit calculation and additional shift operation.
Add normally used ease function in test.
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
* test(label) Add initial test for constructor
* test(label) Add tests for recolor
* cleanup(label): lv_label_event
* test(label) set text tests
* test(label) Add tests for lv_label_get_letter_pos
* chore(label) Const where possible in lv_label_get_letter_pos
* test(label) Add tests for lv_label_is_char_under_pos
* chore(label) Add const when possible to lv_label_is_char_under_pos
* test(label) Add simple test for lv_label_cut_text
* chore(label) Cleanup lv_label_revert_dots a bit
* test(label) Make tests pass on Build OPTIONS_MINIMAL_MONOCHROME
* test(label) Initial tests for lv_label_get_letter_on
* chore(label) Introduce calculate_x_coordinate helper
* chore(label) Use calculate_x_coordinate in lv_label_get_letter_on
* chore(label) Reduce varible scope in lv_label_get_letter_on
* chore(label) Use calculate_x_coordinate in lv_label_get_letter_pos
This also reduces complexity of lv_label_get_letter_pos from 21 to 19 (measured using python package 'ravioli')
* chore(label) Remove extra lv_anim_set_exec_cb on lv_label_refr_text
* chore(label) Minor edits on docs
* test(label): Remove unfinished tests
* test(label): Add tests for text selection
* Update lv_label.c
Fix formatting
Kconfig and MicroPython config is not updated yet.
* start to refactor lv_conf.h
* further mem refactoring
* create lv_mem_builtin.c/h
* update lv_conf_internal.h
* add lv_strlen and lv_strncpy
* rename LV_DRAW_COMPLEX to LV_USE_DRAW_MASK
* update lv_conf_template
* minor fix
* slider: Refactor LV_SLIDER_KNOB_COORD and draw_knob
The `hor` parameter of this macro was always true, ending up always using the
left side of the ternary operator, with this refactor we eliminate the `hor`
parameter and remove the ternary operator it was used for.
This macro is only used in the `draw_knob` event handler, so it helps with its
initial cleanup.
* test(slider): Test documented default properties
* test(slider): Tests for LV_EVENT_KEY with valid and invalid keys
* feat(slider): Add helper to know if slider is horizontal
* chore(slider): Cleanup LV_EVENT_PRESSING handler
Reduce scope of variables where possible and use LV_CLAMP
* chore(slider): Cleanup draw_knob
* test(slider): Add tests for LV_EVENT_RELEASED
* test(slider): Add note about left_knob_focus
* test(slider): Initial test for hit test
* test(slider): Add tests for different slider modes
* chore(slider): cleanup draw_knob
* chore(slider): Cleanup position_knob
* test(slider): Move group configuration to setUp
* test(slider): Refactor tests with feedback
* add test_ranged_mode_adjust_with_encoder
* code formatting
* tests(slider): Remove direct usages of left_knob_focus
* test(slider): Remove unused variable
* Revert "test(slider): Refactor tests with feedback"
This reverts commit b274f829ec.
* test(slider): Add missing variable
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(line): Test y invert field
* test(line): Validate documented default values
* test(line): Assert line is not clickable after construction
* test(line): Test line size calculation
* chore(line): Refactor LV_EVENT_GET_SELF_SIZE handling
Return early when no point_array is set or point_num is 0
* chore(line): Cleanup LV_EVENT_DRAW_MAIN handling
Reduce scope of point variables
* test(line): Clean screen on tearDown
* test(line): Add initial test for extra draw size calculation
* test(line): Fix extra draw size test
* test(table): Replicate issue when reducing table cells
See #3120 for report
* test(table): Cell reduction test without use after free
Set the row count to 1 to be able to have a passing test, now we can track
down the real bug, which is triggered when having more than 1 row in the table.
* test(table): Add failing test for cell reduction
This test currently triggers the use after free bug
* chore(table): No-op when new and current row and columns counts are equal
* chore(table): Clean up lv_table_set_col_cnt
* chore(table): Add comments to get_row_height
* chore(table): Minor format cleanup and comment of cell_data layout
* fix ASAN arror
* minor fixes
* chore(table): Restore comments to get_row_height
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(textarea): Password mode
* test(textarea): label style with one line enabled
* test(textarea): Cursor click pos
* chore(textarea): Move auto hide to helper
* test(textarea): Placeholder text
* test(textarea): Default properties values
* test(textarea): Remove assert from one line test
* tests(textarea): Remove unused variables
* feat/textarea: Add and use is_valid_but_non_printable_char
* chore/textarea: General cleanup
* test(textarea): Accepted chars
* Update src/widgets/lv_textarea.c
* test(textarea): Assert text is empty after widget creation
* test(textarea): Update test for label style with one line enabled
* test(textarea): Add default text helper and use it
* test(textarea): Ignore line break chars in one line mode
* textarea: Check for line break chars sooner when adding char
* textarea: Start refactor of insert_handler
* textarea: Add comments to insert_handler
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(table): Happy path test for set_cell_value
* table: Abstract char configuration on set_cell_value
Abstract bytes to allocate calculation and txt copying
* table: Add missing &
* table: Update helper names
* test(table): Add test for column increasing when setting a formatted cell value
* table: Increase table columns when needed
* test(table): Fix test_table_should_grow_columns_automatically_when_setting_formatted_cell_value
* table: Fix code formatting
* test(table): Add test for cell ctrl
* table: Refactor draw_main low hanging fruits
* lv_table: Initial refactor of get_row_height
Mostly early breaks on loops and reducing variable scope where possible
* lv_table: Initial refactor of refr_size
Adding const wherever is possible
* lv_table: Further cleanup get_row_height
* lv_table: Cleanup loop in draw_main
* lv_table: Fix -Werror=shadow compilation error
* test(table): Tests for cell ctrl clearance
* lv_table: Rename index to idx
* lv_table: Use helper to know if cell is empty
* test(table): Comment assumptions to column grow test
* test(table): Row height with multi line cell value
* test(table): Wrap on long texts and increase row height
* add rendering test
* fix warnings
* fix out of bounds indexig
* fix rendering test
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* Try to fix ASAN behavior
* improve alignments
* fix buffer overflow and various other fixes
* minor fixes
* formatting
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(bar) Add test for docummented default attributes
* test(bar) Update test for docummented default attributes
* test(bar): Indicator width tracks value
* test(bar) Calculate bar indicator width based on its style
Take padding, max value and bar value into consideraion
* test(bar) Indicator area gets smaller when increasing padding in LV_PART_MAIN style
* test(bar) Start value changes only when in range mode
* docs(bar): Add missing MODE to symbols
* test(bar) Start value should be smaller than current value
* test(bar): Test current value truncation to max and min value
* bar: Check bar mode in lv_bar_set_start_value
bar start_value can be changed only when bar is in LV_BAR_MODE_RANGE mode.
Return early when it's not.
* test(bar): Fix width calculation test
* bar: Initialize indic_area in constructor
* test(bar): Refactor indicator coordinate update test
* test(bar): Indicator negative value in symmetrical mode
* test(bar): Fix base direction
* test(bar): Indicator coord test for RTL base dir
* test(switch): Add test file and state at creation test
* test(switch): Event handler called only once per click
* test(switch): Add test state change when event bubbling is enabled
* test(switch): Cleanup event bubbling test
* tests(switch): Update memory test and add basic animation test
* test(switch) Add helper to click on switch
* test(switch) Add basic test for knob size calculation
* misc(switch) Replace switch knob rounding error magic number with define
* test(switch) Improve animation test
Properly wait for 50ms after clicking on the switch using lv_test_indev_wait and also assert on switch state after the first and second clicks
* test(switch) cleanup
* misc(switch) Cleanup
* switch: Expose _LV_SWITCH_KNOB_EXT_AREA_CORRECTION value
So we can use it when testing extra draw size
* test(txt): Add test for identifying empty text when trying to get next line
* test(txt): Rename next line empty string handling test
* test(txt): Add tests for _lv_txt_is_cmd
* test(txt): Add initial tests for _lv_txt_ins
* fix(txt): Check for NULL before using strlen
Passing NULL to strlen is not defined, so we should avoid it
* txt: Update docs
Remove docs from source file and add comment about pointers to NULL terminated arrays where necessary
* txt: Misc update in encoded_size
* test(txt): first tests for _lv_txt_cut
* tests: Remove -Wmissing-prototype flag from compilation
This will allow us to have cleaner test cases files.
* test(txt): Remove test (funtion) prototypes as they're no longer necessary
* Update src/misc/lv_txt.h
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* Update src/misc/lv_txt.h
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* Revert "tests: Remove -Wmissing-prototype flag from compilation"
This reverts commit 8b3217de8d.
* test(txt): Use pragma to disable missing-prototype warning
* test: use extended set of compile options for test cases
* Revert "test(txt): Use pragma to disable missing-prototype warning"
This reverts commit 64909e30ed.
* test(txt): Add assert to test_txt_cut_len_longer_than_string test
* test(txt): Add test for _lv_txt_encoded_next on valid ascii input
* test(txt): Add tests for _lv_txt_encoded_next with 2 byte long inputs
* test(txt): Add tests for _lv_txt_encoded_next with 3 byte long inputs
* test(txt): Add tests for _lv_txt_encoded_next with 4 byte long inputs
* cleanup(txt): Add helper macros to identify ASCII and UTF8 codes
* cleanup(txt): Add missing LV_ prefix to helper macros
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
* test(arc): Add test for valid creation
* test(arc): Add test for max value truncation
* test(arc): Add test for min value truncation
* test(arc): Add test for value adjustment after updating range
* test(arc): Update test for min value truncation
* test(arc): Add test for angle updating after changing to symmetrical mode
* test(arc): Add test for angle updating after changing to symmetrical mode and value is greater than middle range
* test(arc): Use unity setUp function
* remove API comments from lv_arc.c
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(checkbox): Add initial test for checkbox
* test(checkbox): Add test_checkbox_should_have_default_text_when_created
* test(checkbox): Add test_checkbox_should_return_dinamically_allocated_text
* test(checkbox): Add initial tests for static text
Tests are failing tho
* test(arc): Rename bugfix test to arc
Also adds reference to issue in a comment
* test(checkbox): Tests for static text passes
* test(checkbox): Remove test for memory freeing when static text is refreshed
NULL isn't a valid parameter in lv_checkbox_set_text_static
Create one GitHub workflow job for each build option build
or test execution. This allows each of the five builds to
be executed in parallel as well as making it easier to
navigate to the test output as it now resides in its own
job.
This change **does** change the command-line arguments to
the test execution script. This is required to allow the
build options name to be passed in.
New `tests/main.py` command-line help:
```
usage: main.py [-h] [--build-options BUILD_OPTIONS] [--clean]
[--report]
[{build,test} [{build,test} ...]]
Build and/or run LVGL tests.
positional arguments:
{build,test} build: compile build tests, test:
compile/run executable tests.
optional arguments:
-h, --help show this help message and exit
--build-options BUILD_OPTIONS
the build option name to build or run.
When omitted all build configurations
are used.
--clean clean existing build artifacts before
operation.
--report generate code coverage report for
tests.
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.
```
Simplifies `tests/main.py` as it no longer needs to invoke
tests individually or keep track of and report their pass/fail
status.
Also enables the ability to run tests in parallel, support timeouts,
and re-run flaky tests.
https://cmake.org/cmake/help/latest/manual/ctest.1.html
Simplified workflow and documentation, by moving the
development package prerequisites into a new build script
`scripts/install-prerequisites.sh`.
Also, moved prerequisite installation into its own CI step and
removed explicit working directory change as it is no longer
needed (`main.py` does it).
* Convert tests/Makefile to a cmake project file.
This change switches the building of LVGL tests to use cmake
which is more portable than make. Additionally, whenever
cmake can be used, instead of the Python script (`main.py`),
the former is preferred.
The interface to `main.py` is unchanged, and tests are built
and executated the same as before.
This closes https://github.com/lvgl/lvgl/issues/2474.
* Installing `gcovr` in GitHub workflow.
* Documented steps to install libpng-dev.
* Added missing stdout flush when running tests.
* Grammar tweak in README.
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* Refactor unit test scripts.
Does the following:
1. Remove as many dependencies on the operating system shell as possible.
For example, use of shutil.rmtree(...) instead of os.system('rm -r ...').
This brings this script a bit closer to being able to run on Windows.
2. Switch from os.system() to subprocess.check_call().
* This is a bit more secure as check_call() directly invokes the subprocess
without evaluation the arguments on a command-line.
* Removes the need to evaluate the return code as check_call() does this.
* Can directly set environment variables (e.g. env=cmd_env) instead of
including with subprocess invocation (e.g. BIN=test.bin).
3. Minor cleanup to main.py sys.argv parsing.
4. PEP8 formatting.
* Ignore FileNotFoundError for rmtree('report').
* Back to os.system for gcovr.
* Removed unused shutil import.
* perf(draw) reimplement circle drawing algorithms
Imporve the speed of circle drawing
Add circle draw caching
Various other speed improvements
* docs describe how to use masks
* fix(draw) add missing GC root usage
Add lv_<widget>_draw_part_type_t to widgets to precisly describe the hooked drawings.
Also add class_p element to lv_obj_draw_part_dsc_t to show what widgets lv_<widget>_draw_part_type_t needs to be used.
Related to: https://forum.lvgl.io/t/how-to-add-minor-division-lines-to-a-chart/5366/