diff options
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/lv_test_indev.c | 10 | ||||
-rw-r--r-- | tests/src/lv_test_indev.h | 6 | ||||
-rw-r--r-- | tests/src/test_cases/draw/test_clip_corner.c | 2 | ||||
-rw-r--r-- | tests/src/test_cases/test_grid.c | 14 | ||||
-rw-r--r-- | tests/src/test_cases/test_margin_align.c | 2 | ||||
-rw-r--r-- | tests/src/test_cases/test_margin_flex.c | 2 | ||||
-rw-r--r-- | tests/src/test_cases/test_margin_grid.c | 6 | ||||
-rw-r--r-- | tests/src/test_cases/test_span.c | 4 | ||||
-rw-r--r-- | tests/src/test_cases/test_style.c | 2 | ||||
-rw-r--r-- | tests/src/test_cases/test_txt.c | 4 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_bar.c | 42 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_line.c | 8 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_slider.c | 4 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_switch.c | 8 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_table.c | 8 | ||||
-rw-r--r-- | tests/src/test_cases/widgets/test_textarea.c | 8 |
16 files changed, 65 insertions, 65 deletions
diff --git a/tests/src/lv_test_indev.c b/tests/src/lv_test_indev.c index bd9116163..66715cdd9 100644 --- a/tests/src/lv_test_indev.c +++ b/tests/src/lv_test_indev.c @@ -7,8 +7,8 @@ #include "lv_test_indev.h" #include "lv_test_init.h" -static lv_coord_t x_act; -static lv_coord_t y_act; +static int32_t x_act; +static int32_t y_act; static uint32_t key_act; static int32_t diff_act; static bool mouse_pressed; @@ -23,13 +23,13 @@ void lv_test_mouse_read_cb(lv_indev_t * indev, lv_indev_data_t * data) 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) +void lv_test_mouse_move_to(int32_t x, int32_t y) { x_act = x; y_act = y; } -void lv_test_mouse_move_by(lv_coord_t x, lv_coord_t y) +void lv_test_mouse_move_by(int32_t x, int32_t y) { x_act += x; y_act += y; @@ -45,7 +45,7 @@ void lv_test_mouse_release(void) mouse_pressed = false; } -void lv_test_mouse_click_at(lv_coord_t x, lv_coord_t y) +void lv_test_mouse_click_at(int32_t x, int32_t y) { lv_test_mouse_release(); lv_test_indev_wait(50); diff --git a/tests/src/lv_test_indev.h b/tests/src/lv_test_indev.h index 0d3490275..9fd20b133 100644 --- a/tests/src/lv_test_indev.h +++ b/tests/src/lv_test_indev.h @@ -11,11 +11,11 @@ extern "C" { void lv_test_mouse_read_cb(lv_indev_t * indev, 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_move_to(int32_t x, int32_t y); +void lv_test_mouse_move_by(int32_t x, int32_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_mouse_click_at(int32_t x, int32_t y); void lv_test_keypad_read_cb(lv_indev_t * indev, lv_indev_data_t * data); diff --git a/tests/src/test_cases/draw/test_clip_corner.c b/tests/src/test_cases/draw/test_clip_corner.c index 846856927..a26b71ab9 100644 --- a/tests/src/test_cases/draw/test_clip_corner.c +++ b/tests/src/test_cases/draw/test_clip_corner.c @@ -13,7 +13,7 @@ void tearDown(void) /* Function run after every test */ } -static lv_obj_t * create_panel(lv_coord_t radius, bool transform) +static lv_obj_t * create_panel(int32_t radius, bool transform) { lv_obj_t * parent = lv_obj_create(lv_screen_active()); lv_obj_set_style_pad_all(parent, 3, 0); diff --git a/tests/src/test_cases/test_grid.c b/tests/src/test_cases/test_grid.c index 4736554ac..37535a2b3 100644 --- a/tests/src/test_cases/test_grid.c +++ b/tests/src/test_cases/test_grid.c @@ -14,7 +14,7 @@ void tearDown(void) /* Function run after every test */ } -static void button_create(lv_obj_t * parent, const char * text, lv_coord_t x, lv_coord_t y) +static void button_create(lv_obj_t * parent, const char * text, int32_t x, int32_t y) { lv_obj_t * btn = lv_button_create(parent); lv_obj_set_grid_cell(btn, LV_GRID_ALIGN_STRETCH, x, 1, LV_GRID_ALIGN_STRETCH, y, 1); @@ -28,15 +28,15 @@ static void button_create(lv_obj_t * parent, const char * text, lv_coord_t x, lv void test_subgrid_row(void) { - const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; - const lv_coord_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; lv_obj_t * cont_main = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_main, 700, 300); lv_obj_center(cont_main); lv_obj_set_grid_dsc_array(cont_main, col_dsc, row_dsc); - const lv_coord_t col_dsc2[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t col_dsc2[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; lv_obj_t * cont_sub = lv_obj_create(cont_main); lv_obj_set_grid_cell(cont_sub, LV_GRID_ALIGN_STRETCH, 1, 2, LV_GRID_ALIGN_STRETCH, 1, 2); lv_obj_set_grid_dsc_array(cont_sub, col_dsc2, NULL); @@ -61,15 +61,15 @@ void test_subgrid_row(void) void test_subgrid_col(void) { - const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; - const lv_coord_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; lv_obj_t * cont_main = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_main, 700, 300); lv_obj_center(cont_main); lv_obj_set_grid_dsc_array(cont_main, col_dsc, row_dsc); - const lv_coord_t row_dsc2[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + const int32_t row_dsc2[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; lv_obj_t * cont_sub = lv_obj_create(cont_main); lv_obj_set_grid_cell(cont_sub, LV_GRID_ALIGN_STRETCH, 1, 2, LV_GRID_ALIGN_STRETCH, 1, 2); lv_obj_set_grid_dsc_array(cont_sub, NULL, row_dsc2); diff --git a/tests/src/test_cases/test_margin_align.c b/tests/src/test_cases/test_margin_align.c index 77f71dd76..cc2ce8d64 100644 --- a/tests/src/test_cases/test_margin_align.c +++ b/tests/src/test_cases/test_margin_align.c @@ -25,7 +25,7 @@ lv_obj_t * obj_create(lv_obj_t * parent, lv_color_t color) return obj; } -void obj_set_margin(lv_obj_t * obj, lv_coord_t left, lv_coord_t top, lv_coord_t right, lv_coord_t bottom) +void obj_set_margin(lv_obj_t * obj, int32_t left, int32_t top, int32_t right, int32_t bottom) { lv_obj_set_style_margin_left(obj, left, LV_PART_MAIN); lv_obj_set_style_margin_top(obj, top, LV_PART_MAIN); diff --git a/tests/src/test_cases/test_margin_flex.c b/tests/src/test_cases/test_margin_flex.c index aa334e883..bff9d17b1 100644 --- a/tests/src/test_cases/test_margin_flex.c +++ b/tests/src/test_cases/test_margin_flex.c @@ -25,7 +25,7 @@ lv_obj_t * obj_create(lv_obj_t * parent, lv_color_t color) return obj; } -void obj_set_margin(lv_obj_t * obj, lv_coord_t left, lv_coord_t top, lv_coord_t right, lv_coord_t bottom) +void obj_set_margin(lv_obj_t * obj, int32_t left, int32_t top, int32_t right, int32_t bottom) { lv_obj_set_style_margin_left(obj, left, LV_PART_MAIN); lv_obj_set_style_margin_top(obj, top, LV_PART_MAIN); diff --git a/tests/src/test_cases/test_margin_grid.c b/tests/src/test_cases/test_margin_grid.c index 01cd4282f..c9c030983 100644 --- a/tests/src/test_cases/test_margin_grid.c +++ b/tests/src/test_cases/test_margin_grid.c @@ -25,7 +25,7 @@ lv_obj_t * obj_create(lv_obj_t * parent, lv_color_t color) return obj; } -void obj_set_margin(lv_obj_t * obj, lv_coord_t left, lv_coord_t top, lv_coord_t right, lv_coord_t bottom) +void obj_set_margin(lv_obj_t * obj, int32_t left, int32_t top, int32_t right, int32_t bottom) { lv_obj_set_style_margin_left(obj, left, LV_PART_MAIN); lv_obj_set_style_margin_top(obj, top, LV_PART_MAIN); @@ -40,8 +40,8 @@ void test_grid(void) lv_obj_t * obj0 = active_screen; - static lv_coord_t row_dsc[M + 1]; - static lv_coord_t col_dsc[N + 1]; + static int32_t row_dsc[M + 1]; + static int32_t col_dsc[N + 1]; row_dsc[M] = LV_GRID_TEMPLATE_LAST; col_dsc[N] = LV_GRID_TEMPLATE_LAST; diff --git a/tests/src/test_cases/test_span.c b/tests/src/test_cases/test_span.c index fc32c2e3d..44098ae30 100644 --- a/tests/src/test_cases/test_span.c +++ b/tests/src/test_cases/test_span.c @@ -146,7 +146,7 @@ void test_spangroup_set_overflow_invalid_parameters_overflow_not_changed(void) void test_spangroup_set_indent(void) { - const lv_coord_t indent = 100; + const int32_t indent = 100; lv_spangroup_set_indent(spangroup, indent); @@ -198,7 +198,7 @@ void test_spangroup_get_max_lines_for_new_span_group(void) void test_spangroup_get_max_line_h(void) { - lv_coord_t max_line; + int32_t max_line; max_line = lv_spangroup_get_max_line_h(spangroup); diff --git a/tests/src/test_cases/test_style.c b/tests/src/test_cases/test_style.c index 26c51e657..fd5fd6130 100644 --- a/tests/src/test_cases/test_style.c +++ b/tests/src/test_cases/test_style.c @@ -6,7 +6,7 @@ static void obj_set_height_helper(void * obj, int32_t height) { - lv_obj_set_height((lv_obj_t *)obj, (lv_coord_t)height); + lv_obj_set_height((lv_obj_t *)obj, (int32_t)height); } void test_gradient_vertical_misalignment(void) diff --git a/tests/src/test_cases/test_txt.c b/tests/src/test_cases/test_txt.c index 6cff9727a..bd9958689 100644 --- a/tests/src/test_cases/test_txt.c +++ b/tests/src/test_cases/test_txt.c @@ -127,8 +127,8 @@ void test_txt_get_encoded_next_detect_invalid_4_byte_input(void) 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; + int32_t letter_space = 0; + int32_t max_width = 0; lv_text_flag_t flag = LV_TEXT_FLAG_NONE; uint32_t next_line = _lv_text_get_next_line("", font_ptr, letter_space, max_width, NULL, flag); diff --git a/tests/src/test_cases/widgets/test_bar.c b/tests/src/test_cases/widgets/test_bar.c index 1b12ca472..70eafb917 100644 --- a/tests/src/test_cases/widgets/test_bar.c +++ b/tests/src/test_cases/widgets/test_bar.c @@ -47,9 +47,9 @@ void test_bar_should_update_indicator_right_coordinate_based_on_bar_value(void) 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; + const int32_t style_padding = 5u; + const int32_t bar_width = 200u; + const int32_t bar_height = 20u; int32_t bar_value = 10u; lv_style_init(&bar_style); @@ -69,9 +69,9 @@ void test_bar_should_update_indicator_right_coordinate_based_on_bar_value(void) 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); + int32_t bar_max_value = lv_bar_get_max_value(bar); + int32_t indicator_part_width = lv_obj_get_content_width(bar); + int32_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; @@ -102,9 +102,9 @@ void test_bar_rtl_should_update_indicator_left_coordinate_based_on_bar_value(voi 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; + const int32_t style_padding = 5u; + const int32_t bar_width = 200u; + const int32_t bar_height = 20u; int32_t bar_value = 10u; lv_style_init(&bar_style); @@ -125,9 +125,9 @@ void test_bar_rtl_should_update_indicator_left_coordinate_based_on_bar_value(voi 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 bar_max_value = lv_bar_get_max_value(bar); + int32_t indicator_part_width = lv_obj_get_content_width(bar); + int32_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; @@ -138,12 +138,12 @@ void test_bar_rtl_should_update_indicator_left_coordinate_based_on_bar_value(voi void test_bar_normal(void) { - lv_coord_t w = 300; - lv_coord_t h = 40; - lv_coord_t h_gap = 20; - lv_coord_t w_gap = 20; - lv_coord_t y = h_gap; - lv_coord_t x = w_gap; + int32_t w = 300; + int32_t h = 40; + int32_t h_gap = 20; + int32_t w_gap = 20; + int32_t y = h_gap; + int32_t x = w_gap; lv_color_t bg_color = lv_color_black(); lv_color_t indic_color = lv_color_hex(0x0000FF); @@ -211,7 +211,7 @@ 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; + const int32_t style_padding = 10u; static lv_style_t bar_style; int32_t new_height = 0u; @@ -310,13 +310,13 @@ void test_bar_indicator_should_be_drawn_towards_the_min_range_side_after_setting lv_bar_set_value(bar, 1, LV_ANIM_OFF); lv_test_indev_wait(50); - lv_coord_t original_pos = bar_ptr->indic_area.x1; + int32_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; + int32_t final_pos = bar_ptr->indic_area.x1; TEST_ASSERT_LESS_THAN(original_pos, final_pos); } diff --git a/tests/src/test_cases/widgets/test_line.c b/tests/src/test_cases/widgets/test_line.c index 41f00a393..36b1d9f09 100644 --- a/tests/src/test_cases/widgets/test_line.c +++ b/tests/src/test_cases/widgets/test_line.c @@ -7,8 +7,8 @@ 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; +static const int32_t initial_extra_draw_size = 5U; +static const int32_t final_extra_draw_size = 10U; void setUp(void) { @@ -45,8 +45,8 @@ void test_line_size_should_be_updated_after_adding_points(void) uint16_t point_cnt = (uint16_t) sizeof(points) / sizeof(lv_point_precise_t); lv_line_set_points(line, points, point_cnt); - lv_coord_t calculated_width = 0; - lv_coord_t calculated_height = 0; + int32_t calculated_width = 0; + int32_t calculated_height = 0; /* Get the biggest coordinate on both axis */ uint16_t point_idx = 0; diff --git a/tests/src/test_cases/widgets/test_slider.c b/tests/src/test_cases/widgets/test_slider.c index 48d95fca1..024c2668f 100644 --- a/tests/src/test_cases/widgets/test_slider.c +++ b/tests/src/test_cases/widgets/test_slider.c @@ -34,8 +34,8 @@ void tearDown(void) 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); + int32_t objw = lv_obj_get_width(slider); + int32_t objh = lv_obj_get_height(slider); /* Horizontal slider */ TEST_ASSERT_TRUE(objw >= objh); diff --git a/tests/src/test_cases/widgets/test_switch.c b/tests/src/test_cases/widgets/test_switch.c index 26840e3fc..d962af282 100644 --- a/tests/src/test_cases/widgets/test_switch.c +++ b/tests/src/test_cases/widgets/test_switch.c @@ -94,16 +94,16 @@ void test_switch_animation(void) void test_switch_should_not_have_extra_draw_size_at_creation(void) { - lv_coord_t extra_size = _lv_obj_get_ext_draw_size(sw); + int32_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; + int32_t pad = 6; + int32_t actual = 0; + int32_t expected = pad + _LV_SWITCH_KNOB_EXT_AREA_CORRECTION; static lv_style_t style_knob; lv_style_init(&style_knob); diff --git a/tests/src/test_cases/widgets/test_table.c b/tests/src/test_cases/widgets/test_table.c index 393d72f41..3cb4f99c2 100644 --- a/tests/src/test_cases/widgets/test_table.c +++ b/tests/src/test_cases/widgets/test_table.c @@ -95,10 +95,10 @@ void test_table_row_height_should_increase_with_multiline_cell_value(void) 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]; + int32_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]; + int32_t multiline_row_height = table_ptr->row_h[0]; TEST_ASSERT_GREATER_THAN(singleline_row_height, multiline_row_height); } @@ -112,10 +112,10 @@ void test_table_should_wrap_long_texts(void) 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]; + int32_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]; + int32_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); diff --git a/tests/src/test_cases/widgets/test_textarea.c b/tests/src/test_cases/widgets/test_textarea.c index b5972c087..64e1f1541 100644 --- a/tests/src/test_cases/widgets/test_textarea.c +++ b/tests/src/test_cases/widgets/test_textarea.c @@ -48,10 +48,10 @@ void test_textarea_should_update_label_style_with_one_line_enabled(void) 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; + int32_t left_padding = lv_obj_get_style_pad_left(txt_ptr->label, LV_PART_MAIN); + int32_t right_padding = lv_obj_get_style_pad_right(txt_ptr->label, LV_PART_MAIN); + int32_t line_width = lv_obj_get_width(txt_ptr->label); + int32_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)); |