Skip to content

Commit

Permalink
unittest: Fix and enable tfile_test
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Aug 26, 2018
1 parent 8e40467 commit 7066572
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions unittest/Makefile.am
Expand Up @@ -71,6 +71,7 @@ check_PROGRAMS = \
tablefind_test \
tablerecog_test \
tabvector_test \
tfile_test \
tesseracttests

TESTS = $(check_PROGRAMS)
Expand Down Expand Up @@ -139,6 +140,9 @@ tablerecog_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
tabvector_test_SOURCES = tabvector_test.cc
tabvector_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)

tfile_test_SOURCES = tfile_test.cc
tfile_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)

tesseracttests_SOURCES = ../tests/tesseracttests.cpp
tesseracttests_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)

Expand Down
19 changes: 16 additions & 3 deletions unittest/tfile_test.cc
@@ -1,5 +1,18 @@
#include "tesseract/ccutil/genericvector.h"
#include "tesseract/ccutil/serialis.h"
// (C) Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "genericvector.h"
#include "serialis.h"

#include "include_gunit.h"

using tesseract::TFile;

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

0 comments on commit 7066572

Please sign in to comment.