format code

This commit is contained in:
lixianjing 2021-04-20 18:25:27 +08:00
parent c56d50b3a1
commit 3c3ff112a4
10 changed files with 48 additions and 51 deletions

View File

@ -317,7 +317,7 @@ static ret_t combo_box_on_event(widget_t* widget, event_t* e) {
combo_box_sync_index_to_value(widget, combo_box->selected_index);
}
if (widget->text.size == 0 && widget->tr_text == NULL){
if (widget->text.size == 0 && widget->tr_text == NULL) {
combo_box_set_selected_index(widget, 0);
}
break;

View File

@ -15,7 +15,7 @@ static void* work_thread(void* args) {
uint32_t id = (uint32_t)tk_pointer_to_int(args);
log_debug("%u start\n", id);
for(i = 0; i < NR; i++) {
for (i = 0; i < NR; i++) {
app_conf_set_int("test.int", i);
app_conf_set_double("test.int", i);
app_conf_set_str("test.str", "foo");
@ -25,7 +25,6 @@ static void* work_thread(void* args) {
return NULL;
}
int main(int argc, char* argv[]) {
uint32_t i = 0;
tk_thread_t* threads[100];
@ -43,12 +42,12 @@ int main(int argc, char* argv[]) {
app_conf_set_int("test.int", 100);
app_conf_save();
for(i = 0; i < ARRAY_SIZE(threads); i++) {
for (i = 0; i < ARRAY_SIZE(threads); i++) {
threads[i] = tk_thread_create(work_thread, tk_pointer_from_int(i));
tk_thread_start(threads[i]);
}
for(i = 0; i < ARRAY_SIZE(threads); i++) {
for (i = 0; i < ARRAY_SIZE(threads); i++) {
tk_thread_join(threads[i]);
tk_thread_destroy(threads[i]);
log_debug("%u stop\n", i);

View File

@ -7,7 +7,6 @@
#include "base/window.h"
#include "lcd/lcd_mem_rgba8888.h"
TEST(TextEdit, basic) {
str_t str;
key_event_t keye;
@ -109,7 +108,7 @@ TEST(TextEdit, get_height) {
lcd_t* lcd = lcd_mem_rgba8888_create(100, 100, TRUE);
canvas_init(&c, lcd, font_manager());
const char* str = "it\nis\nok\nsecond line";
widget_t* win = window_create(NULL, 0, 0, 0,0);
widget_t* win = window_create(NULL, 0, 0, 0, 0);
widget_t* w = mledit_create(win, 10, 20, 30, 40);
text_edit_t* text_edit = text_edit_create(w, FALSE);
@ -123,5 +122,4 @@ TEST(TextEdit, get_height) {
widget_destroy(win);
text_edit_destroy(text_edit);
}