Skip to content

Commit

Permalink
Test the case when preprocessedImageForTesseract:sourceImage: returns…
Browse files Browse the repository at this point in the history
… not nil,

but pixForImage: cannot create corresponding Pixs info for that image.
  • Loading branch information
ws233 committed Jul 6, 2015
1 parent 0e1b170 commit 9832eef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TestsProject/TestsProjectTests/InitializationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ - (void*)pixForImage:(UIImage *)image;

[[text should] beNil];
});

it(@"Should set original image if pixForImage for preprocessed image retuens nil", ^{
G8RecognitionTestsHelper *helper = [[G8RecognitionTestsHelper alloc] init];
[helper setupTesseract];
helper.tesseract.delegate = helper;
helper.customPreprocessingType = G8CustomPreprocessingSimpleThreshold;
[helper.tesseract stub:@selector(pixForImage:) andReturn:nil];

UIImage *inputImage = [UIImage imageNamed:@"image_sample.jpg"];
helper.tesseract.image = inputImage;

[[helper.tesseract.image should] equal:inputImage];
});
});

NSString *tessdataPath = @"foo/bar";
Expand Down

0 comments on commit 9832eef

Please sign in to comment.