Commit Graph

94 Commits

Author SHA1 Message Date
Stefan Weil
7ebd3153ae Fix several typos (most of them found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-12-10 18:59:58 +01:00
Stefan Weil
9b783822a0 Remove unused include statements for tprintf.h
Format also a call of tprintf and add a missing explicit include statement.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-18 17:25:01 +01:00
Stefan Weil
ff5347c4ad Fix memory leak in osd_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-13 09:09:23 +01:00
Stefan Weil
5209aa6c95 Fix memory leak in loadlang_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-13 09:09:10 +01:00
Stefan Weil
74f6d0e7ff Fix memory leak in apiexample_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-13 09:08:42 +01:00
Stefan Weil
303ac97102 Fix memory leaks and typos in progress_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-13 08:24:50 +01:00
Stefan Weil
f4ec5beedc Remove dummy test
This reverts commit 99755b0732.
The dummy test is no longer needed as there exist a lot of real tests now.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-08 18:53:15 +01:00
Stefan Weil
d04133f07e unittest: Add more files from Google
They were provided by Jeff Breidenbach <jbreiden@google.com>.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-18 16:39:35 +02:00
Stefan Weil
98843e0d81 Fix uninitialized scalar variable (CID 1395880)
This fixes a warning from Coverity Scan.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-16 16:53:24 +02:00
Stefan Weil
d8fdbdb9fd CycleTimer: Add missing initialization (CID 1396168)
This fixes a warning from Coverity Scan.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-16 16:53:23 +02:00
Shree Devi Kumar
f5dfab1559 Add Leptonica lib for baseapi_test 2018-10-13 17:22:49 +00:00
Stefan Weil
3f5c36191f unittest: Disable build rules for tests which still fail to build
This fixes warnings from autogen.sh.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 17:48:57 +02:00
Stefan Weil
2916dc86dd unittest: Add mastertrainer_test (only works partially)
The test currently has subtests which fail because of missing files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 16:23:13 +02:00
Stefan Weil
f93fb9de74 unittest: Add lang_model_test (only works partially)
The test currently has subtests which fail because of missing files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 16:23:13 +02:00
Stefan Weil
de6a759744 unittest: Add paragraphs_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 16:23:10 +02:00
Stefan Weil
53f0e7658f unittest: Add imagedata_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 15:15:02 +02:00
Stefan Weil
420a0286fd unittest: Add fileio_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 08:13:39 +02:00
Stefan Weil
d3cf423748 unittest: Add qrsequence_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-12 08:01:58 +02:00
Stefan Weil
11f82f5c1e unittest: Add baseapi_test
* Add Abseil sources to build process.

* Add copyright comment.

* InitConfigOnlyTest no longer tests
  hin.traineddata because it is LSTM only.

* Fix std::string.

* Deactivate tests with missing test data.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-11 22:18:58 +02:00
Stefan Weil
db16fea6b1 Add a basic implementation of class CycleTimer
It is used by baseapi_test.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-11 22:18:58 +02:00
Stefan Weil
27bfaccf73 Enhance LOG emulation
It is needed for baseapi_test and other unit tests.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-11 22:18:58 +02:00
Stefan Weil
db07a69b56 Add more hacks for use with Google unittests
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-11 22:18:58 +02:00
Stefan Weil
4ec9c86226 unittest: Replace NULL by nullptr
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-29 09:27:12 +02:00
Stefan Weil
9e66fb918f unittest: Format code
It was formatted with clang-format-7 -i unittest/*.{c*,h}.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-29 09:19:13 +02:00
Stefan Weil
5178142ab1 NthItemTest: Add definition for virtual destructor
This fixes a compiler warning from clang:

unittest/nthitem_test.cc:22:7: warning:
 'NthItemTest' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 12:11:23 +02:00
Stefan Weil
80c1235c12 HeapTest: Add definition for virtual destructor
This fixes a compiler warning from clang:

unittest/heap_test.cc:27:7: warning:
 'HeapTest' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 12:11:23 +02:00
Shree Devi Kumar
b5d41b77eb Add leptonica-libs for apply-boxes test 2018-08-30 04:25:28 +00:00
Shree Devi Kumar
85b03723ea DISABLE some tests by default since they take long to run. They can be forced to run by --gtest_also_run_disabled_tests argument 2018-08-29 20:28:20 +00:00
Stefan Weil
46f65bf0c2 unittest: Fix and enable applybox_test
It needs an update of the test submodule.

The tests only pass with a small modification of the ground truth texts
(kTruthTextWords, kTruthTextLine).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-28 21:03:49 +02:00
Stefan Weil
c1af1f6694 unittest: Fix and enable commandlineflags_test
It only works if training is enabled and built.

The test "PrintUsageAndExit" had to be disabled because it
currently fails.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-27 11:55:23 +02:00
Stefan Weil
ca7ae1c3a6 unittest: Fix and enable validator_test
It requires additional training libraries, so this test only works
if training is enabled and build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-27 11:45:35 +02:00
Stefan Weil
70665721f4 unittest: Fix and enable tfile_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
8e404679c1 unittest: Fix and enable tabvector_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
aac00836d5 unittest: Fix and enable tablerecog_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
7aef7a304f unittest: Fix and enable tablefind_test
This requires a local definition for macro ABSL_ARRAYSIZE
(normally defined as part of the Abseil API).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
f95725afcb unittest: Fix and enable stats_test
This requires a local definition for macro ABSL_ARRAYSIZE
(normally defined as part of the Abseil API).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
6df28fb3f0 unittest: Fix and enable rect_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
3d38e8ceb7 unittest: Fix and enable nthitem_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
f876ddb084 unittest: Fix and enable linlsq_test
Sort also the tests alphabetically.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-26 19:15:06 +02:00
Stefan Weil
aec9ce7757 unittest: Fix and enable intfeaturemap_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:39:41 +02:00
Stefan Weil
c4eda838aa unittest: Fix and enable indexmapbidi_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:39:40 +02:00
Stefan Weil
de7676c88e unittest: Fix and enable heap_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:39:40 +02:00
Stefan Weil
778092838a Add ARRAYSIZE macro for Google test environment
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:39:40 +02:00
Stefan Weil
2dc0b68147 unittest: Fix and enable denorm_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
bb101defdb unittest: Fix and enable colpartition_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
68db6aa5df unittest: Fix and enable cleanapi_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
0dc5c8ef3f unittest: Fix and enable bitvector_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
2b7df59187 Add more unittests from Google
They were provided by Jeff Breidenbach <jbreiden@google.com>.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
f0337c2d1a Add more portability hacks for Google test environment
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-25 18:16:46 +02:00
Stefan Weil
6a28cce96b Fix whitespace issues
* Remove whitespace (blanks, tabs, cr) at line endings

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-01 13:19:52 +02:00