mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(table): set row count to zero (#4937)
This commit is contained in:
parent
accd0cb519
commit
f6eefe8eeb
@ -218,7 +218,7 @@ void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt)
|
||||
uint32_t new_cell_cnt = table->col_cnt * table->row_cnt;
|
||||
uint32_t i;
|
||||
for(i = new_cell_cnt; i < old_cell_cnt; i++) {
|
||||
if(table->cell_data[i]->user_data) {
|
||||
if(table->cell_data[i] && table->cell_data[i]->user_data) {
|
||||
lv_free(table->cell_data[i]->user_data);
|
||||
table->cell_data[i]->user_data = NULL;
|
||||
}
|
||||
|
@ -17,6 +17,13 @@ void tearDown(void)
|
||||
lv_obj_clean(lv_screen_active());
|
||||
}
|
||||
|
||||
void test_table_should_set_row_count_to_zero(void)
|
||||
{
|
||||
lv_table_set_row_count(table, 0);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT32(0, lv_table_get_row_count(table));
|
||||
}
|
||||
|
||||
void test_table_should_return_assigned_cell_value(void)
|
||||
{
|
||||
uint16_t row = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user