refactor: rename cnt to count
This commit is contained in:
@@ -17,33 +17,33 @@ void tearDown(void)
|
||||
void test_dropdown_create_delete(void)
|
||||
{
|
||||
lv_dropdown_create(lv_screen_active());
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(lv_screen_active()));
|
||||
|
||||
lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active());
|
||||
lv_obj_set_pos(dd2, 200, 0);
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_count(lv_screen_active()));
|
||||
TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2));
|
||||
lv_dropdown_open(dd2);
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_count(lv_screen_active()));
|
||||
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_screen_active()));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_count(lv_screen_active()));
|
||||
|
||||
lv_obj_t * dd3 = lv_dropdown_create(lv_screen_active());
|
||||
lv_obj_set_pos(dd3, 400, 0);
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_count(lv_screen_active()));
|
||||
lv_dropdown_open(dd3);
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_count(lv_screen_active()));
|
||||
lv_dropdown_close(dd3);
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_count(lv_screen_active()));
|
||||
lv_dropdown_close(dd3); /*Try to close again*/
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(6, lv_obj_get_child_count(lv_screen_active()));
|
||||
|
||||
lv_obj_delete(dd2);
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_count(lv_screen_active()));
|
||||
|
||||
lv_obj_clean(lv_screen_active());
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(lv_screen_active()));
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_count(lv_screen_active()));
|
||||
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ void test_dropdown_set_options(void)
|
||||
|
||||
lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active());
|
||||
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));
|
||||
TEST_ASSERT_EQUAL(3, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(6, lv_dropdown_get_option_count(dd1));
|
||||
|
||||
lv_obj_set_width(dd1, 200);
|
||||
lv_dropdown_open(dd1);
|
||||
@@ -70,41 +70,41 @@ void test_dropdown_set_options(void)
|
||||
|
||||
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));
|
||||
TEST_ASSERT_EQUAL(7, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(8, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(9, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(0, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(6, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(7, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(8, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(9, lv_dropdown_get_option_count(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));
|
||||
TEST_ASSERT_EQUAL(0, lv_dropdown_get_option_count(dd1));
|
||||
|
||||
lv_obj_delete(dd1);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ void test_obj_tree_2(void);
|
||||
|
||||
void test_obj_tree_1(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(lv_screen_active()), 0);
|
||||
}
|
||||
|
||||
void test_obj_tree_2(void)
|
||||
@@ -17,13 +17,13 @@ void test_obj_tree_2(void)
|
||||
lv_obj_create(lv_screen_active());
|
||||
lv_obj_t * o2 = lv_obj_create(lv_screen_active());
|
||||
lv_obj_create(lv_screen_active());
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 3);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(lv_screen_active()), 3);
|
||||
|
||||
lv_obj_delete(o2);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 2);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(lv_screen_active()), 2);
|
||||
|
||||
lv_obj_clean(lv_screen_active());
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(lv_screen_active()), 0);
|
||||
|
||||
lv_color_t c1 = lv_color_hex(0x444444);
|
||||
lv_color_t c2 = lv_color_hex3(0x444);
|
||||
@@ -52,11 +52,11 @@ void test_obj_tree_3(void)
|
||||
TEST_ASSERT_EQUAL(child2_parent_before, parent2);
|
||||
|
||||
/* were the children set correctly for the parents? */
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(parent1), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(parent1), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_index(child1), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child(parent1, 0), child1);
|
||||
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(parent2), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(parent2), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_index(child2), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child(parent2, 0), child2);
|
||||
|
||||
@@ -71,11 +71,11 @@ void test_obj_tree_3(void)
|
||||
TEST_ASSERT_EQUAL(child2_parent_after, parent1);
|
||||
|
||||
/* test for correctly set children */
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(parent1), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(parent1), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_index(child2), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child(parent1, 0), child2);
|
||||
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(parent2), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child_count(parent2), 1);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_index(child1), 0);
|
||||
TEST_ASSERT_EQUAL(lv_obj_get_child(parent2, 0), child1);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void test_roller_get_selected_option(void)
|
||||
char * expected_index_str = "Three";
|
||||
|
||||
/* Select the last option, index starts at 0 */
|
||||
uint16_t option_count = lv_roller_get_option_cnt(roller);
|
||||
uint16_t option_count = lv_roller_get_option_count(roller);
|
||||
lv_roller_set_selected(roller, option_count - 1, LV_ANIM_OFF);
|
||||
|
||||
actual_index = lv_roller_get_selected(roller);
|
||||
@@ -82,7 +82,7 @@ void test_roller_get_selected_option_truncated_buffer(void)
|
||||
char * expected_index_str = "Th";
|
||||
|
||||
/* Select the last option, index starts at 0 */
|
||||
uint16_t option_count = lv_roller_get_option_cnt(roller);
|
||||
uint16_t option_count = lv_roller_get_option_count(roller);
|
||||
lv_roller_set_selected(roller, option_count - 1, LV_ANIM_OFF);
|
||||
|
||||
/* Get the index string */
|
||||
@@ -98,7 +98,7 @@ void test_roller_infinite_mode_get_selected_option(void)
|
||||
int16_t actual_index = 0;
|
||||
|
||||
/* Select the last option of page 2 */
|
||||
uint16_t option_count = lv_roller_get_option_cnt(roller_infinite);
|
||||
uint16_t option_count = lv_roller_get_option_count(roller_infinite);
|
||||
option_count = (option_count * 2) - 1;
|
||||
lv_roller_set_selected(roller_infinite, option_count, LV_ANIM_OFF);
|
||||
|
||||
@@ -177,7 +177,7 @@ void test_roller_with_overlay_and_bubble_events_enabled(void)
|
||||
// lv_group_add_obj(g, roller_infinite);
|
||||
//
|
||||
// /* Select the last option of page 2 */
|
||||
// uint16_t option_count = lv_roller_get_option_cnt(roller_infinite);
|
||||
// uint16_t option_count = lv_roller_get_option_count(roller_infinite);
|
||||
// option_count = (option_count * 2) - 1;
|
||||
// lv_roller_set_selected(roller_infinite, option_count, LV_ANIM_OFF);
|
||||
//
|
||||
|
||||
@@ -35,7 +35,7 @@ void test_spangroup_new_span_with_null_parameter_returns_null_object(void)
|
||||
lv_span_t * span = lv_spangroup_new_span(NULL);
|
||||
|
||||
TEST_ASSERT(NULL == span);
|
||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_cnt(spangroup));
|
||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup));
|
||||
}
|
||||
|
||||
void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void)
|
||||
@@ -43,7 +43,7 @@ void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void)
|
||||
lv_span_t * span = lv_spangroup_new_span(spangroup);
|
||||
|
||||
TEST_ASSERT(NULL != span);
|
||||
TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_cnt(spangroup));
|
||||
TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_conut(spangroup));
|
||||
}
|
||||
|
||||
void test_spangroup_delete_span_span_is_null(void)
|
||||
@@ -52,7 +52,7 @@ void test_spangroup_delete_span_span_is_null(void)
|
||||
|
||||
lv_spangroup_delete_span(spangroup, span);
|
||||
|
||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_cnt(spangroup));
|
||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup));
|
||||
}
|
||||
|
||||
void test_span_set_text(void)
|
||||
@@ -249,12 +249,12 @@ void test_spangroup_get_child(void)
|
||||
TEST_ASSERT_EQUAL_PTR(span_1, lv_spangroup_get_child(spangroup, span_1_idx));
|
||||
}
|
||||
|
||||
void test_spangroup_get_child_cnt(void)
|
||||
void test_spangroup_get_child_conut(void)
|
||||
{
|
||||
(void)lv_spangroup_new_span(spangroup);
|
||||
(void)lv_spangroup_new_span(spangroup);
|
||||
|
||||
const uint32_t cnt = lv_spangroup_get_child_cnt(spangroup);
|
||||
const uint32_t cnt = lv_spangroup_get_child_conut(spangroup);
|
||||
|
||||
TEST_ASSERT_EQUAL(2, cnt);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void test_table_should_return_assigned_cell_value(void)
|
||||
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);
|
||||
uint16_t original_column_count = lv_table_get_col_count(table);
|
||||
TEST_ASSERT_EQUAL_UINT16(1, original_column_count);
|
||||
|
||||
/* Table currently only has a cell at 0,0 (row, column) */
|
||||
@@ -39,7 +39,7 @@ void test_table_should_grow_columns_automatically_when_setting_formatted_cell_va
|
||||
|
||||
/* 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));
|
||||
TEST_ASSERT_EQUAL_UINT16(expected_column_count, lv_table_get_col_count(table));
|
||||
}
|
||||
|
||||
void test_table_should_identify_cell_with_ctrl(void)
|
||||
@@ -169,8 +169,8 @@ void test_table_rendering(void)
|
||||
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_count(table, 5);
|
||||
lv_table_set_row_count(table, 5);
|
||||
lv_table_set_col_width(table, 1, 60);
|
||||
lv_table_set_col_width(table, 2, 100);
|
||||
|
||||
@@ -207,8 +207,8 @@ void test_table_should_reduce_cells(void)
|
||||
|
||||
lv_obj_center(table);
|
||||
|
||||
lv_table_set_col_cnt(table, initial_col_num);
|
||||
lv_table_set_row_cnt(table, initial_row_num);
|
||||
lv_table_set_col_count(table, initial_col_num);
|
||||
lv_table_set_row_count(table, initial_row_num);
|
||||
|
||||
uint32_t row_idx, col_idx;
|
||||
for(row_idx = 0; row_idx < initial_row_num; row_idx++) {
|
||||
@@ -217,8 +217,8 @@ void test_table_should_reduce_cells(void)
|
||||
}
|
||||
}
|
||||
|
||||
lv_table_set_col_cnt(table, final_col_num);
|
||||
lv_table_set_row_cnt(table, final_row_num);
|
||||
lv_table_set_col_count(table, final_col_num);
|
||||
lv_table_set_row_count(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++) {
|
||||
@@ -237,8 +237,8 @@ void test_table_should_reduce_cells_with_more_than_one_row(void)
|
||||
|
||||
lv_obj_center(table);
|
||||
|
||||
lv_table_set_col_cnt(table, initial_col_num);
|
||||
lv_table_set_row_cnt(table, initial_row_num);
|
||||
lv_table_set_col_count(table, initial_col_num);
|
||||
lv_table_set_row_count(table, initial_row_num);
|
||||
|
||||
uint32_t row_idx, col_idx;
|
||||
for(row_idx = 0; row_idx < initial_row_num; row_idx++) {
|
||||
@@ -247,8 +247,8 @@ void test_table_should_reduce_cells_with_more_than_one_row(void)
|
||||
}
|
||||
}
|
||||
|
||||
lv_table_set_col_cnt(table, final_col_num);
|
||||
lv_table_set_row_cnt(table, final_row_num);
|
||||
lv_table_set_col_count(table, final_col_num);
|
||||
lv_table_set_row_count(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++) {
|
||||
|
||||
@@ -29,7 +29,7 @@ void test_win_should_have_valid_documented_default_values(void)
|
||||
TEST_ASSERT_NOT_NULL(win);
|
||||
|
||||
// Check that the correct children have been created
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(win));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(win));
|
||||
|
||||
header = lv_win_get_header(win);
|
||||
content = lv_win_get_content(win);
|
||||
@@ -39,10 +39,10 @@ void test_win_should_have_valid_documented_default_values(void)
|
||||
|
||||
// Check that the header is correctly sized and empty
|
||||
TEST_ASSERT_EQUAL(lv_display_get_dpi(lv_obj_get_disp(win)) / 2, lv_obj_get_height(header));
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(header));
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_count(header));
|
||||
|
||||
// Check that the content is empty
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(content));
|
||||
TEST_ASSERT_EQUAL(0, lv_obj_get_child_count(content));
|
||||
}
|
||||
|
||||
void test_win_add_title_single(void)
|
||||
@@ -57,8 +57,8 @@ void test_win_add_title_single(void)
|
||||
|
||||
// Check that no additional children have been created under win
|
||||
// Instead the child should be created under header
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(win));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(header));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(win));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(header));
|
||||
|
||||
// Check that the title is a label and has been created properly
|
||||
lv_obj_t * title = lv_obj_get_child(header, 0);
|
||||
@@ -79,8 +79,8 @@ void test_win_add_title_multiple(void)
|
||||
|
||||
// Check that no additional children have been created under win
|
||||
// Instead the child should be created under header
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(win));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(header));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(win));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(header));
|
||||
}
|
||||
|
||||
void test_win_add_button(void)
|
||||
@@ -98,12 +98,12 @@ void test_win_add_button(void)
|
||||
|
||||
// Check that no additional children have been created under win
|
||||
// Instead the child should be created under header
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(win));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(header));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(win));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(header));
|
||||
|
||||
// Check that the button has been created properly
|
||||
lv_obj_t * btn = lv_obj_get_child(header, 0);
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(btn));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn));
|
||||
TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn));
|
||||
|
||||
// Check the output remains visually consistent
|
||||
@@ -130,12 +130,12 @@ void test_win_add_multiple_elements(void)
|
||||
|
||||
// Check that no additional children have been created under win
|
||||
// Instead the child should be created under header
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(win));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(header));
|
||||
TEST_ASSERT_EQUAL(2, lv_obj_get_child_count(win));
|
||||
TEST_ASSERT_EQUAL(4, lv_obj_get_child_count(header));
|
||||
|
||||
// Check that the left button has been created properly
|
||||
btn = lv_obj_get_child(header, 0);
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(btn));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn));
|
||||
TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn));
|
||||
|
||||
// Check that the title is a label and has been created properly
|
||||
@@ -145,12 +145,12 @@ void test_win_add_multiple_elements(void)
|
||||
|
||||
// Check that the right button has been created properly
|
||||
btn = lv_obj_get_child(header, 2);
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(btn));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn));
|
||||
TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn));
|
||||
|
||||
// Check that the close button has been created properly
|
||||
btn = lv_obj_get_child(header, 3);
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_cnt(btn));
|
||||
TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn));
|
||||
TEST_ASSERT_EQUAL(win_button_close_width, lv_obj_get_width(btn));
|
||||
|
||||
// Check the output remains visually consistent
|
||||
|
||||
Reference in New Issue
Block a user