Commit Graph
1007 Commits
Author SHA1 Message Date
Semyon A. Chertkovandsemyon.chertkov 5b5f1c94bd Fix XmlSchema does not correctly validate xs:NMTOKENS type restrictions with enumeration (#60544)
* ListFacetsChecker fix

* Added  Issue_60543 unit test

* retrigger checks

* Added more unit tests

* Update XmlSchemaSet.Tests.csproj

* TC_SchemaSet_NmTokens enhanced

* TC_SchemaSet_NmTokens test refactoring

Co-authored-by: semyon.chertkov <ngkKNG#xf3>
2021-12-13 14:43:16 +01:00
Julien Couvreur ab0de531c8 Escape lower-cased type names (#62507) 2021-12-09 00:05:25 -08:00
kronicandkronic 8c02da5d94 Optimize ReadOnlyTernaryTree for System.Private.Xml (#60076)
* change generator

* generate code

* Refactoring FindElementProperty, FindAttributeProperty

* fix method FindCaseInsensitiveString scope

* move enum TernaryTreeByte and fix scope

* fix naming in enum TernaryTreeByte

* use ROS in FindElementProperty, FindAttributeProperty

* genarate code

* minor refactoring HtmlRawTextWriterGenerator.ttinclude

* generate code

Co-authored-by: kronic <[email protected]>
2021-12-08 16:10:11 +01:00
kronicandkronic fa5d7ff9de Optimize XmlTextEncoder.Write (#61773)
* Optimize

* str->ros

* remove comment

* remove offset, count

* chunkSize to local

* Remove WriteStringFragment

* cleanup usings

* fix nullability

* optimize empty string

* Use ReadOnlySpan<char>

Co-authored-by: kronic <[email protected]>
2021-12-07 15:09:29 +01:00
Adam Sitnik 4aa8167f76 don't run the System.IO.FileSystem.DriveInfo tests in parallel (#62134)
* don't run the System.IO.FileSystem.DriveInfo in parallel, fixes #62119

* unify disabling test parallelization per assembly
2021-12-01 09:28:20 +01:00
Adeel Mujahid 03e0187a1a Fix miscellaneous typos (#62062)
* Fix miscellaneous typos

* Cleanup trailing whitespaces
```sh
# git remote add dotnet https://github.com/dotnet/runtime && git pull --rebase dotnet main

if uname 2>/devnull | grep -q Darwin; then
    space=" "
fi

git show --name-only --pretty="" HEAD...dotnet/main |\
    xargs -I{} sh -c "test -f {} && sed -i$space'' 's/[[:space:]]*$//' {}"
```
2021-11-26 16:32:13 -08:00
kronicandkronic c03f4ecda0 refactoring (#60074)
Co-authored-by: kronic <[email protected]>
2021-11-17 16:46:02 +01:00
kronicandkronic 08aff106db Convert concatenation string to interpolation for System.Private.Xml (#60057)
* use interpolation string

* fix XmlSerializationReader

* fix new line

* fix new line for XmlSerializationReaderILGen

* review feedback

* review feedback

* fix XmlTextWriter

* fix Compiler

* fix XmlSchemaExporter

* fix XmlSchemas

* fix XmlSerializationReader

* fix XmlSerializationWriter

* fix XmlSerializationWriter

* fix XmlSerializationWriterILGen

* fix QilValidationVisitor

* fix XmlSerializationReaderILGen

* fix XmlQueryOutput

Co-authored-by: kronic <[email protected]>
2021-11-09 10:39:57 +00:00
Steve Molloy d2415c4436 1388 xml serializer assembly load context awareness (#58932)
* Generate dynamic serialization assembly in the appropriate ALC, and don't keep any hard refs to types that could prevent unloading.
2021-11-05 14:27:50 -07:00
Steve Pfister 8c6aeea1d8 Bring up full library test CI runs on iOS / tvOS devices (#59503)
This change enables device runs on CI by building each test app on the helix instance it was deployed to. In past attempts, we looked at enhancing what takes place on the build machine via build tricks, compressing / cleaning up files early, etc and we could not overcome the need for excessively long timeouts and far more disk space.

The change also adopts the patterns established in the wasm test build, giving us the opportunity to support different scenario runs as well as workloads testing in the future.
2021-11-02 07:43:15 -04:00
Jeremy Barton df5b118c6f Seed the unified System.Security.Cryptography.dll
* All of System.Security.Cryptography.Primitives has been moved
* AsymmericKeyExchangeFormatter moved from S.S.C.Algorithms
* This just starts the process to keep the infrastructure pieces separate from code layout pieces.
2021-11-01 22:30:26 -07:00
Viktor Hofer 0964be0ae9 Update slngen and solution files (#60871)
Update slngen tooling to latest stable version and solution files since
a lot changed since the last time they were updated:
- NET7 (removal of older TFMs)
- Source Generators
2021-10-26 21:23:54 +02:00
kronicandkronic 854992ff94 Refactoring XmlReader{Async} (#59337)
* -

* -

* remove goto

* use nameof

* feedback

* -

* -

* review feedback

* review feedback

* fix scope

Co-authored-by: kronic <[email protected]>
2021-10-05 16:18:48 +02:00
Huo Yaoyuan 68226dade8 Cleanup XPath.StringToDouble (#55867)
* Cleanup StringToDouble.

* Remove members used by StringToDouble.
2021-10-05 11:58:22 +02:00
kronicandkronic 2d20036de8 Refactoring XmlReaderSettings (#59409)
* Refactoring

* review feedback

* review feedback

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-05 11:54:02 +02:00
kronicandkronic ca4ffa8775 Refactoring XmlWriterSettings (#59467)
* Refactoring XmlWriterSettings

* revert part

* review feedback

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-04 22:34:58 +02:00
kronicandkronic 03e90a540c Refactoring XslCompiledTransform (#59475)
* Refactoring XslCompiledTransform

* remove unused methods

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-01 17:56:06 +02:00
Eric Erhardt 9114f773aa XmlSerializer support for IsDynamicCodeSupported=false (#59386)
* XmlSerializer support for IsDynamicCodeSupported=false

Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly.

These changes were ported from
* https://github.com/dotnet/runtimelab/pull/593
* https://github.com/dotnet/runtimelab/pull/600

Fix #59167

* Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode.

* Port UAP code for CanDeserialize

* PR feedback

* Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false.
2021-09-22 20:10:40 -05:00
kronicandkronic 6c9921d2ad Bring XmlReader{Async} to one behavior (#51736)
* Replace XmlUntypedStringConverter to XmlUntypedConverter

* Add more test

* add more tests

* remove unssoprt test

* feedback review

Co-authored-by: kronic <[email protected]>
2021-09-20 11:21:09 +02:00
kronicandkronic 6579e5e3db Refactor XmlWriter{Async} (#58105)
* Refactor XmlWriter

* Refactor XmlWriterAsync

* -

* review feedback

Co-authored-by: kronic <[email protected]>
2021-09-17 12:25:11 +02:00
Andrii Kurdiumov 5588f94924 Remove usused rd.xml files (#59201)
Closes #51112
2021-09-16 16:53:54 -06:00
Viktor Hofer 36b6247cc7 Update solution files for correct ordering of elements (#58655)
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.

Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
2021-09-04 00:16:15 +02:00
kronicandkronic a67259dfe4 Refactor XmlQualifiedName (#57646)
* Refactor

* feedback

* feedback

* done

Co-authored-by: kronic <[email protected]>
2021-08-25 10:11:57 +02:00
Steve Molloy 078af6bd13 Use Type.GetTypeCode() instead of private extension (#57540)
* Use official Type.GetTypeCode() instead of the extension that was added to fill the gap in the earlier days of .Net Core.
* Bring reflection-based serializer in line with RefEmit behavior for 'object' serialization.
2021-08-17 11:11:38 -07:00
Steve Molloy 393819de33 41431 improve performance and usage of xml serializer namespaces (#56438)
* Allow easier creation of correctly sized dictionaries in scenarios with lots of known namespaces.

* Stop passing internal dictionaries around.

* Reduce enumerations, and immutable-ish improvements.

* PR feedback.

* Use ValueCollection directly instead of IEnumerable<> to avoid virtual calls.

* Update XmlSerializerNamespaces.cs
2021-08-12 14:24:44 -07:00
Viktor Hofer b12fa3b572 Strong name key id cleanup and pkg testing move (#57044)
* Move src/libraries/pkg/test to src/libraries/testPackages

* Remove default StrongNameKeyId Open properties
2021-08-09 19:20:11 +02:00
Steve Molloy 880e67dbb8 56014 xml writer.create perf regression (#56524)
* Use non-indented XmlWriter to avoid perf hit.
* Add test for issue #46974 which was also fixed by original PR that caused this regression.
2021-08-04 16:43:38 -07:00
Jeff Handley 895c99cc50 Remove old fwlink from Obsolete messages and make message improvements (#56690)
* Remove old fwlink from Obsolete messages and make message improvements

* Thorough review and update of Obsolete messages

* Cleanup

* Make messages about unsupported APIs more consistent

* Update RequiresUnreferencedCodeAttribute messages to be consistent between ref and src

* Cleanup

* Cleanup

* Use 'not supported' instead of 'no longer supported'

* Omit unnecessary error:false from Obsolete attributes. Fix message typo.

* Remove old comment

* PR feedback
2021-08-04 14:58:10 -04:00
Maxim Lipnin b3ab2eb4db Use ReflectionOnly as serialization mode in case dynamic code runtime feature is not supported (#56604) 2021-08-03 12:27:15 +03:00
Larry Ewing 30a1a3a421 Enable #59244 on wasm (#56675) 2021-07-31 22:17:37 -05:00
Larry Ewing ea4a3b6e20 Enable tests marked with https://github.com/dotnet/runtime/issues/51911 (#56673) 2021-07-31 20:39:22 -05:00
Mitchell Hwang dcacebb9ed [libraries][Android] Reenable tests failing from feature switches being improperly set (#56635)
Fixes #50576
Fixes #50881
Fixes #50916
Fixes #50917
Fixes #50918
Fixes #50919
Fixes #50927
Fixes #50928
Fixes #50944
Fixes #50945
Fixes #50946
Fixes #50947
Fixes #50948
Fixes #50999

When setting up functional tests for mobile, the feature switches being used for the tests were misplaced in a broader project, affecting the library tests and causing failures. After moving the feature switches to the scope of functional tests as done in #53253, these test suites no longer fail and can be re-enabled.
2021-07-30 17:17:27 -04:00
Viktor Hofer a6b9a63f35 Update libraries solution and NuGet.config files (#56430)
* Update slngen and invocation

* Update NuGet.config files

* Update solution files with slngen
2021-07-28 18:44:17 +02:00
Krzysztof WicherandBuyaa Namnan fdead97195 Fix: XmlWriterSettings.Encoding must be registered in static Encoding (#56164)
* Fix: XmlWriterSettings.Encoding must be registered in static Encoding

* Update src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs

Co-authored-by: Buyaa Namnan <[email protected]>

Co-authored-by: Buyaa Namnan <[email protected]>
2021-07-23 15:28:13 +02:00
Stephen ToubandChristopher Watford 6ca2a9456e Replace a few unnecessary uses of Convert.ToString (#55831)
* Replace a few unnecessary uses of Convert.ToString

* Update src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs

Co-authored-by: Christopher Watford <[email protected]>

Co-authored-by: Christopher Watford <[email protected]>
2021-07-20 09:29:20 -04:00
Tal AloniandStephen Toub e8be7f26cb Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not deterministic under .NET Core (#46499)
* Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not persistent under .NET Core

The implementation of String.GetHashCode() was persistent by default in .NET Framework. allowing to predictably name an XmlSerializers.{HashCode}.dll containing the pre-generated serializers.
In .NET Core / .NET 5, String.GetHashCode() is no longer persistent, so the value of ns.GetHashCode() will change during each run, preventing it from picking up the XmlSerializers dll correctly.

* Remove trailing whitespace

* Use truncated SHA512

* Fixed compilation

* Dispose SHA512 instance

* Fixed compilation

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>
2021-07-18 14:18:25 +00:00
c7dedccd96 Use more string interpolation (#55738)
* Use more string interpolation

I previously did a pass looking for opportunities.  Finding a few more, as well as fixing some misuse of existing methods.

* Update src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs

Co-authored-by: halgab <[email protected]>

* Apply suggestions from code review

Co-authored-by: Jan Kotas <[email protected]>

Co-authored-by: halgab <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
2021-07-16 06:38:51 -04:00
Steve Molloy 19b1b48625 XmlSerializer dont skip date time offset (#55101)
* Add DateTimeOffset as a primitive for XmlSerializer.

* Fix DefaultValueAttribute handling for DTO.

* Add tests for DateTimeAttribute and XmlSerializer.

* Missed a 'KnownType' spot.

* Update SGen tests to use current dotnet.exe from build.

* Unbreak runtimeconfig creation for testing.

* Debugging failure to resolve CoreCLR path.

* Test fixup.

* More test cleanup.

* Temporarily disable generator tests.

* Use InitObj instead of constructors for DateTimeOffset and TimeSpan.
2021-07-15 13:37:37 -07:00
Steve MolloyandStephen Toub ab219299db Use XmlWriter.Create instead of XmlTextWriter (#54949)
* Use a different XmlWriter which will check for invalid characters like null.

* Bring our XmlReader use into the 21st century as well.

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Don't need to specify options that are defaults on XmlWriter.

Co-authored-by: Stephen Toub <[email protected]>
2021-07-14 21:01:07 -04:00
Eric Erhardt 3150bfa506 Combine System.Private.Xml TrimmingTests projects (#55606)
For some reason we have 2 of them, and only need 1.
2021-07-14 03:14:39 +00:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Steve Molloy c8b3051399 Keep looking up derived chain for Property.Get if it doesn't exist. (#52509) 2021-07-13 00:27:06 -07:00
Steve Molloy 1749deb1cb Use scopes to resolve array naming issue. (#55451)
* Use scope to avoid using duplicate names for arrays in ILGen serializer.

* Remove comment.
2021-07-13 00:18:55 -07:00
Steve Molloy 88112bcd97 Handle nullable primitives before passing them to WritePrimitive which expects non-null values. (#54800) 2021-07-13 00:18:13 -07:00
Fan Yang a291fabdad Preserve necessary type and method (#54932)
* Preserve necessary type and method

* Change the way of getting the type

* Inline the constants

* Enable NonValidated_ValidAndInvalidValues_DictionaryMembersWork

* Enable TransformStrStrResolver3
2021-07-01 13:11:09 -04:00
xtqqczze 99f7bae2a2 Use Span<T>.Fill implementation for Array.Fill (#52590) 2021-06-29 21:05:04 -07:00
Tal Aloni 53e6b47441 Sgen: Update progress when importing types (#46415)
* Sgen: Update progress when importing types
* Null check
* Remove trailing whitespace
* Updated Strings.resx
* Sgen: Use string resource
2021-06-29 12:07:52 -07:00
Stephen Toub 39e8a6e0b0 Avoid allocating unused prefix/localName in XmlCharCheckingReader.ValidateQName (#54836) 2021-06-29 08:05:01 -04:00
Stephen Toub 91599fff26 Avoid per-XmlSchemaValidator PositionInfo allocation (#54356)
It can easily use a static singleton, as the instance is immutable and exists purely to provide a "I don't have line info" / (0,0) value if anyone queries for position.
2021-06-28 10:31:45 +02:00
Stephen Toub 61e250a189 Lazy-allocate ValidationState.CurPos (#54346)
The array is only used for a subset of validators; no point in paying for this array for every ValidationState instance even if it's not going to be used.
2021-06-17 19:58:30 -04:00