Permalink
Browse files

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>
  • Loading branch information...
stweil committed Sep 13, 2017
1 parent b42df38 commit 67f706f9efe03e9a29fe486d76aeda4da13a629e
Showing with 1 addition and 4 deletions.
  1. +1 −4 unittest/apiexample_test.cc
@@ -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");

0 comments on commit 67f706f

Please sign in to comment.