9
9
#include " coutln.h"
10
10
#include " log.h" // for LOG
11
11
#include " mutableiterator.h"
12
+ #include " ocrblock.h" // for class BLOCK
12
13
#include " pageres.h"
13
14
#include " polyblk.h"
14
15
#include " resultiterator.h"
@@ -61,16 +62,15 @@ class LayoutTest : public testing::Test {
61
62
char * block_text = it->GetUTF8Text (tesseract::RIL_BLOCK);
62
63
if (block_text != nullptr && it->BlockType () == blocks[string_index] &&
63
64
strstr (block_text, strings[string_index]) != nullptr ) {
64
- LOG (INFO) << " Found string %s in block %d of type %s " <<
65
- strings[string_index], block_index,
66
- kPolyBlockNames [blocks[string_index]];
65
+ LOG (INFO) << " Found string " << strings[string_index]
66
+ << " in block " << block_index
67
+ << " of type " << kPolyBlockNames [blocks[string_index]];
67
68
// Found this one.
68
69
++string_index;
69
70
} else if (it->BlockType () == blocks[string_index] &&
70
71
block_text == nullptr && strings[string_index][0 ] == ' \0 ' ) {
71
- LOG (INFO) << " Found block of type %s at block %d" <<
72
- kPolyBlockNames [blocks[string_index]],
73
- block_index;
72
+ LOG (INFO) << " Found block of type " << kPolyBlockNames [blocks[string_index]]
73
+ << " at block " << block_index;
74
74
// Found this one.
75
75
++string_index;
76
76
} else {
@@ -90,7 +90,6 @@ class LayoutTest : public testing::Test {
90
90
// be to the left of it if right_to_left is true, or to the right otherwise.
91
91
void VerifyRoughBlockOrder (bool right_to_left, ResultIterator* it) {
92
92
int prev_left = 0 ;
93
- int prev_top = 0 ;
94
93
int prev_right = 0 ;
95
94
int prev_bottom = 0 ;
96
95
it->Begin ();
@@ -111,7 +110,6 @@ class LayoutTest : public testing::Test {
111
110
}
112
111
}
113
112
prev_left = left;
114
- prev_top = top;
115
113
prev_right = right;
116
114
prev_bottom = bottom;
117
115
}
@@ -129,7 +127,7 @@ class LayoutTest : public testing::Test {
129
127
PTIsTextType (it->BlockType ()) && right - left > 800 &&
130
128
bottom - top > 200 ) {
131
129
const PAGE_RES_IT* pr_it = it->PageResIt ();
132
- POLY_BLOCK* pb = pr_it->block ()->block ->poly_block ();
130
+ POLY_BLOCK* pb = pr_it->block ()->block ->pdblk . poly_block ();
133
131
CHECK (pb != nullptr );
134
132
FCOORD skew = pr_it->block ()->block ->skew ();
135
133
EXPECT_GT (skew.x (), 0 .0f );
@@ -165,6 +163,7 @@ class LayoutTest : public testing::Test {
165
163
166
164
// Tests that Tesseract gets the important blocks and in the right order
167
165
// on a UNLV page numbered 8087_054.3B.tif. (Dubrovnik)
166
+ #if 0 // TODO: Get missing image needed for this test.
168
167
TEST_F(LayoutTest, UNLV8087_054) {
169
168
SetImage("8087_054.3B.tif", "eng");
170
169
// Just run recognition.
@@ -174,6 +173,7 @@ TEST_F(LayoutTest, UNLV8087_054) {
174
173
VerifyBlockTextOrder(kStrings8087_054, kBlocks8087_054, it);
175
174
delete it;
176
175
}
176
+ #endif
177
177
178
178
// Tests that Tesseract gets the important blocks and in the right order
179
179
// on GOOGLE:13510798882202548:74:84.sj-79.tif (Hebrew image)
0 commit comments