Skip to content

Commit e35726d

Browse files
morganbrkrwq
authored andcommitted
More serialization test fixes (dotnet#20377)
Removes a couple more tests that depend on ISerializable implementations and fixes a diagnosability issue in DataContractSerializer tests
1 parent b6f9533 commit e35726d

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,7 @@ public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsXmlDict
14361436
Assert.StrictEqual(((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty, "PropertyValue");
14371437
}
14381438

1439+
[ActiveIssue(20361)]
14391440
[Fact]
14401441
public static void DCS_ExceptionObject()
14411442
{
@@ -1450,6 +1451,7 @@ public static void DCS_ExceptionObject()
14501451
Assert.StrictEqual(value.HelpLink, actual.HelpLink);
14511452
}
14521453

1454+
[ActiveIssue(20361)]
14531455
[Fact]
14541456
public static void DCS_ArgumentExceptionObject()
14551457
{
@@ -1464,6 +1466,7 @@ public static void DCS_ArgumentExceptionObject()
14641466
Assert.StrictEqual(value.HelpLink, actual.HelpLink);
14651467
}
14661468

1469+
[ActiveIssue(20361)]
14671470
[Fact]
14681471
public static void DCS_ExceptionMessageWithSpecialChars()
14691472
{

src/System.Runtime.Serialization.Xml/tests/Utils.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ private static bool CompareXElements(XElement baselineXElement, XElement actualX
283283
XElement[] deskChildElems = baselineXElement.Descendants().OrderBy(m => m.Name.NamespaceName).ToArray();
284284
XElement[] coreCLRChildElems = actualXElement.Descendants().OrderBy(m => m.Name.NamespaceName).ToArray();
285285

286+
if(deskChildElems.Length != coreCLRChildElems.Length)
287+
{
288+
return false;
289+
}
290+
286291
for (int i = 0; i < deskChildElems.Length; i++)
287292
{
288293
if (!CompareXElements(deskChildElems[i], coreCLRChildElems[i])) return false;

src/System.Runtime/tests/System/Reflection/StrongNameKeyPairTests.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ public class SNKeyPairDerived : StrongNameKeyPair
1717
public SNKeyPairDerived(byte[] arr) : base(arr) {}
1818
public SNKeyPairDerived(FileStream keyPairFileStream) : base(keyPairFileStream) {}
1919
protected SNKeyPairDerived(SerializationInfo info, StreamingContext context) : base(info, context) {}
20-
21-
public SNKeyPairDerived SNKeyPairDerivedClone(ISerializable inter)
22-
{
23-
SerializationInfo info = new SerializationInfo(typeof(StrongNameKeyPair), new FormatterConverter());
24-
StreamingContext context = new StreamingContext();
25-
26-
inter.GetObjectData(info, context);
27-
28-
return new SNKeyPairDerived(info, context);
29-
}
3020
}
3121

3222
public class StrongNameKeyPairTests
@@ -37,10 +27,8 @@ public class StrongNameKeyPairTests
3727
public void SNKeyPairDerivedTestPosTest()
3828
{
3929
var sKeyPairDerived = new SNKeyPairDerived(s_data);
40-
var sKeyPair = sKeyPairDerived.SNKeyPairDerivedClone(sKeyPairDerived);
4130

4231
RunActionWithDataFileStream(fileStream => sKeyPairDerived = new SNKeyPairDerived(fileStream));
43-
sKeyPair = sKeyPairDerived.SNKeyPairDerivedClone(sKeyPairDerived);
4432
}
4533

4634
[Fact]

0 commit comments

Comments
 (0)