Commit Graph

63 Commits

Author SHA1 Message Date
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
Stefan Weil
7768f9b336 Clean more include files and include statements
The changes are based on an analysis done with include-what-you-use.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-24 19:45:12 +02:00
Stefan Weil
c8dd4456e0 Fix CID 1393240 (Missing return statement)
This also fixes a compiler warning:

unittest/progress_test.cc:59:9: warning:
 no return statement in function returning non-void [-Wreturn-type]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-20 17:14:53 +02:00
Shreeshrii
0e9929f2ab
Update osd_test.cc 2018-06-19 10:23:48 +05:30
Shreeshrii
39ead95f51
Update loadlang_test.cc 2018-06-19 10:23:21 +05:30
Shreeshrii
873586ec9b
Update apiexample_test.cc 2018-06-19 10:22:46 +05:30
Shree Devi Kumar
90b29d9d53 Add tesseract/ to API header file invocation 2018-06-18 18:53:01 +00:00
Shree Devi Kumar
16e45d21a0 Test load of all langs and scripts for all 3 tessdata repos 2018-06-17 05:31:32 +00:00
Stefan Weil
165622c745 Fix symbolic link in unittest
The unittest could not run when building out of source tree.
Fix the symbolic link and make sure that the directory for it exists.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-09 14:15:13 +02:00
Shree Devi Kumar
2563380d51 move testing and testdata to test, add unlvtests 2018-06-06 12:20:14 +00:00
Jaroslaw Kubik
67ceae8385 Fix the progres increase test
The progress increase test must compare the input value against
the variable that contains a previous value, not against it's
initial value.
2018-06-02 02:29:42 +02:00
Jaroslaw Kubik
e05d333378 Added tests for progress reporting API
The progress reporting API is now tested using googlemock tools.
2018-06-02 00:47:34 +02:00
Jaroslaw Kubik
92168c5e8b Added googlemock building instructions
The googlemock tools are already present, so why not make use of
it. It can be usefull for testing callbacks.
2018-06-02 00:42:37 +02:00
Shreeshrii
07a6e64174
remove non-essential logging function
Also got error while building on  
Linux tesseract-ocr 4.4.0-122-generic #146-Ubuntu SMP Mon Apr 23 15:33:25 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux
with 
g++ (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

```
g++ -DHAVE_CONFIG_H -I. -I..  -DNDEBUG -DTESSDATA_DIR="\"/home/ubuntu/tessdata\"" -DTESTING_DIR="\"/home/ubuntu/tesseract/testing\"" -DPANGO_ENABLE_ENGINE -I../src/api -I../src/api -I../src/arch -I../src/ccmain -I../src/ccstruct -I../src/ccutil -I../src/classify -I../src/cutil -I../src/dict -I../src/display -I../src/lstm -I../src/textord -I../src/viewer -I../src/wordrec -isystem ../googletest/googletest/include -I/usr/local/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12  -g -O2 -std=c++11 -MT osd_test.o -MD -MP -MF $depbase.Tpo -c -o osd_test.o osd_test.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/features.h:367:0,
                 from /usr/include/powerpc64le-linux-gnu/c++/5/bits/os_defines.h:39,
                 from /usr/include/powerpc64le-linux-gnu/c++/5/bits/c++config.h:482,
                 from /usr/include/c++/5/iostream:38,
                 from log.h:19,
                 from osd_test.cc:20:
/usr/include/powerpc64le-linux-gnu/bits/mathcalls.h:109:1: error: ‘double log(double)’ redeclared as different kind of symbol
 __MATHCALL_VEC (log,, (_Mdouble_ __x));
 ^
In file included from osd_test.cc:20:0:
log.h:26:3: note: previous declaration ‘LOG log’
 } log;
   ^
```
2018-05-05 16:34:26 +05:30
Stefan Weil
a2a12a4469 Fix unittest for autotools configuration after source tree reorganisation
Now "make check" also works again.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-04-25 21:33:28 +02:00
Stefan Weil
95f39142ac Fix unittest (missing include path)
Add include path for api/tess_version.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-04-24 13:17:57 +02:00
amitdo
c3e6083e42 Remove 'AUTOMAKE_OPTIONS' from all Makefile.am files
'AM_INIT_AUTOMAKE()' in configure.ac sets options globally.
2018-04-23 14:01:16 +03:00
Stefan Weil
39cfbd04fe unittest: Replace NULL by nullptr
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-04-22 17:42:36 +02:00
Stefan Weil
3fcb952dbf Remove unneeded CPPFLAGS (#1425)
* training: Remove unneeded CPPFLAGS

The training code does not need vs2010/port.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* unittest: Remove unneeded CPPFLAGS

The unittest code does not need vs2010/port.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-25 21:04:45 +02:00
Stefan Weil
023e1b340e Use POSIX data types and macros (#878)
* api: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccmain: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccstruct: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* classify: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* cutil: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* dict: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* textord: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* training: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* wordrec: Replace Tesseract data types by POSIX data types

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccutil: Replace Tesseract data types by POSIX data types

Now all Tesseract data types which are no longer needed can be removed
from ccutil/host.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccmain: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccstruct: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* classify: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* dict: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* lstm: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* textord: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* wordrec: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* ccutil: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX

Remove the macros which are now unused from ccutil/host.h.
Remove also the obsolete history comments.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* Fix build error caused by ambiguous ClipToRange

Error message vom Appveyor CI:

    C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2672: 'ClipToRange': no matching overloaded function found [C:\projects\tesseract\build\libtesseract.vcxproj]
    C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2782: 'T ClipToRange(const T &,const T &,const T &)': template parameter 'T' is ambiguous [C:\projects\tesseract\build\libtesseract.vcxproj]
      c:\projects\tesseract\ccutil\helpers.h(122): note: see declaration of 'ClipToRange'
      C:\projects\tesseract\ccstruct\coutln.cpp(818): note: could be 'char'
      C:\projects\tesseract\ccstruct\coutln.cpp(818): note: or       'int'

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* unittest: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* arch: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-13 21:36:30 +01:00
Stefan Weil
40c71bfcb8 Update unittest for new script data location and fix out-of-tree build (#1386)
tessdata_best and tessdata_fast recently changed the path for script data,
so the tests have to be updated, too.

In addition, the relative paths did not work with out-of-tree builds.
Use absolute paths and add them as C macros to the compiler flags.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-13 21:15:44 +01:00
Shreeshrii
5845e1a27d Add unit test for OSD, update apiexample test (#1359)
* Update apiexample_test.cc

* Add OSD test and logging function

* Add images for OSD unittest
2018-03-04 14:52:27 +01:00
Stefan Weil
7972b13e3a Remove macro USE_STD_NAMESPACE (#1360)
The related code in training/util.h now uses the GOOGLE_TESSERACT macro
to enable Google specific code to disable heap checking.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-04 14:43:28 +01:00
Stefan Weil
67f706f9ef unittest/apiexample_test: Use googletest API for error handling
Use the Google C++ Testing Framework instead of calling fprint / exit.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-13 13:50:39 +02:00
Stefan Weil
b42df389be unittest/apiexample_test: Report missing test image
This avoids a runtime error (SIGSEGV caused by nullptr) for that case.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-13 13:43:49 +02:00
Stefan Weil
5c7600c282 unittest/apiexample_test: Fix test for out-of-tree builds
The test expects to find phototest.tif and phototest.txt
in directory ../testing. Create symbolic links if those
files don't exist there.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-13 13:29:16 +02:00
Stefan Weil
8655524772 unittest/apiexample_test: Use "C" locale
We cannot assume that the locale "en_US.UTF-8" is always available.
Using the "C" locale should work better.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-13 13:26:09 +02:00
Stefan Weil
4ae227df53 unittest: Fix path for libtesseract in out of tree builds
The library is provided in the build path (which is not
the same as the source path for out of tree builds).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-12 17:24:34 +02:00
amitdo
a905548ed6 Autotools build: Remove the option 'USING_MULTIPLELIBS'
Libtool's convenience libraries should never be installed. Fixes #985.
2017-09-11 15:03:53 +03:00
Shree Devi Kumar
f6c22dbf66 remove duplicate - gunit.h 2017-09-10 14:50:59 +05:30
Ray Smith
3493785f7d Fixed apiexample and intsimdmatrix tests and prepared Makefile.am for more tests 2017-09-08 17:34:31 +01:00
Ray Smith
fc6a390c6c Added intsimdmatrix as a generic integer matrixdotvector function with AVX2 and SSE specializations 2017-09-08 15:06:19 +01:00