From 70665721f44399fe99d49da575bc39b9c7a66fab Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 26 Aug 2018 19:04:54 +0200 Subject: [PATCH] unittest: Fix and enable tfile_test Signed-off-by: Stefan Weil --- unittest/Makefile.am | 4 ++++ unittest/tfile_test.cc | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/unittest/Makefile.am b/unittest/Makefile.am index ebc71a9294..017c14e49c 100644 --- a/unittest/Makefile.am +++ b/unittest/Makefile.am @@ -71,6 +71,7 @@ check_PROGRAMS = \ tablefind_test \ tablerecog_test \ tabvector_test \ + tfile_test \ tesseracttests TESTS = $(check_PROGRAMS) @@ -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) diff --git a/unittest/tfile_test.cc b/unittest/tfile_test.cc index dab33d8ee8..7c54a0c413 100644 --- a/unittest/tfile_test.cc +++ b/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; @@ -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 data; TFile fpw;