Skip to content

Commit

Permalink
Add more hacks for use with Google unittests
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 11, 2018
1 parent b65b4af commit db07a69
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion unittest/include_gunit.h
Expand Up @@ -19,10 +19,23 @@

const char* FLAGS_test_tmpdir = ".";

class file : public tesseract::File {};
class file : public tesseract::File {
public:
static bool GetContents(const std::string& filename, std::string* out, int) {
return File::ReadFileToString(filename, out);
}

static int Defaults() {
return 0;
}
};

#if !defined(ABSL_ARRAYSIZE)
#define ABSL_ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#endif
#define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#define CHECK(test) ASSERT_HOST(test)
#define CHECK_GT(test, value) ASSERT_HOST((test) > (value))
#define CHECK_OK(test) ASSERT_HOST(test)

#endif // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

0 comments on commit db07a69

Please sign in to comment.