diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2022-11-23 17:15:15 -0500 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2022-11-23 17:15:15 -0500 | 
| commit | 42e0787446d35bf967ff088148f8ad5f902e929b (patch) | |
| tree | ed6dbf70cb161e5fa4917c2ede978b7848e7265b /indra/llcommon/tests | |
| parent | abe62c23d74d5319691a49881719b03cc9b5b090 (diff) | |
SL-18330: LLSDSerialize::deserialize() w/o hdr uses XML or notation
Absent a header from LLSDSerialize::serialize(), make deserialize()
distinguish between XML or notation by recognizing an initial '<'.
Diffstat (limited to 'indra/llcommon/tests')
| -rw-r--r-- | indra/llcommon/tests/llsdserialize_test.cpp | 28 | 
1 files changed, 28 insertions, 0 deletions
| diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 0334699c7f..bbbc32214b 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -574,6 +574,34 @@ namespace tut  		doRoundTripTests("LLSDNotationFormatter -> deserialize");  	}; +	template<> template<> +	void TestLLSDSerializeObject::test<9>() +	{ +		setFormatterParser(new LLSDXMLFormatter(false, "", LLSDFormatter::OPTIONS_NONE), +						   new LLSDXMLParser()); +		setParser(LLSDSerialize::deserialize); +		// This is an interesting test because LLSDXMLFormatter does not +		// emit an LLSD/XML header. +		doRoundTripTests("LLSDXMLFormatter -> deserialize"); +	}; + +/*==========================================================================*| +	// We do not expect this test to succeed. Without a header, neither +	// notation LLSD nor binary LLSD reliably start with a distinct character, +	// the way XML LLSD starts with '<'. By convention, we default to notation +	// rather than binary. +	template<> template<> +	void TestLLSDSerializeObject::test<10>() +	{ +		setFormatterParser(new LLSDBinaryFormatter(false, "", LLSDFormatter::OPTIONS_NONE), +						   new LLSDBinaryParser()); +		setParser(LLSDSerialize::deserialize); +		// This is an interesting test because LLSDBinaryFormatter does not +		// emit an LLSD/Binary header. +		doRoundTripTests("LLSDBinaryFormatter -> deserialize"); +	}; +|*==========================================================================*/ +  	/**  	 * @class TestLLSDParsing  	 * @brief Base class for of a parse tester. | 
