summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc')
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index ddb5474df3..f89a2ce0c7 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -53,10 +53,11 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
CreateLocalPT(preloaded_pt_filename_);
// Update preloadedPT
std::ifstream ifile(preloaded_pt_filename_);
- Json::Reader reader;
+ Json::CharReaderBuilder reader_builder;
Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ if (ifile.is_open() &&
+ Json::parseFromStream(reader_builder, ifile, &root, nullptr)) {
root["policy_table"]["module_config"]["preloaded_date"] =
new_data.new_date_;
Json::Value val(Json::objectValue);
@@ -70,9 +71,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
}
ifile.close();
- Json::StyledStreamWriter writer;
std::ofstream ofile(preloaded_pt_filename_);
- writer.write(ofile, root);
+ ofile << root;
ofile.flush();
ofile.close();