Skip to content

Commit c9baeeb

Browse files
committed
Fix another issue with gtest and is_open missing return value check
1 parent e190bfc commit c9baeeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/components/dlt-logd-converter/gtest_dlt_logd_converter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ string t_load_json_file()
6666
char *token;
6767
string pattern;
6868
string json_sequence;
69-
file.is_open();
69+
if(!file.is_open())
70+
return "";
7071
while (!file.eof()) {
7172
getline(file, pattern);
7273
if (pattern.size() == 0) {
@@ -590,4 +591,4 @@ TEST(t_logd_parser_loop, normal)
590591
int main(int argc, char** argv) {
591592
::testing::InitGoogleTest(&argc, argv);
592593
return RUN_ALL_TESTS();
593-
}
594+
}

0 commit comments

Comments
 (0)