Commit Graph

45 Commits

Author SHA1 Message Date
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
Shreeshrii
e0464a0d31 Delete readme.md 2017-09-04 10:45:44 +05:30
Shreeshrii
f7284569ff Use groundtruth from testing directory 2017-09-04 10:44:43 +05:30
Shreeshrii
0ed7317c38 Rename unittest/testfiles/phototest.txt to testing/phototest.txt
Add groundtruth in the testing directory
2017-09-04 10:42:37 +05:30
Shreeshrii
10cf508442 Changed syntax for AM_CPPFLAGS
as per suggestion in https://github.com/tesseract-ocr/tesseract/pull/1088#discussion_r136700733

Not ALL of these are needed currently.
2017-09-03 08:09:18 +05:30
Shreeshrii
3b05b3e28b revert blank line at end
as not needed after 
8bb5a89d5a
2017-09-02 20:00:45 +05:30
Shreeshrii
6773e8b909 add blank lines to match OCRed text 2017-08-19 19:17:08 +05:30
Shreeshrii
f3dc156f22 updated version of apiexample_test 2017-08-19 18:46:23 +05:30
Shreeshrii
7b409a1bfa unittest testfile 2017-08-19 18:43:57 +05:30
Shreeshrii
436ad77e44 Create readme.md 2017-08-19 18:43:10 +05:30
Shreeshrii
88e4c62b39 Add files via upload 2017-08-19 18:42:06 +05:30
Ray Smith
8e55e52be7 Harder unittest that uses file i/o and string manipulation 2017-08-03 15:51:18 -07:00
Ray Smith
4572940639 Portability fix to help tests compile with the same code in both Google and github 2017-08-03 15:42:26 -07:00
Ray Smith
2fbcba62e5 Initial push of one simple unittest 2017-08-02 17:35:29 -07:00