mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-30 23:49:05 +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();
|
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
|
||||||
// Initialize tesseract-ocr with English, without specifying tessdata path
|
// Initialize tesseract-ocr with English, without specifying tessdata path
|
||||||
if (api->Init(NULL, "eng")) {
|
ASSERT_FALSE(api->Init(nullptr, "eng")) << "Could not initialize tesseract.";
|
||||||
fprintf(stderr, "Could not initialize tesseract.\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open input image with leptonica library
|
// Open input image with leptonica library
|
||||||
Pix *image = pixRead("../testing/phototest.tif");
|
Pix *image = pixRead("../testing/phototest.tif");
|
||||||
|
Loading…
Reference in New Issue
Block a user