Commit Graph

338 Commits

Author SHA1 Message Date
Stefan Weil
135a18f564 Add more list tests
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-26 22:39:06 +01:00
Stefan Weil
595346d548 Replace some snprintf by std::to_string and modernize more code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-24 08:01:59 +01:00
Stefan Weil
67dcbdda2f Fix some compiler warnings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 10:36:38 +01:00
Stefan Weil
4530763329 Fix some compiler warnings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:15:09 +01:00
Stefan Weil
fbaac9dc9d Modernize code (clang-tidy -checks='-*,google-readability-braces-around-statements')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:03:51 +01:00
Stefan Weil
49d4afca63 Modernize code (clang-tidy -checks='-*,modernize-use-equals-*')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:57 +01:00
Stefan Weil
2a83c4a898 Modernize code (clang-tidy -checks='-*,modernize-use-emplace')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:57 +01:00
Stefan Weil
a54dc6390d Modernize code (clang-tidy -checks='-*,modernize-use-auto')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:57 +01:00
Stefan Weil
77ed2886a7 Modernize code (clang-tidy -checks='-*,modernize-loop-convert')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:51 +01:00
Stefan Weil
cb80eb6963 Modernize code (clang-tidy -checks='-*,modernize-use-override')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:13 +01:00
Stefan Weil
0c20d3f843 Fix compiler warnings (mostly -Wsign-compare)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 09:29:34 +01:00
Stefan Weil
a39db7e581 Replace remaining GenericVector by std::vector for src/unittest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-18 15:40:47 +01:00
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