mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
Fix build for unicharcompress_test
* Add abseil library * Add minimalistic implementation for WriteStringToFile * Add missing namespace for std::string Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
e67ad46fca
commit
0ae8fdc859
@ -244,7 +244,7 @@ unichar_test_SOURCES = unichar_test.cc
|
||||
unichar_test_LDADD = $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS) $(ICU_UC_LIBS)
|
||||
|
||||
unicharcompress_test_SOURCES = unicharcompress_test.cc
|
||||
unicharcompress_test_LDADD = $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS) $(ICU_UC_LIBS)
|
||||
unicharcompress_test_LDADD = $(ABSEIL_LIBS) $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS) $(ICU_UC_LIBS)
|
||||
|
||||
unicharset_test_SOURCES = unicharset_test.cc
|
||||
unicharset_test_LDADD = $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS) $(ICU_UC_LIBS)
|
||||
|
@ -23,7 +23,10 @@ class file : public tesseract::File {
|
||||
public:
|
||||
|
||||
// Create a file and write a string to it.
|
||||
static bool WriteStringToFile(const std::string& contents, const std::string& name);
|
||||
static bool WriteStringToFile(const std::string& contents, const std::string& filename) {
|
||||
File::WriteStringToFileOrDie(contents, filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool GetContents(const std::string& filename, std::string* out, int) {
|
||||
return File::ReadFileToString(filename, out);
|
||||
|
@ -237,7 +237,7 @@ TEST_F(UnicharcompressTest, GetEncodingAsString) {
|
||||
ExpectCorrect("trivial");
|
||||
STRING encoding = compressed_.GetEncodingAsString(unicharset_);
|
||||
std::string encoding_str(&encoding[0], encoding.length());
|
||||
std::vector<string> lines =
|
||||
std::vector<std::string> lines =
|
||||
absl::StrSplit(encoding_str, "\n", absl::SkipEmpty());
|
||||
EXPECT_EQ(5, lines.size());
|
||||
// The first line is always space.
|
||||
|
Loading…
Reference in New Issue
Block a user