Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorSimon Cropp <simon.cropp@gmail.com>2020-01-31 20:18:23 +0300
committerGitHub <noreply@github.com>2020-01-31 20:18:23 +0300
commit933575cbd7c9e306439cefcd171785e9f7280c55 (patch)
treee4ecb029cee05a9a5cd25b25d718b2aade1bf153 /Test
parent0a2f2944638c13987d8a2318bc34bd64fdac55fd (diff)
Fix locally scoped constant array (#644)
* add failing test for LocallyScopedConstantArray * add LocallyScopedConstantArray target assembly * ElementType.Array should be treated the same as object in ReadLocalConstant * assert constant is null * Style fixes Co-authored-by: Jb Evain <jb@evain.net>
Diffstat (limited to 'Test')
-rw-r--r--Test/Mono.Cecil.Tests/ImageReadTests.cs14
-rw-r--r--Test/Resources/assemblies/LocallyScopedConstantArray.dllbin0 -> 4096 bytes
-rw-r--r--Test/Resources/assemblies/LocallyScopedConstantArray.pdbbin0 -> 700 bytes
3 files changed, 14 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/ImageReadTests.cs b/Test/Mono.Cecil.Tests/ImageReadTests.cs
index fa5562e..de7a2cc 100644
--- a/Test/Mono.Cecil.Tests/ImageReadTests.cs
+++ b/Test/Mono.Cecil.Tests/ImageReadTests.cs
@@ -208,6 +208,20 @@ namespace Mono.Cecil.Tests {
}
[Test]
+ public void LocallyScopedConstantArray ()
+ {
+ TestModule ("LocallyScopedConstantArray.dll", module => {
+ Assert.IsTrue (module.HasDebugHeader);
+ var method = module.Types
+ .Single (x => x.Name == "TestClass")
+ .Methods
+ .Single (x => x.Name == "TestMethod");
+ var debugInformation = method.DebugInformation;
+ Assert.IsNull (debugInformation.Scope.Constants.Single ().Value);
+ }, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider));
+ }
+
+ [Test]
public void ExternalPdbDeterministicAssembly ()
{
TestModule ("ExternalPdbDeterministic.dll", module => {
diff --git a/Test/Resources/assemblies/LocallyScopedConstantArray.dll b/Test/Resources/assemblies/LocallyScopedConstantArray.dll
new file mode 100644
index 0000000..ae5eaf4
--- /dev/null
+++ b/Test/Resources/assemblies/LocallyScopedConstantArray.dll
Binary files differ
diff --git a/Test/Resources/assemblies/LocallyScopedConstantArray.pdb b/Test/Resources/assemblies/LocallyScopedConstantArray.pdb
new file mode 100644
index 0000000..eea50b9
--- /dev/null
+++ b/Test/Resources/assemblies/LocallyScopedConstantArray.pdb
Binary files differ