Commit Graph

326 Commits

Author SHA1 Message Date
Stefan Weil
619b98b73f Replace more GenericVector by std::vector for src/unittest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-18 15:32:18 +01:00
Stefan Weil
48fe1e0232 Replace more GenericVector by std::vector for src/unittest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-18 15:32:18 +01:00
Stefan Weil
edd599fa7b Replace more GenericVector by std::vector and remove GenericVector::choose_nth_item
KDVector is now derived from std::vector.

This requires an update for unittest nthitem_test because
std::nth_element does not handle all corner cases of choose_nth_item.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-17 20:28:04 +01:00
Stefan Weil
9f1041efa7 Replace more GenericVector by std::vector for src/ccstruct
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-17 13:45:54 +01:00
Stefan Weil
5db92b26aa Replace remaining GenericVector by std::vector for src/textord
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-16 16:59:12 +01:00
Stefan Weil
1f94d79c81 Replace remaining GenericVector by std::vector for src/ccmain
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-16 16:55:38 +01:00
Stefan Weil
2a3682a35e Replace remaining GenericVector by std::vector in src/lstm
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-16 12:25:11 +01:00
Stefan Weil
576c09bf31 Replace remaining STRING by std::string in unittest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-15 09:11:41 +01:00
Stefan Weil
0edd69eb10 Replace remaining STRING by std::string in src/training
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-15 09:11:41 +01:00
Stefan Weil
21cf7cf84e Replace remaining STRING by std::string in src/dict
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-15 09:11:41 +01:00
Stefan Weil
e0ce040832 Replace remaining STRING by std::string in src/classify
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-15 09:11:41 +01:00
Egor Pugin
26ceeef6c0 [training] Modernize. 2021-03-14 23:47:42 +03:00
Egor Pugin
bcebf04f8e [unittest] Use more smart ptrs, more std::make_unique instead of .reset(new T()). 2021-03-14 23:06:19 +03:00
Stefan Weil
3b0759940c Replace more STRING by std::string
Remove STRING::add_str_int and STRING::add_str_double which are now unused.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-13 23:16:35 +01:00
Stefan Weil
c9f0da49ca Replace more STRING by std::string
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-13 21:15:52 +01:00
Egor Pugin
1d5b083447 [clang-format] Format unit tests. 2021-03-13 00:06:34 +03:00
Stefan Weil
b68a2a7b47 Fix tatweel_test for C++-20
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-12 13:16:48 +01:00
Egor Pugin
ce058604ba Pass empty strings into Tesseract::init_tesseract(). 2021-03-10 15:21:03 +03:00
Stefan Weil
c12dde2862 Use float instead of double for learning_rate, momentum and adam_beta
Only WeightMatrix::Update used double parameters, all other functions
already used float. So this change avoids unnecessary conversions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-27 21:08:41 +01:00
Stefan Weil
ea446b1eae Remove blanks at line endings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 14:05:36 +01:00
Stefan Weil
0b8e937655 Use countof to get number of array elements
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:20:48 +01:00
Stefan Weil
bc69e28de3 Update include statements for external header file allheaders.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-13 10:17:20 +01:00
Stefan Weil
971c6e6d6b automake: Flat build for unittest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-24 18:21:37 +01:00
Shree Devi Kumar
53e1ae9ebf Fix Memory leak in ligature_table_test 2021-01-24 18:17:06 +01:00
Stefan Weil
139d127ff7 Remove unneeded include statement for genericvector.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-23 17:29:57 +01:00
Stefan Weil
71fb535427 Remove unneeded include statement for strngs.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-23 17:29:57 +01:00
Stefan Weil
5a3d6e5e0d Fix memory leak in mastertrainer_test (fixes issue #3215)
The issue was introduced in commit 6e9456415.

Partially reverting this commit fixes it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-23 14:54:38 +01:00
Shreeshrii
5d8594cd80
Reduce number of INFO messages from lstm_test (#3250) 2021-01-22 07:59:02 +01:00
Shree Devi Kumar
e07c99d874 Replace deprecated INSTANTIATE_TEST_CASE_P 2021-01-20 18:03:05 +00:00
Shree Devi Kumar
fe4951e4d5 Do not run textlineprojection_test with disable-legacy, uses OSD 2021-01-15 13:04:38 +00:00
Shree Devi Kumar
4df7021d98 Remove unnecessary subtest with missing input image 2021-01-14 15:38:55 +01:00
Stefan Weil
a522377993 Fix stringrenderer_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-10 23:22:45 +01:00
Stefan Weil
59b3a79e0b Fix ligature_table_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-10 23:22:45 +01:00
Stefan Weil
3851e30a48 Fix pango_font_info_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-10 23:22:45 +01:00
Shree Devi Kumar
3c71749b86 Delete TESSDATA_BEST_DIR macro 2021-01-08 20:25:26 +01:00
Stefan Weil
e46141ac99 Replace snprintf by strncpy (fix compiler warning)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-08 19:01:26 +01:00
Stefan Weil
ea4f9de4f4 Add include path for leptonica for fuzzer build
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-07 22:30:09 +01:00
Egor Pugin
9710bc0465 More std::vector. 2021-01-07 13:57:57 +03:00
Stefan Weil
66128429e5 Fix include statement for allheaders.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-05 23:18:39 +01:00
Stefan Weil
d000df7e00 Remove remaining parts of tessopt (fix autotools build)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-05 23:06:17 +01:00
Egor Pugin
db43bb43dc [test] Init FC early. 2021-01-06 00:30:52 +03:00
Egor Pugin
e6b00e6579 [test] Init fontconfig early. 2021-01-05 20:48:09 +03:00
Egor Pugin
6e94564152 [training] More unique ptrs. 2021-01-05 17:03:26 +03:00
Egor Pugin
4415209fd6 Remove tessopt. This fixes mastertrainer test in shared build. 2021-01-05 17:00:27 +03:00
Egor Pugin
d30b5415fd Reorder headers. 2021-01-05 16:46:24 +03:00
Egor Pugin
4ed601956e More std::vector. 2021-01-05 14:46:11 +03:00
Egor Pugin
e3dcfb648a Reorder includes. 2021-01-04 18:11:23 +03:00
Stefan Weil
a96a05df7a Add some basic tests for ELIST
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-03 22:02:51 +01:00
Stefan Weil
4186978dfc Add Leptonica library for ligature_table_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-01-03 21:45:27 +01:00
Egor Pugin
fd8907471c Improve C API. Add tests.
1. Add simple C API test in C++ program.
2. Add simple C API test in C program.
3. Fix including capi.h in C++ files.
2021-01-02 03:57:25 +03:00