Skip to content

Commit aac0083

Browse files
committed
unittest: Fix and enable tablerecog_test
Signed-off-by: Stefan Weil <[email protected]>
1 parent 7aef7a3 commit aac0083

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

unittest/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ check_PROGRAMS = \
6969
rect_test \
7070
stats_test \
7171
tablefind_test \
72+
tablerecog_test \
7273
tesseracttests
7374

7475
TESTS = $(check_PROGRAMS)
@@ -131,6 +132,9 @@ stats_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
131132
tablefind_test_SOURCES = tablefind_test.cc
132133
tablefind_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
133134

135+
tablerecog_test_SOURCES = tablerecog_test.cc
136+
tablerecog_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
137+
134138
tesseracttests_SOURCES = ../tests/tesseracttests.cpp
135139
tesseracttests_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
136140

unittest/tablerecog_test.cc

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
// (C) Copyright 2017, Google Inc.
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
111

212
#include <memory>
313

4-
#include "tesseract/textord/colpartition.h"
5-
#include "tesseract/textord/colpartitiongrid.h"
6-
#include "tesseract/textord/tablerecog.h"
14+
#include "colpartition.h"
15+
#include "colpartitiongrid.h"
16+
#include "tablerecog.h"
17+
18+
#include "include_gunit.h"
719

820
using tesseract::ColPartition;
921
using tesseract::ColPartition_LIST;
@@ -83,7 +95,7 @@ class SharedTest : public testing::Test {
8395
ColPartition* part = ColPartition::FakePartition(box, PT_FLOWING_TEXT,
8496
BRT_TEXT, BTFT_NONE);
8597
part->set_median_width(3);
86-
part->set_median_size(3);
98+
part->set_median_height(3);
8799
text_grid_->InsertBBox(true, true, part);
88100

89101
tesseract::ColPartition_IT add_it(&allocated_parts_);

0 commit comments

Comments
 (0)