tesseract  5.0.0
tesseract::ParamsModelTest Class Reference
Inheritance diagram for tesseract::ParamsModelTest:

Protected Member Functions

void SetUp () override
 
std::string TestDataNameToPath (const std::string &name) const
 
std::string OutputNameToPath (const std::string &name) const
 
void TestParamsModelRoundTrip (const std::string &params_model_filename) const
 

Detailed Description

Definition at line 35 of file params_model_test.cc.

Member Function Documentation

◆ OutputNameToPath()

std::string tesseract::ParamsModelTest::OutputNameToPath ( const std::string &  name) const
inlineprotected

Definition at line 45 of file params_model_test.cc.

45  {
46  return file::JoinPath(FLAGS_test_tmpdir, name);
47  }
static std::string JoinPath(const std::string &s1, const std::string &s2)
Definition: include_gunit.h:65

◆ SetUp()

void tesseract::ParamsModelTest::SetUp ( )
inlineoverrideprotected

Definition at line 38 of file params_model_test.cc.

38  {
39  std::locale::global(std::locale(""));
40  }

◆ TestDataNameToPath()

std::string tesseract::ParamsModelTest::TestDataNameToPath ( const std::string &  name) const
inlineprotected

Definition at line 42 of file params_model_test.cc.

42  {
43  return file::JoinPath(TESTDATA_DIR, name);
44  }

◆ TestParamsModelRoundTrip()

void tesseract::ParamsModelTest::TestParamsModelRoundTrip ( const std::string &  params_model_filename) const
inlineprotected

Definition at line 50 of file params_model_test.cc.

50  {
51  tesseract::ParamsModel orig_model;
52  tesseract::ParamsModel duplicate_model;
54  std::string orig_file = TestDataNameToPath(params_model_filename);
55  std::string out_file = OutputNameToPath(params_model_filename);
56 
57  EXPECT_TRUE(LoadFromFile(orig_model, "eng", orig_file.c_str()));
58  EXPECT_TRUE(orig_model.SaveToFile(out_file.c_str()));
59 
60  EXPECT_TRUE(LoadFromFile(duplicate_model, "eng", out_file.c_str()));
61  EXPECT_TRUE(orig_model.Equivalent(duplicate_model));
62  }
bool SaveToFile(const char *full_path) const
bool Equivalent(const ParamsModel &that) const
static void MakeTmpdir()
Definition: include_gunit.h:38
std::string OutputNameToPath(const std::string &name) const
std::string TestDataNameToPath(const std::string &name) const

The documentation for this class was generated from the following file: