24 #ifndef DISABLED_LEGACY_ENGINE
27 if (!fp.
Open(full_path,
nullptr)) {
28 tprintf(
"Error opening file %s\n", full_path);
35 class ParamsModelTest :
public testing::Test {
36 #ifndef DISABLED_LEGACY_ENGINE
38 void SetUp()
override {
39 std::locale::global(std::locale(
""));
50 void TestParamsModelRoundTrip(
const std::string& params_model_filename)
const {
53 std::string orig_file = TestDataNameToPath(params_model_filename);
54 std::string out_file = OutputNameToPath(params_model_filename);
56 EXPECT_TRUE(LoadFromFile(orig_model,
"eng", orig_file.c_str()));
57 EXPECT_TRUE(orig_model.
SaveToFile(out_file.c_str()));
59 EXPECT_TRUE(LoadFromFile(duplicate_model,
"eng", out_file.c_str()));
60 EXPECT_TRUE(orig_model.
Equivalent(duplicate_model));
65 TEST_F(ParamsModelTest, TestEngParamsModelIO) {
66 #ifdef DISABLED_LEGACY_ENGINE
70 TestParamsModelRoundTrip(
"eng.params_model");