Commit Graph
504 Commits
Author SHA1 Message Date
Stephen Toub def322ee4f Remove stale ctor and field from ObjectManager (dotnet/corefx#40326)
Commit migrated from https://github.com/dotnet/corefx/commit/bfe528311e52fd41afca1c981dc28c2e62d96721
2019-08-14 22:07:18 -04:00
Stephen Toub 18937a099f Remove dead branches from ObjectManager (dotnet/corefx#40327)
int.MaxValue is odd.  x * 2 will never be odd.

Commit migrated from https://github.com/dotnet/corefx/commit/c121f180b985f3bb2ca28096369eda7b7255af7b
2019-08-14 22:06:25 -04:00
Stephen Toub 9548bea38a Make many fields readonly or const across corefx (dotnet/corefx#40298)
* Make many fields readonly or const

* Address PR feedback

- Updated asn.xslt
- Regenerated .xml.cs files


Commit migrated from https://github.com/dotnet/corefx/commit/0cc22ccba707d7552159363d586262fa9c4e8a2a
2019-08-14 14:19:30 -04:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
2019-08-07 21:07:58 -04:00
Stephen Toub 0d8a87d1dd Enable stylecop warnings 1205, 1212, and 1617 (dotnet/corefx#39941)
* Enable stylecop warning 1617 (void return value should not be documented)

* Enable stylecop warning 1212 (get/set accessor ordering)

* Enable stylecop warning 1205 (modifier ordering)


Commit migrated from https://github.com/dotnet/corefx/commit/6074cfc995d7968fcdbc7f707acff0c6284c6ae9
2019-08-01 18:00:12 -04:00
Ganbarukamo41 9be9c570be Enable analyzer for xUnit2000 (Constants and literals should be the expected argument) (dotnet/corefx#39842)
* Enable xUnit2000 analyzer

This commit enables xUnit2000 (Constants and literals should be the expected argument) and apply fixes for the existing violating codes.
* a Massive commit fixing xUnit2000
* fixing some 2003 errors

* Fix mistakes

* Fix missed errors for unix


Commit migrated from https://github.com/dotnet/corefx/commit/93d7aa1c1737b6da29d04b78557215e18eb786d4
2019-07-28 15:47:52 -07:00
Zoey McCulloughandJeremy Barton 6820071ac0 Re-enable xunit warning 2002 dotnet/corefx#39696 (dotnet/corefx#39706)
* Removed null checks on value types and enabled xunit 2002

* Updated Fill_OpenDataReader_Throws to use range check

Updated Fill_OpenDataReader_Throws to use range check for passing path

* Removed uneeded asserts and updated others

- Removed any assert for a valuetype where it was succeeded by a value type assertion (e.g. Assert.Equal(1, 1))
- Updated reflection tests to check flags for the specified scenario

* Update src/Microsoft.VisualBasic.Core/tests/FileSystemTests.cs

Co-Authored-By: Jeremy Barton <[email protected]>

* Update src/System.Reflection/tests/AssemblyNameTests.cs

Co-Authored-By: Jeremy Barton <[email protected]>

* Fixed failing reflection tests and removed Assert.NotNull for enum

* Pulled ruleset up from master to merge

* Cleaned up assert ordering for TestGuid

* Updated TestResponseWithoutContentEvents

- Asserted for 200 OK based on response from DefaultAzureServer + EmptyContentHandler


Commit migrated from https://github.com/dotnet/corefx/commit/c96e389f803b043753558878fefb575f3f85c934
2019-07-26 09:58:06 -04:00
Viktor Hofer 4f76a9ffa2 Enable xunit2007 analyzer (dotnet/corefx#39740)
Commit migrated from https://github.com/dotnet/corefx/commit/619f140e2f0e722a17f3797d532b21ace774ec2e
2019-07-24 22:03:09 -04:00
Stephen Toub cd3ca6f991 Re-enable xunit warning 2004 (dotnet/corefx#39698)
* Replace "Assert.Equal(true, " with "Assert.True("

* Replace "Assert.Equal(false, " with "Assert.False("

And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.

* Replace "Assert.StrictEqual(true, " with "Assert.True("

* Revert a few changes where true/false was being compared to object

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
2019-07-23 17:05:15 -04:00
Stephen Toub 47f8f6d47d Re-enable xunit warning 2003 (dotnet/corefx#39696)
* Replace "Assert.Equal(null, " with "Assert.Null("

* Replace "Assert.NotEqual(null, " with "Assert.NotNull("

* Replace "Assert.Same(null, " with "Assert.Null("

* Replace "Assert.StrictEqual(null, " with "Assert.Null("


Commit migrated from https://github.com/dotnet/corefx/commit/6de660a02e335eefebfcc3c81ecb0013e2a8148e
2019-07-23 15:49:33 -04:00
Viktor Hofer ef7a0e676a Enable XUnit Analyzers (dotnet/corefx#38676)
* Enable XUnit Analyzers


Commit migrated from https://github.com/dotnet/corefx/commit/b8a7f34e1b64e5c594f591aa8683f34506eb9736
2019-07-05 22:50:57 +02:00
Jan Kotas 0ffbabc69c Prep work for cleaning up linker heuristics (dotnet/corefx#39142)
- Deleting dead or unrechable code
- Adding ILLinkTrim.xml files for types and methods accessed via reflection


Commit migrated from https://github.com/dotnet/corefx/commit/bc1f6ae4e757251c8691fe94e68617ce1516e684
2019-07-03 16:00:26 -07:00
Viktor Hofer 0f67ef28f8 Make CoreFx.Private.TestUtilites RID-agnostic (dotnet/corefx#36207)
* Make CoreFx.Private.TestUtilites RID-agnostic

* Add version checks for other distros

https://github.com/dotnet/corefx/commit/dotnet/corefx@4f0d10773ccbb4849b869b6a0a73d5938f1804bd
Porting fix over into PlatformDetection.

* Build test lib in advance for VS support

* Disable pretest in AllConfigurations

Commit migrated from https://github.com/dotnet/corefx/commit/d3d144fad9b600a0fc1ca6fc7d65c247fddd9f04
2019-06-29 21:53:19 +02:00
Jose Perez Rodriguez 275f6d0636 Making Exceptions serializable (dotnet/corefx#38893)
* Making Exceptions serializable

* Remove EventLog serialization exceptions from tests since they won't work on non-Windows platforms

* Fix build and add internal exceptions as well

* Add parameter-less constructor to RethrowException

* Adding PR Feedback

* Fix allConfigurations build


Commit migrated from https://github.com/dotnet/corefx/commit/7075587321a1b6b59248b1a6c7ea04fc803eab96
2019-06-26 11:59:59 -07:00
Levi Broderick 7d1f822abd Remove Serialization Guard public APIs (dotnet/corefx#38739)
* Remove Serialization Guard public APIs
- Also refactors reflection helpers into separate file

* PR feedback - remove DeserializationBlockedException refs entirely



Commit migrated from https://github.com/dotnet/corefx/commit/8b73a6dfacccefa8d160077ebff11007ff72fda3
2019-06-22 19:48:00 -07:00
Steve Harter f33959f58e Custom converter feature for JSON serializer (dotnet/corefx#38578)
Commit migrated from https://github.com/dotnet/corefx/commit/6b41813015ad0db7740523d65acfcd6a6d7b2df5
2019-06-19 11:27:09 -07:00
Viktor Hofer 5f98ba6a2b Enable project restore for test projects (dotnet/corefx#38151)
* Factor out repo restore into seperate props/targets

* Use configuration system msbuild sdk

* Remove XUnit.Runtime.depproj

* Remove TargetGroup usages in test projects

* Fix ILLink configuration

The ILLink package contains netcoreapp2.0 assets which are compatible
with netstandard2.0. Removing the old TargetFramework to restore
successfully.

* Remove usages from TargetGroup in Directory.Build.props

* Remove dead net4* configurations

* Change tests.builds to tests.proj sdk proj

* Make externals dir proj an sdk project

* Consume Microsoft.DotNet.CoreFxTesting as an msbuild sdk

* Use runtimeconfig.template.json

* Remove SupplementalTestData

* Map shared framework version to product version

* Stop binplacing tests

* Move some tool depprojs to targets during restore

* Remove dead code

* Use PackageReference instead of RefFromRuntime in test

* Disable using an apphost

* Copy compression testdata manually cause unicode bug

* Remove target batching in optimizationData

* Reference packaging tools from CoreFx.Private.TestUtilities


Commit migrated from https://github.com/dotnet/corefx/commit/c4c1985531cc1f25c805bbc4801b85c98e0dfee0
2019-06-15 21:27:13 +02:00
Viktor Hofer a5d5b91672 Delete dead uapaot code (dotnet/corefx#38330)
* Delete dead uapaot code

Commit migrated from https://github.com/dotnet/corefx/commit/8c2be7893fa585cba9c094c27b69d7c8e0822ef3
2019-06-14 15:12:42 +02:00
Viktor Hofer cacc1ff968 Remove NetNative uapaot support (dotnet/corefx#38170)
* Remove NetNative uapaot support

* Remove uapaot assets from packages

* Disable emit lightweight and ilgen version check


Commit migrated from https://github.com/dotnet/corefx/commit/ab58ff6e649852b85fdb99b15992a2fa3a7d8834
2019-06-06 21:39:46 +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
Stephen Toub 17974d4c53 Use better Array.Copy overload (dotnet/corefx#37548)
Just a little cleanup.  When we're working with T[]s, use Array.Copy that takes a lower bound, explicitly passing in 0, rather than forcing the implementation to query GetLowerBound() on each array.

Commit migrated from https://github.com/dotnet/corefx/commit/e72c6c53baddb02a630e8e6592a59d89e30b856b
2019-05-09 12:43:45 -04:00
Eric StJohn afd313db03 React to APICompat changes enabling reverse APICompat for facades (dotnet/corefx#37375)
* React to APICompat changes enabling reverse APICompat for facades

* Fix UAP and NETFX reverse APICompat issues

* Fix reverse APICompat baseline for allconfigurations build

* Manually update to latest APICompat

* Manually update to latest CoreCLR and fix issues

* Baseline System.Threading.Tasks

* Revert "Manually update to latest CoreCLR and fix issues"

This partially reverts commit dotnet/corefx@ee800617b6.

I'm keeping the baseline changes which will be needed when we get a new update.

* Temporarily baseline DiagnosticCounter API gaps

This can be removed when get a new CoreCLR

That's currently blocked due to regressions in tests.


Commit migrated from https://github.com/dotnet/corefx/commit/035343743c5a7f67be8a2a2f36913a3c43893b76
2019-05-07 19:46:58 -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
Jose Perez Rodriguez 7d8177c8c3 Fix VS Configurations for all projects in corefx (dotnet/corefx#37477)
Commit migrated from https://github.com/dotnet/corefx/commit/1c48331eb5784c58b81309665257f454abd7d322
2019-05-06 14:46:10 -07:00
Tanner Gooding 5a5ed7652a Regenerating reference sources in order to reorder enum fields (dotnet/corefx#37045)
Commit migrated from https://github.com/dotnet/corefx/commit/17382def0f680653870c31af1acf086ac41dcc0b
2019-04-23 13:40:45 -07:00
Anirudh Agnihotry bc2d80c6f4 Removed netcoreappaot configuration from corefx (dotnet/corefx#36739)
* netcoreappaot-Windows_NT regex removed

* netcoreappaot-WebAssembly;\n regex removed

* netcoreappaot-Windows_NT-Debug;netcoreappaot-Windows_NT-Release;
regex removed

* netcoreappaot; regex removed

* netcoreappaot-Debug;netcoreappaot-Release; removed

* removing rest of occurences of netcoreappaot

* deleteing the netcoreappaot apicompat files


Commit migrated from https://github.com/dotnet/corefx/commit/e9d1a10ed1d38a8b1ed599b3b5be09b8349f8ea8
2019-04-09 14:07:31 -07:00
Morgan Brown e15e93f378 Implement Serialization Guard - CoreFX portion
Consume Serialization Guard API in BinaryFormatter and Process.

Also includes Serialization Guard's tests.

Commit migrated from https://github.com/dotnet/corefx/commit/6ca16758a5d454c1f1b04975bf55f259dd71fc49
2019-04-08 10:53:37 -07:00
Viktor 7e4b5f9b01 Update src folder
Commit migrated from https://github.com/dotnet/corefx/commit/817c36a05ef2d92e59ce6f5a37e2be50076361b3
2019-04-02 19:21:57 +02:00
Stephen Toub 1de0f651e4 Improve StaticTestGenerator and fix some visibility (dotnet/corefx#36472)
Worked through a bunch of additional assemblies and fixed cases where StaticTestGenerator was doing the wrong thing.  Also fixed the visibility on a bunch of test methods it wasn't able to access.

Commit migrated from https://github.com/dotnet/corefx/commit/475542441df2f054d5e9aa39576019775a5d2f52
2019-03-29 17:40:05 -04:00
Stephen Toub f93f576fe3 Remove stale TODO
We have no plans to address this further.

Commit migrated from https://github.com/dotnet/corefx/commit/57642c99f187a4611763d1c5b3efb4347d27c1b3
2019-03-12 10:40:45 -04:00
Maryam Ariyan 226a8904e4 Expose AmbiguousImplementationException and add tests (dotnet/corefx#35632)
* Expose AmbiguousImplementationException and add tests

Fixes: dotnet/corefx#34124


Commit migrated from https://github.com/dotnet/corefx/commit/34337c3a73675aa06f09d81b15bc926889b44922
2019-03-07 13:40:50 -08:00
Stephen Toub dce7647bbc Clean up lots of string.Format / SR.Format usage (dotnet/corefx#35777)
* Clean up lots of string.Format usage

This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format.  This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...).  This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.

* Address PR feedback

* Fix breaks due to lower netstandard builds


Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
2019-03-06 12:03:00 -08:00
Stephen Toub 816802e154 Avoid NullReferenceException in BinaryObjectInfo (dotnet/corefx#35740)
A corrupted BinaryFormatter stream can result in a BinaryObjectInfo getting constructed before the ObjectManager is constructed, resulting in the BinaryObjectInfo not having a reference to the ObjectManager.  Attempts to use it then hit a null reference exception.

Commit migrated from https://github.com/dotnet/corefx/commit/7622efd2dbd363a632e00b6b95be4d990ea125de
2019-03-03 16:22:23 -08:00
Viktor Hofer f8a8530d0f Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets


Commit migrated from https://github.com/dotnet/corefx/commit/c390ce7df50252e11f5d322276e9d19e046d1332
2019-03-03 18:55:25 +01:00
Ahson Khan 4fed6ab881 Auto-generate the reference assemblies and separate type forwards (dotnet/corefx#35557)
* Auto-generate the reference assemblies

* Add back type forwards.

* Revert "Add back type forwards."

This reverts commit dotnet/corefx@3acf74aabb.

* Add back TypeForwardedTo in .Forward.cs files

* Add new type forward files to the csproj files

* Add back if-defs and move TestUtilities comment from ref to source

* Remove duplicate definitions, delete unnecessary manual files,

* Fix build breaks

* Add back missing AsyncMethodBuilderAttr to S.Runtime ref

* Fix typo between XmlDocument and XPath.XDocument

* Add type forward fild missed from previous commit

* Fix ECDiffieHellmanCngPublicKey internal ctor for netfx 4.6.1

* Remove "this type was moved to comments" from the type forwards.

* Add back the Xml and Debugger* attributes to Xml.ReaderWriter

* Add back struct layout attributes

* Add back attributes missing (highlighted from api compat)

* Add missing toolbox item attribute in s.data.common.

* Add missing struct layout attributes and remove unnecessary additions

* Add back InterfaceTypeAttribute


Commit migrated from https://github.com/dotnet/corefx/commit/16689aa0a933517dc45465fc6edb6223222414a6
2019-02-27 19:39:21 -08:00
Eric StJohn 20f107e1bb Make System.Runtime.CompilerServices.Unsafe inbox (dotnet/corefx#35526)
* Make System.Runtime.CompilerServices.Unsafe inbox

Fix a couple places where we wanted to use it from other inbox assemblies but couldn't.

Unsafe remains as a package and newer versions of Unsafe will replace the inbox Version,
permitting us to add API over time.

* Update Rune tests to use TryEncodeToUtf8Bytes directly

* Add temporary suppression to package tests


Commit migrated from https://github.com/dotnet/corefx/commit/9074d9f5b513a95b7eac9ba1112069c29230d1d2
2019-02-22 18:20:16 -08:00
Viktor Hofer f18766f66f Add net472 build3260 blobs (dotnet/corefx#35448)
Commit migrated from https://github.com/dotnet/corefx/commit/b018ced265fe099679be0ec1e7afa805a154d49a
2019-02-20 18:52:01 +01:00
Maryam Ariyan 113200c30f Add SwitchExpressionException (dotnet/corefx#34954)
* Add SwitchExpressionException

Fixes: dotnet/corefx#33284

* Apply PR feedbacks

* Type just added to .net core 3.0

* quick cleanup

* Add test in BinaryFormatterTestData

* Updated the APIs for SwitchExpressionException

* Remove IsSerializable condition


Commit migrated from https://github.com/dotnet/corefx/commit/3685052201c95462f210582be9fe380baf1b902e
2019-02-07 18:49:42 -08:00
Viktor Hofer e9bae8f28c Fix uapaot binaryformatter tests (dotnet/corefx#35079)
Commit migrated from https://github.com/dotnet/corefx/commit/61a8b5b02aa88772d2a73d643cfeb20bf3715458
2019-02-04 15:52:11 -08:00
Liran Chen ba6b2d0da1 Replaced hardcoded value (2) with TypeCode.DBNull (dotnet/corefx#34707)
Commit migrated from https://github.com/dotnet/corefx/commit/34fd5242fc32e691e33e02b435b7a9b6cb01a2af
2019-01-20 19:35:24 -05:00
Viktor Hofer 4a649721d1 Add SyncSortedList serialization test and remove SyncRoot (dotnet/corefx#34339)
* Add SyncSortedList serialization tests and remove SyncRoot

* Disable blob comparison for SyncSortedList

On UWP we get different blobs for SyncSortedList as reflection behaves
differently as the amount of types that we tests is less than in
.NET Core and .NET Framework. The order of fields that are serialized
into the payload are different in such a case.
Therefore we just disable the blob comparison for this type entirely.


Commit migrated from https://github.com/dotnet/corefx/commit/de591233c04efa019ea2aed0a8fc5181f6d4210b
2019-01-08 17:46:36 +01:00
Stanislav Ushakov ac76a68271 Removed global suppression of CS1573 and CS1591 warnings (dotnet/corefx#34232)
* Removed global suppression of CS1573 and CS1591, moved suppression to the project level.

* Fixes for netfx build, added 2 projects


Commit migrated from https://github.com/dotnet/corefx/commit/adb4d48fe65d48b6dd1c2ff15c8a60e5f96bf266
2018-12-24 12:17:29 -05:00
Stephen Toub 7097b4fc3b Add BinaryFormatter and TypedReference test involving struct with readonly field (dotnet/corefx#33690)
* Add BinaryFormatter test involving struct with readonly field

* Add MakeTypedReference test for readonly field


Commit migrated from https://github.com/dotnet/corefx/commit/1197641767c4c281ddcd38d3bf3bf6b2bb79abca
2018-11-27 12:55:21 -05:00
Viktor Hofer 976ee8955e Fix IsDrawingSupported condition and streamline code
Fix unix IsDrawingSupported & rename helper method in Drawing


Commit migrated from https://github.com/dotnet/corefx/commit/64c979d70525f7113880c1f07f6165d860f30962
2018-11-19 13:14:44 -08:00
Santiago Fernandez Madero 7124cbb852 Add missing TypeForwardedFromAttribute to System.Drawing serializable types (dotnet/corefx#33499)
Commit migrated from https://github.com/dotnet/corefx/commit/711a1040709bdb2150f5bae2ef2604755d94d10a
2018-11-15 15:09:03 -05: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
Viktor Hofer e9327f501c Make Font serializable (dotnet/corefx#33445)
Commit migrated from https://github.com/dotnet/corefx/commit/6e55e0fa6711a15e1e02a6948532979a142c993b
2018-11-13 15:38:57 +01:00
Maryam Ariyan f09a0545b7 Expose ArgIterator (dotnet/corefx#33369)
Expose ArgIterator

Adding IsArgIteratorSupported and IsArgIteratorNotSupported for tests

Asserts PNSE when not supported

Fixes: dotnet/corefx#32898

Commit migrated from https://github.com/dotnet/corefx/commit/e9d7a5f20120d77941b72763336f4455bd175ec7
2018-11-12 08:30:19 -08: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