Skip to content

Commit 67f706f

Browse files
committed
unittest/apiexample_test: Use googletest API for error handling
Use the Google C++ Testing Framework instead of calling fprint / exit. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent b42df38 commit 67f706f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

unittest/apiexample_test.cc

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ TEST(TesseractTest, ApiExample)
3232

3333
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
3434
// Initialize tesseract-ocr with English, without specifying tessdata path
35-
if (api->Init(NULL, "eng")) {
36-
fprintf(stderr, "Could not initialize tesseract.\n");
37-
exit(1);
38-
}
35+
ASSERT_FALSE(api->Init(nullptr, "eng")) << "Could not initialize tesseract.";
3936

4037
// Open input image with leptonica library
4138
Pix *image = pixRead("../testing/phototest.tif");

0 commit comments

Comments
 (0)