Skip to content

Commit 68db6aa

Browse files
committed
unittest: Fix and enable cleanapi_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 0dc5c8e commit 68db6aa

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

unittest/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ AM_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include \
5353
check_PROGRAMS = \
5454
apiexample_test \
5555
bitvector_test \
56+
cleanapi_test \
5657
progress_test \
5758
intsimdmatrix_test \
5859
matrix_test \
@@ -71,6 +72,9 @@ apiexample_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
7172
bitvector_test_SOURCES = bitvector_test.cc
7273
bitvector_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
7374

75+
cleanapi_test_SOURCES = cleanapi_test.cc
76+
cleanapi_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
77+
7478
progress_test_SOURCES = progress_test.cc
7579
progress_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
7680
progress_test_LDADD = $(GTEST_LIBS) $(GMOCK_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)

unittest/cleanapi_test.cc

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
//
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.
211

3-
#include "tesseract/api/baseapi.h"
12+
#include "baseapi.h"
413

514
// Dummy enum in the global namespace that checks for collision with awkward
615
// names.
@@ -18,6 +27,9 @@ enum NameTester {
1827
WORD
1928
};
2029

30+
#define ERRCODE_H // avoid redefinition of ABORT in errcode.h
31+
#include "include_gunit.h"
32+
2133
namespace {
2234

2335
// Verifies that the global namespace is clean.
@@ -26,4 +38,3 @@ TEST(CleanNamespaceTess, DummyTest) {
2638
}
2739

2840
} // namespace.
29-

0 commit comments

Comments
 (0)