diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-03-13 17:00:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 17:00:50 -0700 |
commit | e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c (patch) | |
tree | 63e34683d8580fe2032b7888440c2c449d33c9ba /tests | |
parent | 1f48b29ed0c9da48ca2d30df2a308fb620d8c22f (diff) | |
download | coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.tar.gz coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.tar.bz2 coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.zip |
Revert "Revert "Fix handling of incorrect assemblies on Unix (#16747)" (#16790)" (#16917)
This reverts commit 47bef69b68a35eafa069d08187727684a5f47901.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/Loader/regressions/GitHub_15544/main.cs | 37 | ||||
-rw-r--r-- | tests/src/Loader/regressions/GitHub_15544/main.csproj | 31 |
2 files changed, 68 insertions, 0 deletions
diff --git a/tests/src/Loader/regressions/GitHub_15544/main.cs b/tests/src/Loader/regressions/GitHub_15544/main.cs new file mode 100644 index 0000000000..25e7d79e41 --- /dev/null +++ b/tests/src/Loader/regressions/GitHub_15544/main.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.IO; +using System.Reflection; + +public class CMain{ + public static int Main(String[] args) { + string tempFileName = Path.GetTempFileName(); + + bool isThrown = false; + + try + { + AssemblyName.GetAssemblyName(tempFileName); + } + catch (BadImageFormatException) + { + isThrown = true; + } + + File.Delete(tempFileName); + + if (isThrown) { + Console.WriteLine("PASS"); + + return 100; + } else { + Console.WriteLine("FAIL"); + + return 101; + } + } +} diff --git a/tests/src/Loader/regressions/GitHub_15544/main.csproj b/tests/src/Loader/regressions/GitHub_15544/main.csproj new file mode 100644 index 0000000000..e46a44ce52 --- /dev/null +++ b/tests/src/Loader/regressions/GitHub_15544/main.csproj @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{AC75380E-F196-4F32-9BCF-F0589AF864E6}</ProjectGuid> + <OutputType>Exe</OutputType> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <!-- Default configurations to help VS understand the configurations --> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + </PropertyGroup> + <ItemGroup> + <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> + <Visible>False</Visible> + </CodeAnalysisDependentAssemblyPaths> + </ItemGroup> + <ItemGroup> + <Compile Include="main.cs" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> +</Project> |