Skip to content

Commit 7066572

Browse files
committed
unittest: Fix and enable tfile_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 8e40467 commit 7066572

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

unittest/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ check_PROGRAMS = \
7171
tablefind_test \
7272
tablerecog_test \
7373
tabvector_test \
74+
tfile_test \
7475
tesseracttests
7576

7677
TESTS = $(check_PROGRAMS)
@@ -139,6 +140,9 @@ tablerecog_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
139140
tabvector_test_SOURCES = tabvector_test.cc
140141
tabvector_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
141142

143+
tfile_test_SOURCES = tfile_test.cc
144+
tfile_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
145+
142146
tesseracttests_SOURCES = ../tests/tesseracttests.cpp
143147
tesseracttests_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
144148

unittest/tfile_test.cc

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
#include "tesseract/ccutil/genericvector.h"
2-
#include "tesseract/ccutil/serialis.h"
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.
11+
12+
#include "genericvector.h"
13+
#include "serialis.h"
14+
15+
#include "include_gunit.h"
316

417
using tesseract::TFile;
518

@@ -122,7 +135,7 @@ TEST_F(TfileTest, Serialize) {
122135
TEST_F(TfileTest, FGets) {
123136
// This test verifies that Tfile can interleave FGets with binary data.
124137
MathData m1;
125-
string line_str = "This is a textline with a newline\n";
138+
std::string line_str = "This is a textline with a newline\n";
126139
m1.Setup();
127140
GenericVector<char> data;
128141
TFile fpw;

0 commit comments

Comments
 (0)