@@ -142,9 +142,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
142
142
143
143
const fly::Json json {
144
144
{fly::test::TestConfig::identifier, {{" name" , " John Doe" }, {" address" , " MA" }}}};
145
- const std::string contents (json);
146
145
147
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents ));
146
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json. serialize () ));
148
147
task_runner->wait_for_task_to_complete (s_config_manager_file);
149
148
task_runner->wait_for_task_to_complete (s_config_manager_file);
150
149
@@ -156,7 +155,7 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
156
155
CATCH_CHECK (config->get_value <std::string>(" address" , " " ) == " MA" );
157
156
}
158
157
159
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents + " \n " ));
158
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json. serialize () + " \n " ));
160
159
task_runner->wait_for_task_to_complete (s_config_manager_file);
161
160
162
161
CATCH_CHECK (config_manager->prune () == initial_size);
@@ -166,9 +165,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
166
165
{
167
166
const fly::Json json {
168
167
{fly::test::TestConfig::identifier, {{" name" , " John Doe" }, {" address" , " MA" }}}};
169
- const std::string contents (json);
170
168
171
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents ));
169
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json. serialize () ));
172
170
task_runner->wait_for_task_to_complete (s_config_manager_file);
173
171
task_runner->wait_for_task_to_complete (s_config_manager_file);
174
172
@@ -184,9 +182,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
184
182
185
183
const fly::Json json {
186
184
{fly::test::TestConfig::identifier, {{" name" , " John Doe" }, {" address" , " MA" }}}};
187
- const std::string contents (json);
188
185
189
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents ));
186
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json. serialize () ));
190
187
task_runner->wait_for_task_to_complete (s_config_manager_file);
191
188
task_runner->wait_for_task_to_complete (s_config_manager_file);
192
189
@@ -200,9 +197,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
200
197
201
198
const fly::Json json1 {
202
199
{fly::test::TestConfig::identifier, {{" name" , " John Doe" }, {" address" , " MA" }}}};
203
- const std::string contents1 (json1);
204
200
205
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents1 ));
201
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json1. serialize () ));
206
202
task_runner->wait_for_task_to_complete (s_config_manager_file);
207
203
task_runner->wait_for_task_to_complete (s_config_manager_file);
208
204
@@ -212,9 +208,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
212
208
213
209
const fly::Json json2 {
214
210
{fly::test::TestConfig::identifier, {{" name" , " Jane Doe" }, {" age" , 27 }}}};
215
- const std::string contents2 (json2);
216
211
217
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents2 ));
212
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json2. serialize () ));
218
213
task_runner->wait_for_task_to_complete (s_config_manager_file);
219
214
220
215
// Multiple fly::PathEvent::Changed events may be triggered even though the above write
@@ -235,9 +230,8 @@ CATCH_TEST_CASE("ConfigManager", "[config]")
235
230
236
231
const fly::Json json {
237
232
{fly::test::TestConfig::identifier, {{" name" , " John Doe" }, {" address" , " MA" }}}};
238
- const std::string contents (json);
239
233
240
- CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, contents ));
234
+ CATCH_REQUIRE (fly::test::PathUtil::write_file (config_file, json. serialize () ));
241
235
task_runner->wait_for_task_to_complete (s_config_manager_file);
242
236
task_runner->wait_for_task_to_complete (s_config_manager_file);
243
237
0 commit comments