Skip to content

Commit

Permalink
unittest/apiexample_test: Use googletest API for error handling
Browse files Browse the repository at this point in the history
Use the Google C++ Testing Framework instead of calling fprint / exit.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Sep 13, 2017
1 parent b42df38 commit 67f706f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions unittest/apiexample_test.cc
Expand Up @@ -32,10 +32,7 @@ TEST(TesseractTest, ApiExample)

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

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

0 comments on commit 67f706f

Please sign in to comment.