diff --git a/src/streams/serial/iostream_serial.c b/src/streams/serial/iostream_serial.c index c9ed7f7555..2d288a4181 100644 --- a/src/streams/serial/iostream_serial.c +++ b/src/streams/serial/iostream_serial.c @@ -138,7 +138,7 @@ static tk_ostream_t* tk_iostream_serial_get_ostream(tk_iostream_t* stream) { tk_iostream_t* tk_iostream_serial_create(const char* port) { tk_object_t* obj = NULL; - serial_handle_t fd = NULL; + serial_handle_t fd = (serial_handle_t)NULL; tk_iostream_serial_t* iostream_serial = NULL; return_value_if_fail(port != NULL, NULL); diff --git a/tests/conf_json_test.cc b/tests/conf_json_test.cc index 227a2f4014..26da3678c9 100644 --- a/tests/conf_json_test.cc +++ b/tests/conf_json_test.cc @@ -779,6 +779,7 @@ TEST(ConfJson, comment) { const char* data = "\ {\ \"log_message\": {\ + \"a\":1,\"b\":2,\ \"enable\": true, /*是否启用告警信息*/\ \"fields_count\": 4, /*告警信息中带的字段个数: 级别 | 时间 | 设备 | 信息*/\ \"fields_seperator\": \"|\", /*字段之间的分隔符*/\ @@ -786,6 +787,8 @@ const char* data = "\ }\ }"; conf_doc_t* doc = conf_doc_load_json(data, -1); + ASSERT_EQ(conf_doc_get_int(doc, "log_message.a", 0), 1); + ASSERT_EQ(conf_doc_get_int(doc, "log_message.b", 0), 2); ASSERT_EQ(conf_doc_get_int(doc, "log_message.fields_count", 0), 4); ASSERT_EQ(conf_doc_get_int(doc, "log_message.max_rows", 0), 1000);