Commit Graph
28 Commits
Author SHA1 Message Date
Levi Broderick b4f738008b Add public ReferenceEqualityComparer API (#31753) 2020-02-14 23:23:14 -08:00
Jan KotasandStephen Toub 0b25063ec0 More renames of full framework to .NET Framework (#1900)
* More renames of full framework to .NET Framework

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <[email protected]>
2020-01-18 11:04:59 -08:00
Eriawan Kusumawardhono 89174f25b0 Replace tfm based constants with SDK ones (dotnet/corefx#41601)
* replace DefineConstants with SDK ones

Commit migrated from https://github.com/dotnet/corefx/commit/2133679ff62222ba2734232ab8fa4c65765e82a2
2019-10-15 19:11:40 +02:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
dotnet-maestro[bot] fc3491e249 [master] Update dependencies from dotnet/coreclr (dotnet/corefx#37746)
* Update dependencies from https://github.com/dotnet/coreclr build 20190516.72

- Microsoft.NET.Sdk.IL - 3.0.0-preview6-27716-72
- Microsoft.NETCore.ILAsm - 3.0.0-preview6-27716-72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6-27716-72

* Update dependencies from https://github.com/dotnet/coreclr build 20190517.72

- Microsoft.NET.Sdk.IL - 3.0.0-preview6-27717-72
- Microsoft.NETCore.ILAsm - 3.0.0-preview6-27717-72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6-27717-72

* Update dependencies from https://github.com/dotnet/coreclr build 20190518.72

- Microsoft.NET.Sdk.IL - 3.0.0-preview6-27718-72
- Microsoft.NETCore.ILAsm - 3.0.0-preview6-27718-72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6-27718-72

* Update dependencies from https://github.com/dotnet/coreclr build 20190519.72

- Microsoft.NET.Sdk.IL - 3.0.0-preview6-27719-72
- Microsoft.NETCore.ILAsm - 3.0.0-preview6-27719-72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6-27719-72

* Fix ref assemblies due to change in coreclr

* Fix serialization tests after TimeZone change


Commit migrated from https://github.com/dotnet/corefx/commit/c85411a30c2c3a1d6ad3beea7be92b19b1e24df9
2019-05-20 17:15:57 -07:00
Steve Harter c41d1d7d78 Add JsonException and make JsonSerializationException derive from JsonException and be internal (dotnet/corefx#37275)
Commit migrated from https://github.com/dotnet/corefx/commit/f6762c0e37641bf31b9957dc51e74089bac5a310
2019-05-06 18:00:49 -07:00
Stephen Toub 6c61c2b55c Fix BinaryFormatter serialization of arrays containing DateTimes (dotnet/corefx#33466)
* Fix EqualityExtensions handling of enumerables

The CheckSequenceEquals method is erroneously testing an enumerable against itself rather than against the intended other.  Luckily this didn't mask any failures in existing test data, but it does in new test data being added.

* Fix serialization of arrays containing DateTimes

When DateTimes are serialized individually, DateTime's serialization ctor/GetObjectData are used.  But when it's serialized as part of an array, a different path is taken that serializes it via a separate BinaryFormatter-specific "I know what this type is" mechanism, and that's currently dropping the Kind information from the DateTime, due to the necessary API on DateTime being internal and not available to BinaryFormatter.


Commit migrated from https://github.com/dotnet/corefx/commit/0b613fa6ffc60e80754346c1ea5f97a17f6aa3dd
2018-11-13 22:34:49 +01:00
Ahson Khan 714a878eb7 Add JsonUtf8Reader (for ReadOnlySpan) along with unit tests (dotnet/corefx#33216)
* Initial check-in for System.Text.Json library and solution

* Auto-generate the reference assembly

* Provide an overview README and roadmap

* Change the solution GUID to be unique

* Fix package description nit

* Change to MIT license instead of GPL

* Fix file extension of images to png

* Address PR feedback and only support netcoreapp

* Fix the configuration props and project files

* Add comments to the JsonTokenType enum

* Add an internal class for commonly used constants when reading JSON.

* Add a comment handling enum for lenient JSON reading

* Add a JsonReaderOptions struct to provide extensible customization of
JsonReader behaviour

* Add a JsonReaderException class which is thrown when we see an invalid
JSON text

* Add the skeleton for the JsonUtf8Reader ref struct and add files to
csproj

* Add JsonReaderState, ThrowHelper, and Strings resource file

* Address PR feedback, remove OS-specific configurations

* Complete the implementation of core JsonReader APIs for reading spans

* Update the reference assembly by auto-generating it

* Add unit tests and TryGet APIs

* Add XML comments to describe the JsonUtf8Reader at a high level

* Fix config and csproj to reference S.R.CS.U from Corelib

* Rename type from JsonUtf8Reader to Utf8JsonReader

* Remove remnants of ReadOnlySequeunce related fields/properties

* Add the remaining TryGetValueAsX APIs

* Change JsonReaderState ctor to accept JsonReaderOptions instead

* Seal the JsonReaderException class

* Rename LineBytePosition to BytePositionInLine

* Fix typo in ArrayEndWithinObject exception message

* Capitalize the acronym JSON within exception messages.

* Override GetObjectData and add a private deserialization ctor on
JsonReaderException

* Be explicit with lessThan in the IndexOfAny call site

* Only use ulong when Options isn't AllowComments to align stack usage

* Rename IndexOfAny helper to IndexOfOrLessThan

* Remove stray comment and fix xml comment for BytesConsumed

* Braces everywhere

* Rename localCopy to localBuffer to tie it to _buffer

* Add IsDigit and IsHexDigit helper methods

* Rename Solidus to Slash, ReverseSolidus to BackSlash, and Use Asterisk constant

* Use static encoder and avoid unnecessary allocation.

* Combine multiple TryParse calls that only differ by standardFormat

* Use SR.Format instead of string.Format and add debug.fail for default
case

* Make the exception as serializable and add test to BinaryFormatterTestData

* Fix exception messages, avoid printing control characters, and remove
unnecessary else.

* Make sure all exception messages are consistent and that they make sense
in context.

* Fix and add new comments, rename internal enum values, and remove
JsonLab

* Throw InvalidCastException from TryGetAsX if token type doesn't match

* Resolve TODOs, add issues, fix search for end of string, and remove recursive calls + add more tests.

* Use Unicode escape sequences for non-ASCII characters in tests.

* Add more tests related to skipping and consuming comments.

* Allocate the stack lazily, only when depth actually surpasses 64.

* Add a netcoreapp config to
System.Runtime.Serialization.Formatters.Tests.csproj

* Remove unnecessary DefineConstants property in test csproj

* Use Invariant Culture where necessary to avoid tests failing on es-ES
machines

* Fix up nits in the exception messages

* Add an IsTokenTypePrimitive helper method and fix comment spelling

* Use helper, use while(true) instead of goto, and change TryGet methods
to throw InvalidOperationException

* Shorten CommentHandling enum values and rename Default to Disallow

* Fix "is the stack empty" check in EndObject/EndArray

* Add previous token type to state and update it when token type is not a
comment

* Include comment delimiters as part of comment token, fix Debug.Assert
and tests.

* Add helper to avoid code duplication

* Add temporary workaround for Utf8 double parsing issue


Commit migrated from https://github.com/dotnet/corefx/commit/43759525e9a01fb9caedc0fb2281db5c65a16f65
2018-11-09 02:53:01 -08:00
Viktor Hofer 01fdc8d3d5 Make Image, Bitmap, Metafile and Icon serializable (dotnet/corefx#30817)
* Make Image, Bitmap, Metafile and Icon serializable

* Fix build error because of different namings on Unix & Windows

* Add Unix MemoryStream handling for serialization

* Simplify Icon deserialization logic

* Fix rename build break

* Fix build break again

* Add serialization tests for System.Drawing types

* Remove unnecessary null check in Icon

* Remove Debug fail invocations in Image deserialization

* Disable blob comparison for Drawing types

* Disable system.drawing.common binary formatter tests for uap since is a turd assembly

* Fix nano failures

* Fix typo in FindEncoderForFormat call

* Fix Windows test failures

* Fix unix deserialization where nativeImage pointer was not being set and update blobs

* Update metafile comment on why we skip it


Commit migrated from https://github.com/dotnet/corefx/commit/11c54f3bd947b8ceb41b51440379c49cf777248f
2018-09-13 13:45:37 -07:00
Viktor Hofer 5697ca8910 Add tests for EventArgs serialization (dotnet/corefx#25940)
* Add tests for EventArgs serialization

* Add EventArgs equality check as the type doesn't provide its own check


Commit migrated from https://github.com/dotnet/corefx/commit/b1737de9d53386da84cff232304f7143b0998d47
2018-01-02 20:42:28 +01:00
Viktor Hofer 72b37071cd Improve BinaryFormatter equality check logging (dotnet/corefx#25566)
* Improve Exception Assert logging

* Replace manual equality checks with Assert

* Add more test coverage for exceptions

* code style

* exclude two networking type checks


Commit migrated from https://github.com/dotnet/corefx/commit/fa80bd2e123652c1cba4fdbc9169f10aa9c1b2cd
2017-11-29 20:32:01 -08:00
Maryam Ariyan a63ea85fb5 Porting first half of the System.ComponentModel.Composition tests (dotnet/corefx#25437)
* Adding a portion of System.ComponentModel.Composition tests

Commit migrated from https://github.com/dotnet/corefx/commit/fed2d5ff6842b2ce932c70162f3e06a8d0304030
2017-11-28 20:07:39 -08:00
Viktor Hofer fcc00e81f3 Make corefx exceptions serializable and add typeforwards (dotnet/corefx#24427)
* Add serializable attribute and typeforward and adding serialization impl
* Expose ZLibException in impl assembly
* Remove deserialization negative tests
* Adding tests for exceptions
* Adding SqlError data to base exception data table
* System Data Facade
* Add netfx471 blob diffs for Hashtable and ListDictionary
* Build Microsoft.NETCore.App.deps.json after manual shims
* Disable currently failing uap/uapaot tests because of shim assembly load errors


Commit migrated from https://github.com/dotnet/corefx/commit/e3f74deb999571d3f34a6b2b8011caebcf06dbfc
2017-10-27 18:00:52 +02:00
Viktor Hofer 1b6e77f562 Cleanup code in System.Runtime.Serialization.Formatters.Tests (dotnet/corefx#23940)
* Cleanup code in System.Runtime.Serialization.Formatters.Tests

* Moved UnitySerializationHolder serialization test to System.Runtime.Tests


Commit migrated from https://github.com/dotnet/corefx/commit/705dc4196a6139b70dcf818c109b01aa295edcb1
2017-09-12 12:29:54 +02:00
Viktor Hofer 6704d84939 Fixing uap serialization errors for exceptions (dotnet/corefx#23808)
* Fixing uap serialization errors for exceptions

* pr changes

* Revert two updated blobs


Commit migrated from https://github.com/dotnet/corefx/commit/c89b4fb5050d9ca3de86dddce7fe3fd9dc34dc33
2017-09-06 01:34:07 +02:00
Viktor Hofer 2e4c798b3c Adding cross framework serialization and blob sanity check for serializable Exception types (dotnet/corefx#23523)
* Adding cross framework serialization and blob sanity check for serializable Exception types

* Add AggregateException equality check and check InnerException of Exception type

* Refine test data for exceptions

* Manual StackTrace override for Exception serialization tests

* Improved exception serialization data


Commit migrated from https://github.com/dotnet/corefx/commit/a534c0ebbd3c5741f97590ece32f1b31645f0994
2017-08-25 01:57:55 +02:00
Krzysztof Wicher c839ffc276 Add more serialization test cases and fix SqlGuid (dotnet/corefx#21137)
* add more test cases for existing types

* fix some test gaps and fix SqlGuid

* comment out UpdateBlobs


Commit migrated from https://github.com/dotnet/corefx/commit/766cc77dd6a468d23974fe3045bec0418c828bfc
2017-06-16 12:37:15 -07:00
Viktor Hofer f3b55355d6 Cross framework serialization finish up (dotnet/corefx#20870)
* wip: add stubs for custom isEqual

* Updated blobs, small code refactoring, disabled CookieContainer test

* Fixed netfx471 detection

* add custom equals for graph with cycles

* fix few more comparers

* Merge

* fix few more test cases

* fix few more types, fix GetExtensionMethod to work with parameters with same type name but different generic params

* finish tests (2 comparisons are commented out: search for TODO)

* Adding TypeForward for DictionaryNode

* Updating blobs

* Update Cookie hashes, adding TypeForwards, removing unnecessary equality checks for CookieCollection

* Reenabling SortedDictionary test

* Update blobs

* make cookie.Timestamp to roundtrip correctly

* regenerate netfx and corefx blobs to account for Cookie.Timestamp change

* make regex fix the blob for ObjectWithArray

* fix ObjectWithArray netfx test failure

* Replacing Dictionary with Hashtable for desktop serialization support

* Update blobs

* Fixing a lot of TypeForwards, adding another hashtable test, other fixes

* Adding a few more TypeForwardedFrom attributes

* Updating the coreclr version, disabling CookieContainer test

* Update blobs

* Disabling CompareInfo test --> waiting for coreclr

* generate test cases

* update blobs, comment out not working cases

* fix null equality checks for new test cases and reenable them

* PR feedback addressed

* Fixed a typo...

* Updating used coreclr version, enabling compareinfo test again


Commit migrated from https://github.com/dotnet/corefx/commit/cdfb6ecf11cae3f43d35233852ef422cb12ef3d8
2017-06-15 01:18:01 +02:00
Morgan Brown c46a97d532 More AOT serialization fixes (dotnet/corefx#20800)
* Fix byreflike test for UAPAOT

* More fixes for UAP AOT BinaryFormatter tests:
* Making Cookie serialize correctly (I'm not sure why this wasn't needed for CoreCLR)
* More rd.xml
* Avoid private reflection in the test Comparer comparison


Commit migrated from https://github.com/dotnet/corefx/commit/c1fe8a8352ba633abfad979ea2be6ade428f505b
2017-06-08 14:34:52 +02:00
Krzysztof Wicher 04b6689cc2 fix intermittent failures related to StringDictionary
Commit migrated from https://github.com/dotnet/corefx/commit/b63fa6507838fa4a09cc38f38519e35b17553884
2017-05-31 17:06:53 +02:00
Krzysztof Wicher 33f99ef9bf IsEqual override for DictionaryEntry, disable some netfx test cases
Commit migrated from https://github.com/dotnet/corefx/commit/75fdbc62bb58da6e10c03b85215e54b3e7a5d25c
2017-05-31 17:06:53 +02:00
Stephen Toub 836b2e90df Fix equality comparison of WeakReferences
Serialization of a WeakReference is dubious at best, as when it's deserialized, there won't be any strong references to the deserialized object it wraps, such that it's then immediately available for GC and will likely be gone by the time we go to look at it.


Commit migrated from https://github.com/dotnet/corefx/commit/f63e19aeb31d92eef0713572bf39877fcdb21b40
2017-05-30 17:33:40 -04:00
Viktor Hofer 56a4e0416d Added simple hash update test for internal use
Commit migrated from https://github.com/dotnet/corefx/commit/8abe61f7b8848525399e4a5f9a7b64c09e7bf47d
2017-05-30 22:46:33 +02:00
Viktor Hofer 8518f63842 Removed TimeZone
Commit migrated from https://github.com/dotnet/corefx/commit/3301fc87963aef36375cf924aeccc5ebd0d7f8ea
2017-05-30 22:43:08 +02:00
Viktor Hofer 69ffa20ae6 Partially revert ObservableCollection change dotnet/corefx@9e7cc5c99e
Commit migrated from https://github.com/dotnet/corefx/commit/6393248c7a986476f1e2d9dc4b1e5aff96459690
2017-05-30 22:43:06 +02:00
Viktor Hofer 128261a296 Removed types which arent coretypes anymore
Commit migrated from https://github.com/dotnet/corefx/commit/fe8811f6c092347aa551e705627aa887f5addc06
2017-05-30 22:31:22 +02:00
Viktor Hofer 48c9266098 Implement dynamic base64 object hash testing. Core Types fully tested.
Commit migrated from https://github.com/dotnet/corefx/commit/da10418c386db838ef2a8735121862a0ee908e5c
2017-05-30 22:31:22 +02:00
Viktor Hofer f296c1dee8 Initial
Commit migrated from https://github.com/dotnet/corefx/commit/4c49f2727399665ed6b9c828fdcaeaaca30e72fd
2017-05-30 22:31:22 +02:00