mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 11:04:26 +00:00
Merge pull request #48 from quamotion/fixes/serialization-primitives
Update list of serialization primitives
This commit is contained in:
@@ -37,5 +37,37 @@ namespace plistcil.test
|
||||
writer.Write(root);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Roundtrip3Test()
|
||||
{
|
||||
byte[] data = File.ReadAllBytes("test-files/plist3.bin");
|
||||
NSObject root = PropertyListParser.Parse(data);
|
||||
|
||||
using (MemoryStream actualOutput = new MemoryStream())
|
||||
using (Stream expectedOutput = File.OpenRead("test-files/plist3.bin"))
|
||||
using (ValidatingStream validatingStream = new ValidatingStream(actualOutput, expectedOutput))
|
||||
{
|
||||
BinaryPropertyListWriter writer = new BinaryPropertyListWriter(validatingStream);
|
||||
writer.ReuseObjectIds = false;
|
||||
writer.Write(root);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Roundtrip4Test()
|
||||
{
|
||||
byte[] data = File.ReadAllBytes("test-files/plist4.bin");
|
||||
NSObject root = PropertyListParser.Parse(data);
|
||||
|
||||
using (MemoryStream actualOutput = new MemoryStream())
|
||||
using (Stream expectedOutput = File.OpenRead("test-files/plist4.bin"))
|
||||
using (ValidatingStream validatingStream = new ValidatingStream(actualOutput, expectedOutput))
|
||||
{
|
||||
BinaryPropertyListWriter writer = new BinaryPropertyListWriter(validatingStream);
|
||||
writer.ReuseObjectIds = false;
|
||||
writer.Write(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,12 @@
|
||||
<None Update="test-files\plist2.bin">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="test-files\plist3.bin">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="test-files\plist4.bin">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="test-files\RoundtripBinaryIndentation.plist">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
BIN
plist-cil.test/test-files/plist3.bin
Normal file
BIN
plist-cil.test/test-files/plist3.bin
Normal file
Binary file not shown.
BIN
plist-cil.test/test-files/plist4.bin
Normal file
BIN
plist-cil.test/test-files/plist4.bin
Normal file
Binary file not shown.
@@ -422,13 +422,18 @@ namespace Claunia.PropertyList
|
||||
|| content == "$classname"
|
||||
|| content == "NS.objects"
|
||||
|| content == "NS.keys"
|
||||
|| content == "NS.base"
|
||||
|| content == "NS.relative"
|
||||
|| content == "NS.string"
|
||||
|| content == "NSURL"
|
||||
|| content == "NSDictionary"
|
||||
|| content == "NSObject"
|
||||
|| content == "NSMutableDictionary"
|
||||
|| content == "NSMutableArray"
|
||||
|| content == "NSArray"
|
||||
|| content == "NSUUID";
|
||||
|| content == "NSUUID"
|
||||
|| content == "NSKeyedArchiver"
|
||||
|| content == "NSMutableString";
|
||||
}
|
||||
|
||||
internal static bool IsSerializationPrimitive(NSNumber n)
|
||||
|
||||
Reference in New Issue
Block a user