Commit Graph
82 Commits
Author SHA1 Message Date
Kassem Sandarusi c935fac773 TypeDefinition.IsNested Property (dotnet/corefx#25963)
* Adding API TypeDefinition.IsNested. Closes dotnet/corefx#5377

* Adding related tests.

* fixing backward asserts.

* Switching to expression-bodied syntax.

* Adding doc comment. Switching to an assembly that actually has nested types.

* Fixing xml doc comment to align with msdn comment style.

* Update TypeDefinition.cs

Fixing bad grammar in comments.


Commit migrated from https://github.com/dotnet/corefx/commit/af18a5fe0d4aab25d8fcb6900fcffa8c99befb60
2018-02-04 13:26:16 -08:00
dajeffri b7f8280317 Add code coverage to C:\Users\dajeffri\dotnet\corefx\src\System.Reflection.Metadata\src\System\Reflection\Internal\Utilities\Hash.cs (dotnet/corefx#25238)
Add code coverage in reference to https://github.com/dotnet/corefx/issues/931

Commit migrated from https://github.com/dotnet/corefx/commit/ce888cf2ba4b14b4a2fd94c45ece75f6fca57385
2017-11-14 22:41:12 -05:00
Maryam Ariyan 59be828169 Added GetAssemblyName API for AssemblyDefinition and AssemblyReference (dotnet/corefx#23396)
* Added GetAssemblyName API to MetadataReader

Also added GetAssemblyName API to AssemblyReference and
AssemblyDefinition

* Adding more changes

Removing unnecessary usings in StringUtils and StringUtilsTests

Adding private methods in MetadataReader to set flags and hashAlgorithm

* adding helper class for AssemblyName

* Removing helper class and simplifying flag setup

Adding sample unit tests. will add more in next changeset

* Correcting two impl. mistakes in GetAssemblyName()

Correcting EnableJITcompileOptimizer flag casting

Correcting flag casting mistake on AssemblyNameFlag

* new GetAssemblyName tests + fix for netstandard1.1

* applying the code review comments

* correcting public key computation and improving flag computation

* code cleanup in the AssemblyDefinitionTests class

* using AssemblyFlags.ContentTypeMask instead of magic number 0x0E00

* refactored tests + renamed files to netstandard2.1

* setting methods to private in test class

* added test validating assemblyname with publickey

added another test validating assemblyname with culture

applied some code review comments

* code cleanup in AssemblyDefinitionTests

* renaming new netstandard2.0 files to versionless netstandard

* further cleaning up test classes


Commit migrated from https://github.com/dotnet/corefx/commit/146fd85208e0251a480318d419cdc178db350761
2017-08-31 16:52:31 -07:00
Hugh Bellamy 98b18432b7 Move AssertExtensions to Corefx.Private.TestUtilities (dotnet/corefx#21799)
* Move AssertExtensions to Corefx.Private.TestUtilities

* Update csprojs

* Fix Linq.Expressions uapaot build


Commit migrated from https://github.com/dotnet/corefx/commit/7e3b0db2892c56a431f8e99af9cd9381adec385a
2017-07-03 09:27:30 -07:00
Tobias Käs fb557495f7 Expose 'other' property and event accessors (dotnet/corefx#20255)
Expose 'other' property and event accessors.


Commit migrated from https://github.com/dotnet/corefx/commit/7c1fc766bbd4b20cb8eaaee9b05a93d5847a4263
2017-05-26 17:45:24 -07:00
Eric Mellino ea930d704e Fix System.Reflection.Metadata.Tests configuration.
Commit migrated from https://github.com/dotnet/corefx/commit/b4b7c48d9455c69c79e5d42857ab7fcebe35192c
2017-05-24 11:13:10 -07:00
Daniel Harvey 252cdc5e95 Bulk updates of tests for AssertExtensions (dotnet/corefx#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws.

Commit migrated from https://github.com/dotnet/corefx/commit/b43b4df2e0e2182154bb0f425cb4a61bc1269828
2017-04-18 09:52:02 -07:00
David Wrighton 8fffa57bf6 Stabilize custom OrderBy implementation (dotnet/corefx#16386)
- Changes for System.Private.Reflection.Metadata.Ecma335 broke stability of the OrderBy helper method
- Replace with a stable sort based on Array.Sort
- Also, minor tweak to the Environment.ProcessorCount property to be more concise

Fixes dotnet/corefx#16383 

Commit migrated from https://github.com/dotnet/corefx/commit/ddce4272adf7b79bdd9bfe6a3025305b577d5ff5
2017-02-22 15:23:48 -08:00
Tarek Mahmoud Sayed addda8630e Enable tests to compile with netstandard (dotnet/corefx#15956)
* Enable tests to compile with netstandard

Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile.
This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration

The changes include some fixes to compile teh sources too.

* Fix System.Collections.Immutable

* update src configuration

* remove netstandard17 defines

* Split netcoreapp code to its own files

* Remove 17 from the test class name


Commit migrated from https://github.com/dotnet/corefx/commit/15b4f51c2f3cb924840e5407bb8d5fe03bb282ea
2017-02-08 15:32:53 -08:00
Tarek Mahmoud Sayed 77cad86b1e Remove versioned configuration from test projects (dotnet/corefx#15879)
The changes onclude some other minor clean up in the test project files

Commit migrated from https://github.com/dotnet/corefx/commit/62212cca900081173fce70991c3a0b30393994a3
2017-02-06 13:52:11 -08:00
Tarek Mahmoud Sayed 7395af32ad Enable compiling the test projects against the configuration (dotnet/corefx#15743)
* Enable compiling the test projects against the configuration

The tests were compiled using the vertical configuration and not the best configuration picked from Configurations.props. this change is fix that and have all test projects configured accordingly.
This change ensuring netcoreapp runs successfully and we'll have another rounds later for other configurations like netfx, UAP...etc.

* Fix openssl test project on Linux distros

* Update the project configurations

* Update VS solution files

* update solution files


Commit migrated from https://github.com/dotnet/corefx/commit/e79912f8b77bc22abfd85e94b74c06e5d99e8381
2017-02-02 17:54:40 -08:00
Karthik Rajasekaran 4bbdadd88a Update project configuration and sln files (dotnet/corefx#15182)
* Add ValidateVSConfigurations

* Update project config and sln files.


Commit migrated from https://github.com/dotnet/corefx/commit/f6ab339f446e37505f93ef9f430801fa1dcc05b8
2017-01-17 14:31:23 -08:00
Jose Perez Rodriguez f01bc10825 Make Test projects compile against the Targeting pack. (1/3 of the work) (dotnet/corefx#14482)
Commit migrated from https://github.com/dotnet/corefx/commit/3403b4f6a11fd6ba53551c9d55de25fbb83bdc85
2016-12-14 11:19:06 -08:00
Eric Mellino da3c47cf33 Port first third of tests to build against the targeting pack / runtime (dotnet/corefx#14450)
* Change first third of test projects to compile against targeting pack.

* Add supplemental test data into an external project


Commit migrated from https://github.com/dotnet/corefx/commit/65780ef192c4f2214e65816e7ac90899be6a5557
2016-12-12 14:19:07 -08:00
John Chen (CLR) e6544e45f9 Reorganize DLL imports
Removed obsolete constants from Interop.Libraries.cs, and moved
files under src/Common/src/Interop/Windows to proper locations.


Commit migrated from https://github.com/dotnet/corefx/commit/aff71a53a57a39cbcaa7110c7dc1124f0700c13d
2016-11-10 16:04:46 -08:00
Karthik Rajasekaran 9255a2e649 Combine test dependencies into a common project.json.
Restore this common project.json upfront to improve sync time and avoid download contention from nuget.


Commit migrated from https://github.com/dotnet/corefx/commit/654f5548f946659c694d110a4bbce8aa33f1a7a1
2016-10-18 11:39:53 -07:00
Tomáš Matoušek 3f71e3ffc5 Implements PE checksum and signing validation (dotnet/corefx#12321)
Commit migrated from https://github.com/dotnet/corefx/commit/3c26e927e7eda7af64b8434014ce9f95bcad351d
2016-10-03 15:00:41 -07:00
Tomáš Matoušek ce8ebbad24 Implements PEReader.TryOpenAssociatedPortablePdb (dotnet/corefx#11031)
* Reuse MetadataReader instance in provider

* Remove unnecessary unsafe modifiers, add Embedded PDB tests

* Add IsPortableCodeView property

* Allow arbitrary PDB path padding in CodeView

* Implements PEReader.TryOpenAssociatedPortablePdb

* Fix comment

* Remove forgotten debug code

* Fix test


Commit migrated from https://github.com/dotnet/corefx/commit/0743d949b8d7a63f8e7f9ff3b5023b1a8fa8618a
2016-08-25 08:33:29 -07:00
Tomas Matousek a184494f91 Use TempFile
Commit migrated from https://github.com/dotnet/corefx/commit/8a18d94e6875c5f865196a62a05a9cf75b63eb94
2016-08-19 16:00:27 -07:00
Tomáš Matoušek c8bc733066 Implements support for reading loaded PE files (dotnet/corefx#10768)
Commit migrated from https://github.com/dotnet/corefx/commit/f2f264f9e71bc982431a1ed21417ac7d3a3fd847
2016-08-15 15:28:58 -07:00
Tomáš Matoušek 1e8838bc2c Clean up method body encoding APIs (dotnet/corefx#10386)
Commit migrated from https://github.com/dotnet/corefx/commit/9b04bcb14643f3de7e8b4e974dc671b362de2681
2016-07-29 17:09:59 -07:00
Karthik Rajasekaran 5c93b350d3 Add NugetTargetMoniker to test projects and update remaining project references to pkgproj
Commit migrated from https://github.com/dotnet/corefx/commit/13e03705ced065850dc65900fccfd930426e87d7
2016-06-29 12:30:05 -07:00
Tomáš Matoušek 5ede124582 Refactor metadata serializers (dotnet/corefx#9588)
* Refactor metadata serializers

* Split file

* Renames

* More API testing and polish


Commit migrated from https://github.com/dotnet/corefx/commit/d03addae82910375f093dc896ce53528ae2ca443
2016-06-24 15:50:58 -07:00
Karthik Rajasekaran d73f6518c3 Update CoreFX tests to compile against a minimum of netstandard1.3 and add supports clauses for tests
CoreFX tests will now compile against netstandard1.3 as references and will now deploy for the platforms listed in their respective supports clause, provided the appropriate TestTFM is passed in.  The supports are fully listed inside runtime.json in the new TestSuite metapackage in buildtools. The tests will default to netcoreapp1.0 as their TestTFM.

CoreFx test projects now utilise a test csproj to pkgproj reference which determine the appropriate compile time and runtime assets needed.

Dependent on https://github.com/dotnet/buildtools/pull/770


Commit migrated from https://github.com/dotnet/corefx/commit/b4841454de7ddcd75e92e2bb24ebb238a82df43f
2016-06-15 11:23:11 -07:00
Tomas Matousek 5a14de2c13 Implement missing data access members on MetadataReader, PEMemoryBlock
Commit migrated from https://github.com/dotnet/corefx/commit/13bb83a347c7f5ee29bd9f30d37e75418f4d2da4
2016-06-09 18:12:01 -07:00
Tomas Matousek 84c38b9fa6 Removes size validation in TryGetDirectoryOffset, adds tests
Commit migrated from https://github.com/dotnet/corefx/commit/f4a777e7163757e5952462ad6e4026ec05e16e7f
2016-06-08 14:36:02 -07:00
Tomas Matousek 3665bd9b92 CodedIndex cleanup and tests
Commit migrated from https://github.com/dotnet/corefx/commit/0eab3ef1c852798ba4877251d432c4abfcbc27d8
2016-06-07 15:08:41 -07:00
Stephen Toub 482d3a7beb Remove unnecessary assembly-level CLSCompliant attributes
Commit migrated from https://github.com/dotnet/corefx/commit/bdbc8797f55e8a50f4fec4b5b0349666ddfa57e6
2016-06-01 20:03:23 -04:00
Tomas Matousek 68d3758724 DebugDirectoryBuilder and ResourceSectionBuilder
Commit migrated from https://github.com/dotnet/corefx/commit/eb84ead441e4ba5e6d7be74d872a20b11cc9e3c1
2016-05-16 13:53:02 -07:00
Tomas Matousek 337b95c556 Heaps and BlobContentId
Commit migrated from https://github.com/dotnet/corefx/commit/a9442a6fe0d0d616ce372018c86ff435cf5337c2
2016-05-13 15:38:57 -07:00
Tomas Matousek 786b3617fb Test writing and reading large tables, refactor WriteReference API
Commit migrated from https://github.com/dotnet/corefx/commit/6cb5eba928e6a2ae15cb4ae2729364a651b6932e
2016-05-09 11:48:04 -07:00
Tomas Matousek 9b7c4d57ce PEBuilder refactoring, signing
Commit migrated from https://github.com/dotnet/corefx/commit/63df90827918037c245c42ba7e50e2c06814a277
2016-05-05 11:34:10 -07:00
Tomas Matousek 63e76b81d7 Organize test source files
Commit migrated from https://github.com/dotnet/corefx/commit/793bd156e1e81f333ee6feb63862e8b101f075d3
2016-04-29 15:03:53 -07:00
Tomas Matousek 243e5ba426 Encoders: Argument validation and API cleanup
Commit migrated from https://github.com/dotnet/corefx/commit/525a8c4dcae66a67e60f7785b6e03cef84b0ceea
2016-04-29 15:03:47 -07:00
Tomas Matousek 6747be83a1 Add tests
Commit migrated from https://github.com/dotnet/corefx/commit/c5814310ee77d120765b6149d317dc9ffe198557
2016-04-27 15:12:10 -07:00
Tomas Matousek 38ab29d69c Add more tests and comments
Commit migrated from https://github.com/dotnet/corefx/commit/e4cc653667898d444aed85b76865635adcc6828b
2016-04-25 13:00:39 -07:00
Tomas Matousek 019ffc6a0f Implements MetadataReaderProvider
Commit migrated from https://github.com/dotnet/corefx/commit/8d135a6ae8e7121bebd37be836fe687d9b5ffcb9
2016-04-24 12:27:18 -07:00
Eric Mellino 722505f95f Revert PR 7188.
The newest version of MSBuild has fixed the embedded resource culture
issue that was preventing us from using periods in embedded resource
names. This reverts the changes to the System.Reflection.Metadata tests
which removed the periods from some embedded resource file names in the
test assembly.


Commit migrated from https://github.com/dotnet/corefx/commit/933a0cd2faaa26b479b75ae5e54a5b57ed9c15f6
2016-03-28 13:20:08 -07:00
Eric Mellino f00f7619cc Remove periods from embedded resource names in Metadata tests
Commit migrated from https://github.com/dotnet/corefx/commit/d15fca0f9bd9d563869005c3927618b375918f81
2016-03-23 16:00:41 -07:00
Nick Guerrera dfc1c8f5dd Add test coverage for CustomAttributeDecoder
Commit migrated from https://github.com/dotnet/corefx/commit/6ffebba142ec4f9b500a646da8d5754eb4576f07
2016-02-29 17:23:01 -08:00
Jose Perez Rodriguez d4b98f723c Using Full Framework roslyn compilers for Windows builds.
Commit migrated from https://github.com/dotnet/corefx/commit/3b87fdb8a6de3d40560a2db67e52cfffb59aec59
2016-02-19 09:29:21 -08:00
Nick Guerrera 1a9b15e48d Split S.R.Metadata v1.2 and v1.3
We have to lock down a v1.2 S.R.Metadata now, but there are features
(metadata writer, signature decoder) that we're pushing out to a v1.3.

Set up the build to produce both packages and configure the project
such that the default configurations are v1.2 and the *_Future
configurations are v1.3.

Currently, v1.2 just internalizes the features of v1.3, but we can
consider stripping them out entirely.


Commit migrated from https://github.com/dotnet/corefx/commit/7152971f4a940aa897c29fcdbed8934a692a928e
2016-02-05 13:22:17 -08:00
Tomáš Matoušek 468dd309cc Merge pull request dotnet/corefx#5719 from tmat/PdbStreamValidation
Disallow nil MethodDef token as an entry-point in Portable PDB

Commit migrated from https://github.com/dotnet/corefx/commit/8ed29621f59b74d881421c9df2d4d9c13916653c
2016-01-31 11:25:57 -08:00
Tomas Matousek ff193c272e Disallow nil MethodDef token as an entry-point in Portable PDB
Commit migrated from https://github.com/dotnet/corefx/commit/f2124b43f8f77c5fcc2621f03c48d2ff25ed41d6
2016-01-26 18:51:00 -08:00
Tomas Matousek 75c9b24fde Misc small API additions
Commit migrated from https://github.com/dotnet/corefx/commit/538463a0247a4b77de87283e2d8d196d6f92369b
2016-01-22 18:24:34 -08:00
Tomas Matousek c64e8e45e2 Updates System.Reflection.Metadata.sln to VS2015 and the project language to C# 6
Commit migrated from https://github.com/dotnet/corefx/commit/964a3af7cceb68a440d1762d4529ef9d11567596
2016-01-11 11:35:08 -08:00
Nick Guerrera ff862c42ef Add signature decoder to System.Reflection.Metadata
Up to now, System.Reflection.Metadata provides low-level access to
ECMA-335 CLI metadata, but only provides signatures as blobs that must
be parsed with direct knowledge of the format as described in the
section II.23.2 of the CLI specification. There is a BlobReader for
reading various elements out of blobs, but it is up to the caller to
read the right things at the right positions.

This was by-design as the library is designed to sit at the lowest level
behind the scenes of higher level API such as Reflection proper, Roslyn,
or CCI.

The challenge with signatures is that they are variable-length and
encode tree structures, and each higher level model that could sit on
top of System.Reflection.Metadata will have different representations
for the trees. We do not want to introduce an API to build a fully
formed tree that then has to be traversed and rewritten to match the
actual use case.

This API is therefore a middle ground between:

 1. Here are the bytes and some helpers. Read the spec to decode.
    (Status quo.)

 2. Yet another high-level metadata API.
    (Out of scope for this layer.)

It works as follows:

 1. The caller chooses an arbitrary representation, TType, for type
    symbols and implements ISignatureTypeProvider<TType> .

 2. Signatures are parsed by recursive descent and the provider is
    called to create new type nodes:

     * Give me the TType that represents this primitive
     * Give me the TType that represents this TypeDefinition
     * Give me the TType that represents an array of this other TType
     * etc.


Commit migrated from https://github.com/dotnet/corefx/commit/0bc15ebcff855acf36d0970d0ed95d770adf2882
2016-01-07 10:49:12 -08:00
Tomas Matousek 0dc416c285 Implements PE Debug Directory reader.
Commit migrated from https://github.com/dotnet/corefx/commit/bd40b7bc4674a5f536f94f0f80b6c6304650ac87
2015-12-16 03:32:05 +01:00
Matt Ellis fbeb9a7b3a Don't set debug properties in projects
Setting <DebugSymbols> and <DebugType> like this breaks building cross
platform because Roslyn can't emit PDBs. Our top level properties files
define these settings to false when building cross platform and there is
no reason these projects need to be doing their own thing.


Commit migrated from https://github.com/dotnet/corefx/commit/f430cedb84b28ed40b688f8fe5cd6ba5769db9e0
2015-10-27 17:35:45 -07:00
Tomas Matousek 8de14b63f9 Add portable PDB reader to System.Reflection.Metadata
Commit migrated from https://github.com/dotnet/corefx/commit/9ff902c77ad34959c154b1289dac19a54ba2cffb
2015-09-30 12:09:41 -07:00