Skip to content

Commit db07a69

Browse files
committed
Add more hacks for use with Google unittests
Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent b65b4af commit db07a69

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

unittest/include_gunit.h

+14-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,23 @@
1919

2020
const char* FLAGS_test_tmpdir = ".";
2121

22-
class file : public tesseract::File {};
22+
class file : public tesseract::File {
23+
public:
24+
static bool GetContents(const std::string& filename, std::string* out, int) {
25+
return File::ReadFileToString(filename, out);
26+
}
2327

28+
static int Defaults() {
29+
return 0;
30+
}
31+
};
32+
33+
#if !defined(ABSL_ARRAYSIZE)
2434
#define ABSL_ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
35+
#endif
2536
#define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
2637
#define CHECK(test) ASSERT_HOST(test)
38+
#define CHECK_GT(test, value) ASSERT_HOST((test) > (value))
39+
#define CHECK_OK(test) ASSERT_HOST(test)
2740

2841
#endif // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

0 commit comments

Comments
 (0)