Skip to content

Commit

Permalink
Remove and fix tests due to deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ws233 committed Oct 29, 2015
1 parent 13ee3da commit f0f5b37
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 19 deletions.
4 changes: 0 additions & 4 deletions TestsProject/TestsProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
84E136421B66BEE80062F5A2 /* well_scaned_page_up_mirrored.png in Resources */ = {isa = PBXBuildFile; fileRef = 84E1363B1B66BEE80062F5A2 /* well_scaned_page_up_mirrored.png */; };
8FA2F9CE23919BEC8C64A5EA /* libPods-TestsProjectTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CD3C116A45C293ADAC81D1B /* libPods-TestsProjectTests.a */; };
F120B54A1B45D642003F38A7 /* empty.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F120B5491B45D642003F38A7 /* empty.pdf */; };
F18F53451AE7A6C9005F3843 /* grayscaledImage.png in Resources */ = {isa = PBXBuildFile; fileRef = F18F53441AE7A6C9005F3843 /* grayscaledImage.png */; };
F19D834A1B34C97D00EB8D2E /* NSData+G8Equal.m in Sources */ = {isa = PBXBuildFile; fileRef = F19D83491B34C97D00EB8D2E /* NSData+G8Equal.m */; };
F1A7AB8E1B34B91000FE9650 /* well_scaned_page.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F1A7AB8D1B34B91000FE9650 /* well_scaned_page.pdf */; };
F1D1AFF21B4580C100AB59EE /* well_scaned_page.png in Resources */ = {isa = PBXBuildFile; fileRef = F1D1AFF11B4580C100AB59EE /* well_scaned_page.png */; };
Expand Down Expand Up @@ -118,7 +117,6 @@
84E1363B1B66BEE80062F5A2 /* well_scaned_page_up_mirrored.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = well_scaned_page_up_mirrored.png; sourceTree = "<group>"; };
8CA185A06F5E788CE0DC28EB /* Pods-TestsProjectTests.coverage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestsProjectTests.coverage.xcconfig"; path = "../Pods/Target Support Files/Pods-TestsProjectTests/Pods-TestsProjectTests.coverage.xcconfig"; sourceTree = "<group>"; };
F120B5491B45D642003F38A7 /* empty.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = empty.pdf; sourceTree = "<group>"; };
F18F53441AE7A6C9005F3843 /* grayscaledImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = grayscaledImage.png; sourceTree = "<group>"; };
F19D83481B34C97D00EB8D2E /* NSData+G8Equal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+G8Equal.h"; sourceTree = "<group>"; };
F19D83491B34C97D00EB8D2E /* NSData+G8Equal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+G8Equal.m"; sourceTree = "<group>"; };
F1A7AB8D1B34B91000FE9650 /* well_scaned_page.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = well_scaned_page.pdf; sourceTree = "<group>"; };
Expand Down Expand Up @@ -265,7 +263,6 @@
84E136311B66BAB00062F5A2 /* image_sample_left_mirrored.jpg */,
84E1362F1B66BA6B0062F5A2 /* image_sample_right_mirrored.jpg */,
84E1362D1B66B7950062F5A2 /* image_sample_down_mirrored.jpg */,
F18F53441AE7A6C9005F3843 /* grayscaledImage.png */,
);
name = Images;
sourceTree = "<group>";
Expand Down Expand Up @@ -380,7 +377,6 @@
F1A7AB8E1B34B91000FE9650 /* well_scaned_page.pdf in Resources */,
4141211E1A4B1E3900583ED4 /* image_blank.png in Resources */,
84E136401B66BEE80062F5A2 /* well_scaned_page_right_mirrored.png in Resources */,
F18F53451AE7A6C9005F3843 /* grayscaledImage.png in Resources */,
84E136341B66BC430062F5A2 /* image_sample_up_mirrored.jpg in Resources */,
84E136411B66BEE80062F5A2 /* well_scaned_page_right.png in Resources */,
41C68DB51A41854600848AE1 /* image_sample_tr.png in Resources */,
Expand Down
Binary file removed TestsProject/TestsProject/grayscaledImage.png
Binary file not shown.
2 changes: 1 addition & 1 deletion TestsProject/TestsProject/image_sample.hOCR
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class='ocr_page' id='page_1' title='image ""; bbox 0 0 1121 156; ppageno 0'>
<div class='ocr_carea' id='block_1_1' title="bbox 32 20 1091 148">
<p class='ocr_par' dir='ltr' id='par_1_1' title="bbox 32 20 1091 148">
<span class='ocr_line' id='line_1_1' title="bbox 32 20 1091 148; baseline -0.008 0"><span class='ocrx_word' id='word_1_1' title='bbox 32 20 1091 148; x_wconf 84' lang='eng'>1234567890</span>
<span class='ocr_line' id='line_1_1' title="bbox 32 20 1091 148; baseline -0.008 0"><span class='ocrx_word' id='word_1_1' title='bbox 32 20 1091 148; x_wconf 83' lang='eng'>1234567890</span>
</span>
</p>
</div>
Expand Down
Binary file modified TestsProject/TestsProject/image_sample_bl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions TestsProject/TestsProjectTests/G8RecognitionTestsHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)setupTesseract

- (void)setupImage
{
self.tesseract.image = [self.image g8_blackAndWhite];
self.tesseract.image = self.image;

if (CGRectEqualToRect(self.rect, CGRectZero) == NO) {
self.tesseract.rect = self.rect;
Expand Down Expand Up @@ -145,7 +145,7 @@ - (UIImage *)thresholdedImageForImage:(UIImage *)sourceImage
[self setupTesseract];
self.tesseract.delegate = self;

self.tesseract.image = [sourceImage g8_blackAndWhite];
self.tesseract.image = sourceImage;

return self.tesseract.thresholdedImage;
};
Expand Down
13 changes: 1 addition & 12 deletions TestsProject/TestsProjectTests/InitializationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,7 @@ - (void*)pixForImage:(UIImage *)image;
[tesseract stub:@selector(pixForImage:) andReturn:nil];
tesseract.image = [UIImage imageNamed:@"image_sample.jpg"];
});

it(@"Should grayscale", ^{
UIImage *image = [UIImage imageNamed:@"image_sample_bl.png"];
UIImage *grayscaledImage = [image g8_grayScale];

UIImage *patternImage = [UIImage imageNamed:@"grayscaledImage.png"];
NSAssert(patternImage, @"Error! Pattern image doesn't exist");

BOOL equal = [grayscaledImage g8_isEqualToImage:patternImage];
[[theValue(equal) should] beYes];
});


it(@"Should test pixForImage with zero image size", ^{
G8Tesseract *tesseract = [[G8Tesseract alloc] initWithLanguage:kG8Languages];

Expand Down

0 comments on commit f0f5b37

Please sign in to comment.