From: Robert Jordan Date: Wed, 17 Sep 2008 11:28:51 +0000 (-0000) Subject: 2008-09-04 Robert Jordan X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=3b1eaca759d958e174f349216d5b89a8b69bf889;p=mono.git 2008-09-04 Robert Jordan * corlib_test.dll: Add S.R.S/SerializationTest2.cs In System.Runtime.Serialization.Formatters.Binary: 2008-09-17 Robert Jordan > * ObjectReader.cs (ReadTypeMetadata): Replace the check for ISerializable with something less `reflective'. Fixes #421664. In Test/System.Runtime.Serialization: 2008-09-17 Robert Jordan * SerializationTest2.cs: Add test case for bug #421664. svn path=/trunk/mcs/; revision=113278 --- diff --git a/mcs/class/corlib/ChangeLog b/mcs/class/corlib/ChangeLog index 73b59270537..dee16ae258a 100644 --- a/mcs/class/corlib/ChangeLog +++ b/mcs/class/corlib/ChangeLog @@ -1,3 +1,7 @@ +2008-09-04 Robert Jordan + + * corlib_test.dll: Add S.R.S/SerializationTest2.cs + 2008-08-27 Marek Safar * Makefile: Removed disabled global 649 warning. diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog index 814a129999b..1353b32cc92 100644 --- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog +++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog @@ -1,3 +1,9 @@ +2008-09-17 Robert Jordan > + + * ObjectReader.cs (ReadTypeMetadata): Replace the check for + ISerializable with something less `reflective'. + Fixes #421664. + 2008-06-27 Andreas Nahr * BinaryFormatter.cs: Fix parameter name diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs index 25d5ba2512d..5e90a40acbe 100644 --- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs +++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs @@ -632,7 +632,7 @@ namespace System.Runtime.Serialization.Formatters.Binary if (!metadata.Type.IsSerializable) throw new SerializationException("Serializable objects must be marked with the Serializable attribute"); - metadata.NeedsSerializationInfo = (metadata.Type.GetInterface ("ISerializable") != null); + metadata.NeedsSerializationInfo = typeof (ISerializable).IsAssignableFrom (metadata.Type); if (!metadata.NeedsSerializationInfo) { metadata.MemberInfos = new MemberInfo [fieldCount]; diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog b/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog index 5bf1e5623b8..b660b1cbcf9 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog +++ b/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog @@ -1,57 +1,61 @@ -2006-10-29 Robert Jordan - - * SerializationCallbackTest.cs: Add test case for bug #78594. - -2005-12-21 Raja R Harinath - - * SerializationTest.cs: Use Assert.AreEqual instead of - Assertion.AssertEquals. - (ReadData): Fix order of 'expected' and 'actual' when validating - 'list'. - (*.CheckEqual): Add new 'context' argument. Encodes the path - taken to get to th current object. - -2005-12-15 Gert Driesen - - * ObjectManagerTest.cs: New test for bug #76931. - -2005-03-23 Lluis Sanchez Gual - - * ArraySerializationTest.cs: New serialization tests. - -2005-03-04 Lluis Sanchez Gual - - * SerializationTest.cs: Improved test. - -2004-12-09 Lluis Sanchez Gual - - * SerializationTest.cs: Added test for bug #70104. - -2004-05-13 Lluis Sanchez Gual - - * SerializationTest.cs: Test serialization of empty struct arrays. This - used to fail. - -2003-07-23 Lluis Sanchez Gual - - * SerializationTest.cs: Fixed delegate invocation. Didn't compile - on windows. - -2003-07-23 Lluis Sanchez Gual - - * SerializationTest.cs: Added. - -2002-12-21 Nick Drochak - - * all: make tests build and run under nunit2 - -2002-08-20 Gonzalo Paniagua Javier - - * AllTests.cs: added FormatterServicesTests. - * FormatterServicesTests.cs: New file. - -2002-06-24 Gonzalo Paniagua Javier - - * AllTests.cs: New file to make 'make test' work. - * ChangeLog: New file. - +2008-09-17 Robert Jordan + + * SerializationTest2.cs: Add test case for bug #421664. + +2006-10-29 Robert Jordan + + * SerializationCallbackTest.cs: Add test case for bug #78594. + +2005-12-21 Raja R Harinath + + * SerializationTest.cs: Use Assert.AreEqual instead of + Assertion.AssertEquals. + (ReadData): Fix order of 'expected' and 'actual' when validating + 'list'. + (*.CheckEqual): Add new 'context' argument. Encodes the path + taken to get to th current object. + +2005-12-15 Gert Driesen + + * ObjectManagerTest.cs: New test for bug #76931. + +2005-03-23 Lluis Sanchez Gual + + * ArraySerializationTest.cs: New serialization tests. + +2005-03-04 Lluis Sanchez Gual + + * SerializationTest.cs: Improved test. + +2004-12-09 Lluis Sanchez Gual + + * SerializationTest.cs: Added test for bug #70104. + +2004-05-13 Lluis Sanchez Gual + + * SerializationTest.cs: Test serialization of empty struct arrays. This + used to fail. + +2003-07-23 Lluis Sanchez Gual + + * SerializationTest.cs: Fixed delegate invocation. Didn't compile + on windows. + +2003-07-23 Lluis Sanchez Gual + + * SerializationTest.cs: Added. + +2002-12-21 Nick Drochak + + * all: make tests build and run under nunit2 + +2002-08-20 Gonzalo Paniagua Javier + + * AllTests.cs: added FormatterServicesTests. + * FormatterServicesTests.cs: New file. + +2002-06-24 Gonzalo Paniagua Javier + + * AllTests.cs: New file to make 'make test' work. + * ChangeLog: New file. + diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/SerializationTest2.cs b/mcs/class/corlib/Test/System.Runtime.Serialization/SerializationTest2.cs new file mode 100644 index 00000000000..897dcb41a8d --- /dev/null +++ b/mcs/class/corlib/Test/System.Runtime.Serialization/SerializationTest2.cs @@ -0,0 +1,61 @@ +// +// System.Runtime.Serialization.SerializationTest2.cs +// +// Test case for bug #421664. +// +// Author: Robert Jordan +// +// Copyright (C) 2008 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +// We need a different namespace because we pollute it with +// a new ISerializable declaration. +namespace MonoTests.System.Runtime.Serialization2 +{ + public interface ISerializable + { + } + + [Serializable] + public class Class : ISerializable + { + } + + [TestFixture] + public class SerializationTest2 + { + [Test] + public void TestSerialization () + { + MemoryStream ms = new MemoryStream (); + + new BinaryFormatter ().Serialize (ms, new Class ()); + ms.Position = 0; + new BinaryFormatter ().Deserialize (ms); + } + } +} diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources index a1c6461485d..bc906cf7228 100644 --- a/mcs/class/corlib/corlib_test.dll.sources +++ b/mcs/class/corlib/corlib_test.dll.sources @@ -166,6 +166,7 @@ System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinaryTest.cs System.Runtime.Serialization/FormatterServicesTests.cs System.Runtime.Serialization/ObjectIDGeneratorTests.cs System.Runtime.Serialization/SerializationTest.cs +System.Runtime.Serialization/SerializationTest2.cs System.Runtime.Serialization/SerializationCallbackTest.cs System.Runtime.Serialization/ArraySerializationTest.cs System.Runtime.Serialization/ObjectManagerTest.cs