Use a utility function to compare json document and expected string

Signed-off-by: srikappa <srikappa@amazon.com>
This commit is contained in:
srikappa
2021-07-12 14:21:04 -07:00
parent b7e3db9d82
commit c494adba88
2 changed files with 3 additions and 6 deletions
@@ -71,10 +71,7 @@ namespace JsonSerializationTests
const AZ::JsonApplyPatchSettings& settings = AZ::JsonApplyPatchSettings{})
{
CheckApplyPatchOutcome(target, patch, outcome, processing, settings);
rapidjson::Document expectedPatchedDocument;
expectedPatchedDocument.Parse(expectedPatchedResult);
ASSERT_FALSE(expectedPatchedDocument.HasParseError());
EXPECT_EQ(AZ::JsonSerialization::Compare(expectedPatchedDocument, *m_jsonDocument), AZ::JsonSerializerCompareResult::Equal);
Expect_DocStrEq(expectedPatchedResult);
}
void CheckCreatePatch_Core(const char* source, AZStd::string_view patch, const char* target,
@@ -265,8 +265,8 @@ namespace AzToolsFramework
AZ_Error(
"Prefab",
result.GetOutcome() != AZ::JsonSerializationResult::Outcomes::PartialSkip &&
result.GetOutcome() != AZ::JsonSerializationResult::Outcomes::Success,
result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::PartialSkip ||
result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::Success,
"Some of the patches are not successfully applied.");
//remove the link id placed into the instance