mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
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>
This commit is contained in:
parent
b42df389be
commit
67f706f9ef
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user