format code

This commit is contained in:
xianjimli 2020-09-09 11:18:41 +08:00
parent 9f8409b98a
commit fee05fd1ff
3 changed files with 24 additions and 24 deletions

View File

@ -173,7 +173,8 @@ ret_t tk_istream_read_line_str(tk_istream_t* stream, str_t* str) {
int32_t size = 0;
bool_t got_end_line = FALSE;
return_value_if_fail(stream != NULL && str != NULL, RET_BAD_PARAMS);
return_value_if_fail(stream->tell != NULL && stream->seek != NULL && stream->eos != NULL, RET_BAD_PARAMS);
return_value_if_fail(stream->tell != NULL && stream->seek != NULL && stream->eos != NULL,
RET_BAD_PARAMS);
str_set(str, "");
if (tk_istream_eos(stream)) {
@ -218,4 +219,3 @@ ret_t tk_istream_read_line_str(tk_istream_t* stream, str_t* str) {
return RET_OK;
}

View File

@ -3,7 +3,6 @@
#include "gtest/gtest.h"
#include "streams/file/istream_file.h"
TEST(IStreamFile, readline) {
str_t str;
tk_istream_t* is = tk_istream_file_create("tests/testdata/test_lines.txt");
@ -22,7 +21,9 @@ TEST(IStreamFile, readline) {
ASSERT_STREQ(str.str, "line4");
ASSERT_EQ(tk_istream_read_line_str(is, &str), RET_OK);
ASSERT_STREQ(str.str, "line5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
ASSERT_STREQ(str.str,
"line5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxx");
ASSERT_NE(tk_istream_read_line_str(is, &str), RET_OK);

View File

@ -101,4 +101,3 @@ TEST(IStreamMem, read_line) {
object_unref(OBJECT(is));
}