mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-13 16:09:04 +08:00
unittest: Fix two issues reported by Coverity Scan (CID 1402761, 1402755)
GTEST_SKIP() returns from the function which caused two warnings: CID 1402755 (#1 of 1): Resource leak (RESOURCE_LEAK) CID 1402761 (#1 of 1): Structurally dead code (UNREACHABLE) Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
bdad068686
commit
854772147c
@ -31,14 +31,12 @@ TEST_F(ScanutilsTest, DoesScanf) {
|
||||
if (fp1 == nullptr) {
|
||||
std::cout << "Failed to open file " << filename << '\n';
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
FILE* fp2 = fopen(filename.c_str(), "r");
|
||||
if (fp2 == nullptr) {
|
||||
std::cout << "Failed to open file " << filename << '\n';
|
||||
GTEST_SKIP();
|
||||
fclose(fp1);
|
||||
return;
|
||||
GTEST_SKIP();
|
||||
}
|
||||
// The file contains this:
|
||||
// 42.5 17 0.001000 -0.001000
|
||||
|
Loading…
Reference in New Issue
Block a user