mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 20:18:22 +08:00
format code
This commit is contained in:
parent
9f8409b98a
commit
fee05fd1ff
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -101,4 +101,3 @@ TEST(IStreamMem, read_line) {
|
||||
|
||||
object_unref(OBJECT(is));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user