From ae97eec9ba8206e3895e76dba1616f742e0631b2 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Tue, 23 Oct 2018 15:35:36 -0400 Subject: [PATCH] ExecInDefAppDom add InjectCode test --- .../src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs | 2 ++ .../Interop/ExecInDefAppDom/ExecInDefAppDom.csproj | 4 +++ .../ExecInDefAppDom/InjectedCode/InjectedCode.cs | 9 ++++++ .../InjectedCode/InjectedCode.csproj | 35 ++++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs create mode 100644 tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj diff --git a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index fe094fb..23bdbf5 100644 --- a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -62,6 +62,7 @@ public class Program { int result = 100; String myPath = System.Reflection.Assembly.GetExecutingAssembly().Location; + String injectedPath = System.IO.Path.GetDirectoryName(myPath) + "/InjectedCode.dll"; String bogusPath = myPath + "random"; const int S_OK = unchecked((int)0); @@ -83,6 +84,7 @@ public class Program result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "0", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "200", S_OK, 200); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "None", COR_E_FORMAT, 0); + result += TestExecuteInAppDomain(injectedPath, "InjectedCode", "ParseArgument", "300", S_OK, 300); return result; } diff --git a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj index edbf53d..5f17049 100644 --- a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj +++ b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj @@ -29,6 +29,10 @@ + + {FD322A4C-EBCD-4322-90B7-35333EF2FE92} + InjectedCode + diff --git a/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs new file mode 100644 index 0000000..3870985 --- /dev/null +++ b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs @@ -0,0 +1,9 @@ +// 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; + +public class InjectedCode +{ + static int ParseArgument(String argument) { return int.Parse(argument);} +} \ No newline at end of file diff --git a/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj new file mode 100644 index 0000000..22e9498 --- /dev/null +++ b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj @@ -0,0 +1,35 @@ + + + + + Debug + AnyCPU + InjectedCode + 2.0 + {FD322A4C-EBCD-4322-90B7-35333EF2FE92} + Library + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + ..\..\ + BuildOnly + $(DefineConstants);$([System.String]::Copy('$(BuildArch)').ToUpper()) + true + false + + + + + + + + + False + + + + + + + + + + -- 2.7.4