diff options
author | tijoytom <tijoytk@microsoft.com> | 2016-03-07 15:34:38 -0800 |
---|---|---|
committer | tijoytom <tijoytk@microsoft.com> | 2016-03-07 15:34:38 -0800 |
commit | aad12ef45b670933a504edad0a5610eeb1c97da3 (patch) | |
tree | 8712b5a4ed47f63dbd904f69adda6a6a55833edc | |
parent | 282b9fcea00af8cf47554fb3f44251659305a76e (diff) | |
download | coreclr-aad12ef45b670933a504edad0a5610eeb1c97da3.tar.gz coreclr-aad12ef45b670933a504edad0a5610eeb1c97da3.tar.bz2 coreclr-aad12ef45b670933a504edad0a5610eeb1c97da3.zip |
Improve interop test coverage
Updating license headers
Delete duplicate test
34 files changed, 88 insertions, 718 deletions
diff --git a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp index 78086f953a..a4600d08a5 100644 --- a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp +++ b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp @@ -1,3 +1,6 @@ +// 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. #include <xplatform.h> diff --git a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest.cs b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest.cs index a32fee574a..2dd1e20647 100644 --- a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest.cs +++ b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest.cs @@ -1,6 +1,7 @@ // 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.Runtime.InteropServices; diff --git a/tests/src/Interop/BestFitMapping/BestFitMapping.cs b/tests/src/Interop/BestFitMapping/BestFitMapping.cs Binary files differindex f751c0b3ba..643ddc9d21 100755 --- a/tests/src/Interop/BestFitMapping/BestFitMapping.cs +++ b/tests/src/Interop/BestFitMapping/BestFitMapping.cs diff --git a/tests/src/Interop/BestFitMapping/BestFitMapping.csproj b/tests/src/Interop/BestFitMapping/BestFitMapping.csproj index f7c74f5d63..d0b0a4ab95 100755 --- a/tests/src/Interop/BestFitMapping/BestFitMapping.csproj +++ b/tests/src/Interop/BestFitMapping/BestFitMapping.csproj @@ -4,7 +4,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <AssemblyName>BestFitMappingTest</AssemblyName> + <AssemblyName>BestFitMapping</AssemblyName> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{F1E66554-8C8E-4141-85CF-D0CD6A0CD0B0}</ProjectGuid> <OutputType>exe</OutputType> diff --git a/tests/src/Interop/BestFitMapping/BestFitMappingNative.cpp b/tests/src/Interop/BestFitMapping/BestFitMappingNative.cpp index 3c954409ed..5afe6602b6 100755 --- a/tests/src/Interop/BestFitMapping/BestFitMappingNative.cpp +++ b/tests/src/Interop/BestFitMapping/BestFitMappingNative.cpp @@ -1,3 +1,6 @@ +// 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. #include <stdio.h> #include <stdlib.h> @@ -13,13 +16,13 @@ static int ReportFailure(const char* s) return (++fails); } -extern "C" int GetResult() +extern "C" DLL_EXPORT int GetResult() { return fails; } //This method is used on Windows Only -extern "C" char _cdecl GetByteForWideChar() +extern "C" DLL_EXPORT char _cdecl GetByteForWideChar() { #ifdef WINDOWS char * p = new char[3]; @@ -74,7 +77,7 @@ bool CheckInput(LPSTR str) } //C Call,In attribute,LPstr -extern "C" LPSTR _cdecl CLPStr_In(LPSTR pStr) +extern "C" DLL_EXPORT LPSTR DLL_EXPORT _cdecl CLPStr_In(LPSTR pStr) { //Check the Input if(!CheckInput(pStr)) @@ -89,7 +92,7 @@ extern "C" LPSTR _cdecl CLPStr_In(LPSTR pStr) return pBack; } -extern "C" LPSTR _cdecl CLPStr_Out(LPSTR pStr) +extern "C" DLL_EXPORT LPSTR DLL_EXPORT _cdecl CLPStr_Out(LPSTR pStr) { const char* pTemp ="AAAA"; int len = strlen(pTemp)+ 1 ; //+1, Include the NULL Character. @@ -100,7 +103,7 @@ extern "C" LPSTR _cdecl CLPStr_Out(LPSTR pStr) return pBack; } -extern "C" LPSTR _cdecl CLPStr_InOut(LPSTR pStr) +extern "C" DLL_EXPORT DLL_EXPORT LPSTR _cdecl CLPStr_InOut(LPSTR pStr) { //Check the Input if(!CheckInput(pStr)) @@ -116,7 +119,7 @@ extern "C" LPSTR _cdecl CLPStr_InOut(LPSTR pStr) return pBack; } -extern "C" LPSTR _cdecl CLPStr_InByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT DLL_EXPORT LPSTR _cdecl CLPStr_InByRef(LPSTR* ppStr) { //Check the Input if(!CheckInput(*ppStr)) @@ -132,7 +135,7 @@ extern "C" LPSTR _cdecl CLPStr_InByRef(LPSTR* ppStr) return pBack; } -extern "C" LPSTR _cdecl CLPStr_OutByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT LPSTR _cdecl CLPStr_OutByRef(LPSTR* ppStr) { const char* pTemp="AAAA"; int len = strlen(pTemp)+ 1 ; //+1, Include the NULL Character. @@ -144,7 +147,7 @@ extern "C" LPSTR _cdecl CLPStr_OutByRef(LPSTR* ppStr) return pBack; } -extern "C" LPSTR _cdecl CLPStr_InOutByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT LPSTR _cdecl CLPStr_InOutByRef(LPSTR* ppStr) { //Check the Input if(!CheckInput(*ppStr)) @@ -161,14 +164,14 @@ extern "C" LPSTR _cdecl CLPStr_InOutByRef(LPSTR* ppStr) typedef LPSTR (_cdecl* delegate_cdecl)(LPSTR* ppstr); -extern "C" delegate_cdecl CLPStr_DelegatePInvoke() +extern "C" DLL_EXPORT delegate_cdecl CLPStr_DelegatePInvoke() { return CLPStr_InOutByRef; } //stdcall -extern "C" LPSTR __stdcall SLPStr_In(LPSTR pStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_In(LPSTR pStr) { //Check the Input if(!CheckInput(pStr)) @@ -183,7 +186,7 @@ extern "C" LPSTR __stdcall SLPStr_In(LPSTR pStr) return pBack; } -extern "C" LPSTR __stdcall SLPStr_Out(LPSTR pStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_Out(LPSTR pStr) { const char* pTemp="AAAA"; int len = strlen(pTemp)+ 1 ; //+1, Include the NULL Character. @@ -194,7 +197,7 @@ extern "C" LPSTR __stdcall SLPStr_Out(LPSTR pStr) return pBack; } -extern "C" LPSTR __stdcall SLPStr_InOut(LPSTR pStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_InOut(LPSTR pStr) { //Check the Input if(!CheckInput(pStr)) @@ -209,7 +212,7 @@ extern "C" LPSTR __stdcall SLPStr_InOut(LPSTR pStr) return pBack; } -extern "C" LPSTR __stdcall SLPStr_InByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_InByRef(LPSTR* ppStr) { //Check the Input if(!CheckInput(*ppStr)) @@ -223,7 +226,7 @@ extern "C" LPSTR __stdcall SLPStr_InByRef(LPSTR* ppStr) return pBack; } -extern "C" LPSTR __stdcall SLPStr_OutByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_OutByRef(LPSTR* ppStr) { const char* pTemp="AAAA"; int len = strlen(pTemp)+ 1 ; //+1, Include the NULL Character. @@ -236,7 +239,7 @@ extern "C" LPSTR __stdcall SLPStr_OutByRef(LPSTR* ppStr) return pBack; } -extern "C" LPSTR __stdcall SLPStr_InOutByRef(LPSTR* ppStr) +extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_InOutByRef(LPSTR* ppStr) { //Check the Input if(!CheckInput(*ppStr)) @@ -252,7 +255,7 @@ extern "C" LPSTR __stdcall SLPStr_InOutByRef(LPSTR* ppStr) } typedef LPSTR (__stdcall *delegate_stdcall)(LPSTR* ppstr); -extern "C" delegate_stdcall SLPStr_DelegatePInvoke() +extern "C" DLL_EXPORT delegate_stdcall SLPStr_DelegatePInvoke() { return SLPStr_InOutByRef; } @@ -260,7 +263,7 @@ extern "C" delegate_stdcall SLPStr_DelegatePInvoke() ///Cdecl, Reverse PInvoke typedef LPSTR (_cdecl *CCallBackIn)(LPSTR pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_In(CCallBackIn callback) +extern "C" DLL_EXPORT DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_In(CCallBackIn callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -275,7 +278,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_In(CCallBackIn callback) } typedef LPSTR (_cdecl *CCallBackOut)(LPSTR pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_Out(CCallBackOut callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_Out(CCallBackOut callback) { int len = 10; LPSTR pStr = (LPSTR)CoTaskMemAlloc(len); @@ -293,7 +296,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_Out(CCallBackOut callback) } typedef LPSTR (_cdecl *CCallBackInOut)(LPSTR pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_InOut(CCallBackInOut callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_InOut(CCallBackInOut callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -312,7 +315,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_InOut(CCallBackInOut callback) } typedef LPSTR (_cdecl *CallBackInByRef)(LPSTR* pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_InByRef(CallBackInByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_InByRef(CallBackInByRef callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -327,7 +330,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_InByRef(CallBackInByRef callback) } typedef LPSTR (_cdecl *CCallBackOutByRef)(LPSTR* pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_OutByRef(CCallBackOutByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_OutByRef(CCallBackOutByRef callback) { int len = 10; LPSTR pStr = (LPSTR)CoTaskMemAlloc(len); @@ -344,7 +347,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_OutByRef(CCallBackOutByRef callback) } typedef LPSTR (_cdecl *CCallBackInOutByRef)(LPSTR* pstr); -extern "C" void _cdecl DoCCallBack_LPSTR_InOutByRef(CCallBackInOutByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_InOutByRef(CCallBackInOutByRef callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -364,7 +367,7 @@ extern "C" void _cdecl DoCCallBack_LPSTR_InOutByRef(CCallBackInOutByRef callback ///STDCALL Reverse PInvoke typedef LPSTR (__stdcall *SCallBackIn)(LPSTR pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_In(SCallBackIn callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_In(SCallBackIn callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -379,7 +382,7 @@ extern "C" void _cdecl DoSCallBack_LPSTR_In(SCallBackIn callback) } typedef LPSTR (__stdcall *SCallBackOut)(LPSTR pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_Out(SCallBackOut callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_Out(SCallBackOut callback) { int len = 10; @@ -397,7 +400,7 @@ extern "C" void _cdecl DoSCallBack_LPSTR_Out(SCallBackOut callback) } typedef LPSTR (__stdcall *SCallBackInOut)(LPSTR pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_InOut(SCallBackInOut callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_InOut(SCallBackInOut callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -416,7 +419,7 @@ extern "C" void _cdecl DoSCallBack_LPSTR_InOut(SCallBackInOut callback) } typedef LPSTR (__stdcall *SCallBackInByRef)(LPSTR* pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_InByRef(SCallBackInByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_InByRef(SCallBackInByRef callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; @@ -431,7 +434,7 @@ extern "C" void _cdecl DoSCallBack_LPSTR_InByRef(SCallBackInByRef callback) } typedef LPSTR (__stdcall *SCallBackOutByRef)(LPSTR* pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_OutByRef(SCallBackOutByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_OutByRef(SCallBackOutByRef callback) { int len = 10; LPSTR pStr = (LPSTR)CoTaskMemAlloc(len); @@ -448,7 +451,7 @@ extern "C" void _cdecl DoSCallBack_LPSTR_OutByRef(SCallBackOutByRef callback) } typedef LPSTR (__stdcall *SCallBackInOutByRef)(LPSTR* pstr); -extern "C" void _cdecl DoSCallBack_LPSTR_InOutByRef(SCallBackInOutByRef callback) +extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_InOutByRef(SCallBackInOutByRef callback) { const char* pTemp = "AAAA"; int len = strlen(pTemp)+1; diff --git a/tests/src/Interop/CMakeLists.txt b/tests/src/Interop/CMakeLists.txt index a2f0ccb366..b9e9c1d835 100644 --- a/tests/src/Interop/CMakeLists.txt +++ b/tests/src/Interop/CMakeLists.txt @@ -5,7 +5,6 @@ add_subdirectory(PrimitiveMarshalling/Bool) add_subdirectory(PrimitiveMarshalling/UIntPtr) add_subdirectory(ArrayMarshalling/BoolArray) add_subdirectory(ArrayMarshalling/ByValArray) -add_subdirectory(ReversePInvoke/Marshalling) add_subdirectory(BestFitMapping) add_subdirectory(RefInt) add_subdirectory(RefCharArray) diff --git a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp index 7af339e8d4..ba8c10bd77 100644 --- a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp +++ b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp @@ -1,3 +1,6 @@ +// 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. #include <xplatform.h> #include <stdio.h> diff --git a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolTest.cs b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolTest.cs index 93c742e829..72b80c0c2b 100644 --- a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolTest.cs +++ b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolTest.cs @@ -1,6 +1,7 @@ // 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.Runtime.InteropServices; using System; using System.Reflection; diff --git a/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs b/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs index eac3cf9a0c..b46015fbd4 100644 --- a/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs +++ b/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs @@ -1,6 +1,7 @@ // 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.Runtime.InteropServices; using System.Reflection; diff --git a/tests/src/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs b/tests/src/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs index e1973a586c..431ba14d6e 100644 --- a/tests/src/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs +++ b/tests/src/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs @@ -1,6 +1,7 @@ // 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.Runtime.InteropServices; using System; using System.Reflection; diff --git a/tests/src/Interop/PrimitiveMarshalling/UIntPtr/UIntPtrNative.cpp b/tests/src/Interop/PrimitiveMarshalling/UIntPtr/UIntPtrNative.cpp index e105f6cc70..d280d955b8 100644 --- a/tests/src/Interop/PrimitiveMarshalling/UIntPtr/UIntPtrNative.cpp +++ b/tests/src/Interop/PrimitiveMarshalling/UIntPtr/UIntPtrNative.cpp @@ -1,3 +1,6 @@ +// 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. #include <xplatform.h> #include <stdio.h> diff --git a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp index 7006952918..1cc4190b1a 100755 --- a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp +++ b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp @@ -1,9 +1,13 @@ +// 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. + #include <xplatform.h> #include <stdio.h> #include <stdlib.h> int LEN = 10; -extern "C" BOOL _cdecl MarshalRefCharArray_Cdecl(char ** pstr) +extern "C" BOOL DLL_EXPORT _cdecl MarshalRefCharArray_Cdecl(char ** pstr) { //Check the Input for(int i = 0; i < LEN; i++) @@ -22,7 +26,7 @@ extern "C" BOOL _cdecl MarshalRefCharArray_Cdecl(char ** pstr) } return TRUE; } -extern "C" BOOL __stdcall MarshalRefCharArray_Stdcall(char ** pstr) +extern "C" BOOL DLL_EXPORT __stdcall MarshalRefCharArray_Stdcall(char ** pstr) { //Check the Input for(int i = 0;i < LEN;i++) @@ -43,7 +47,7 @@ extern "C" BOOL __stdcall MarshalRefCharArray_Stdcall(char ** pstr) } typedef BOOL(_cdecl *CdeclCallBack)(char ** pstr); -extern "C" BOOL DoCallBack_MarshalRefCharArray_Cdecl(CdeclCallBack caller) +extern "C" BOOL DLL_EXPORT DoCallBack_MarshalRefCharArray_Cdecl(CdeclCallBack caller) { char * str = (char*)CoTaskMemAlloc(LEN); for(int i = 0;i<LEN;i++) @@ -64,7 +68,7 @@ extern "C" BOOL DoCallBack_MarshalRefCharArray_Cdecl(CdeclCallBack caller) } typedef BOOL(__stdcall *StdCallBack)(char ** pstr); -extern "C" BOOL DoCallBack_MarshalRefCharArray_Stdcall(StdCallBack caller) +extern "C" BOOL DLL_EXPORT DoCallBack_MarshalRefCharArray_Stdcall(StdCallBack caller) { char * str = (char*)CoTaskMemAlloc(LEN); for(int i = 0;i<LEN;i++) @@ -86,13 +90,13 @@ extern "C" BOOL DoCallBack_MarshalRefCharArray_Stdcall(StdCallBack caller) } typedef BOOL (_cdecl * DelegatePInvoke_Cdecl)(char **pstr); -extern "C" DelegatePInvoke_Cdecl DelegatePinvoke_Cdecl() +extern "C" DLL_EXPORT DelegatePInvoke_Cdecl DelegatePinvoke_Cdecl() { return MarshalRefCharArray_Cdecl; } typedef BOOL (__stdcall * DelegatePInvoke_Stdcall)(char **pstr); -extern "C" DelegatePInvoke_Stdcall DelegatePinvoke_Stdcall() +extern "C" DLL_EXPORT DelegatePInvoke_Stdcall DelegatePinvoke_Stdcall() { return MarshalRefCharArray_Stdcall; }
\ No newline at end of file diff --git a/tests/src/Interop/RefCharArray/RefCharArrayManaged.cs b/tests/src/Interop/RefCharArray/RefCharArrayTest.cs Binary files differindex 8c359e5d11..dc0ad0a8d9 100755..100644 --- a/tests/src/Interop/RefCharArray/RefCharArrayManaged.cs +++ b/tests/src/Interop/RefCharArray/RefCharArrayTest.cs diff --git a/tests/src/Interop/RefCharArray/RefCharArrayManaged.csproj b/tests/src/Interop/RefCharArray/RefCharArrayTest.csproj index 03e06b2771..03e06b2771 100755..100644 --- a/tests/src/Interop/RefCharArray/RefCharArrayManaged.csproj +++ b/tests/src/Interop/RefCharArray/RefCharArrayTest.csproj diff --git a/tests/src/Interop/RefInt/RefIntNative.cpp b/tests/src/Interop/RefInt/RefIntNative.cpp index 510b0b2675..8154cca6ed 100755 --- a/tests/src/Interop/RefInt/RefIntNative.cpp +++ b/tests/src/Interop/RefInt/RefIntNative.cpp @@ -1,3 +1,7 @@ +// 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. + #include <xplatform.h> #include <stdio.h> #include <stdlib.h> @@ -6,7 +10,7 @@ const int iManaged = 10; const int iNative = 11; -extern "C" BOOL _cdecl MarshalRefInt_Cdcel(int * pint) +extern "C" BOOL DLL_EXPORT _cdecl MarshalRefInt_Cdcel(int * pint) { //Check the Input if(iManaged != *pint) @@ -18,7 +22,7 @@ extern "C" BOOL _cdecl MarshalRefInt_Cdcel(int * pint) return TRUE; } -extern "C" BOOL __stdcall MarshalRefInt_Stdcall(int * pint) +extern "C" BOOL DLL_EXPORT __stdcall MarshalRefInt_Stdcall(int * pint) { //Check the Input if(iManaged != *pint) @@ -31,7 +35,7 @@ extern "C" BOOL __stdcall MarshalRefInt_Stdcall(int * pint) } typedef BOOL (_cdecl *Cdeclcaller)(int* pint); -extern "C" BOOL __stdcall DoCallBack_MarshalRefInt_Cdecl(Cdeclcaller caller) +extern "C" BOOL DLL_EXPORT __stdcall DoCallBack_MarshalRefInt_Cdecl(Cdeclcaller caller) { //Check the Input int itemp = iNative; @@ -49,7 +53,7 @@ extern "C" BOOL __stdcall DoCallBack_MarshalRefInt_Cdecl(Cdeclcaller caller) } typedef BOOL (__stdcall *Stdcallcaller)(int* pint); -extern "C" BOOL __stdcall DoCallBack_MarshalRefInt_Stdcall(Stdcallcaller caller) +extern "C" BOOL DLL_EXPORT __stdcall DoCallBack_MarshalRefInt_Stdcall(Stdcallcaller caller) { //Check the Input int itemp = iNative; @@ -67,14 +71,14 @@ extern "C" BOOL __stdcall DoCallBack_MarshalRefInt_Stdcall(Stdcallcaller caller } typedef BOOL (_cdecl * DelegatePInvokeCdecl)(int * pint); -extern "C" DelegatePInvokeCdecl MarshalRefInt_DelegatePInvoke_Cdecl() +extern "C" DLL_EXPORT DelegatePInvokeCdecl MarshalRefInt_DelegatePInvoke_Cdecl() { return MarshalRefInt_Cdcel; } typedef BOOL (__stdcall * DelegatePInvokeStdcall)(int *pint); -extern "C" DelegatePInvokeStdcall __stdcall MarshalRefInt_DelegatePInvoke_StdCall() +extern "C" DLL_EXPORT DelegatePInvokeStdcall __stdcall MarshalRefInt_DelegatePInvoke_StdCall() { return MarshalRefInt_Stdcall; } diff --git a/tests/src/Interop/RefInt/RefIntManaged.cs b/tests/src/Interop/RefInt/RefIntTest.cs Binary files differindex 9c26a12d9b..ac648f754d 100755..100644 --- a/tests/src/Interop/RefInt/RefIntManaged.cs +++ b/tests/src/Interop/RefInt/RefIntTest.cs diff --git a/tests/src/Interop/RefInt/RefIntManaged.csproj b/tests/src/Interop/RefInt/RefIntTest.csproj index ec4d0e8253..ec4d0e8253 100755..100644 --- a/tests/src/Interop/RefInt/RefIntManaged.csproj +++ b/tests/src/Interop/RefInt/RefIntTest.csproj diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/CMakeLists.txt b/tests/src/Interop/ReversePInvoke/Marshalling/CMakeLists.txt deleted file mode 100644 index fa312b6cd7..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project (MarshalBoolArrayDLL) -include_directories(${INC_PLATFORM_DIR}) -set(SOURCES MarshalBoolArrayDLL.cpp MarshalBoolArrayDLL.def) - -# add the executable -add_library (MarshalBoolArrayDLL SHARED ${SOURCES}) - -# add the install targets -install (TARGETS MarshalBoolArrayDLL DESTINATION bin) - - diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.cs b/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.cs deleted file mode 100644 index 30d3a74f6d..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.cs +++ /dev/null @@ -1,275 +0,0 @@ -// 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. -// - -// -// Adding tests for BoolArrayMarshaler code coverage -// -//Rule for Passing Value -// Reverse Pinvoke -//M--->N true,true,true,true,true -//N----M true,false,true,false,true -using System; -using System.Text; -using System.Security; -using System.Runtime.InteropServices; -using TestLibrary; - -public class MarshalBoolArray -{ - #region"variable" - const int SIZE = 5; - #endregion - - #region "Reverse PInvoke" - - #region "Bool Array" - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackIn(CallBackIn callback); - private delegate bool CallBackIn([In]int size, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, SizeConst = SIZE)] bool[] array); - private static bool TestMethod_CallBackIn(int size, bool[] array) - { - bool retVal = true; - - //Check the Input - if (SIZE != size) - { - retVal = false; - TestFramework.LogError("001","Failed on the Managed Side:TestMethod_CallBackIn:Parameter Size is wrong"); - } - for (int i = 0; i < SIZE; ++i) //Reverse PInvoke, true,false,true false,true - { - if ((0 == i % 2) && !array[i]) - { - retVal = false; - TestFramework.LogError("002","Failed on the Managed Side:TestMethod_CallBackIn. The " + (i + 1) + "st Item failed"); - } - else if ((1 == i % 2) && array[i]) - { - retVal = false; - TestFramework.LogError("003","Failed on the Managed Side:TestMethod_CallBackIn. The " + (i + 1) + "st Item failed"); - } - } - return retVal; - } - - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackOut(CallBackOut callback); - private delegate bool CallBackOut([In]int size, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeConst = SIZE)] bool[] array); - private static bool TestMethod_CallBackOut(int size, bool[] array) - { - bool retVal = true; - //Check the Input - if (SIZE != size) - { - retVal = false; - TestFramework.LogError("004","Failed on the Managed Side:TestMethod_CallBackOut:Parameter Size is wrong"); - } - - for (int i = 0; i < SIZE; ++i) //Reverse PInvoke, true,true,true true,true - { - array[i] = true; - } - return retVal; - } - - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackInOut(CallBackInOut callback); - private delegate bool CallBackInOut([In]int size, [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, SizeConst = SIZE)] bool[] array); - - private static bool TestMethod_CallBackInOut(int size, bool[] array) - { - bool retVal = true; - //Check the Input - if (SIZE != size) - { - retVal = false; - TestFramework.LogError("005","Failed on the Managed Side:TestMethod_CallBackInOut:Parameter Size is wrong"); - } - for (int i = 0; i < SIZE; ++i) //Reverse PInvoke, true,false,true false,true - { - if ((0 == i % 2) && !array[i]) - { - retVal = false; - TestFramework.LogError("006","Failed on the Managed Side:TestMethod_CallBackInOut. The " + (i + 1) + "st Item failed"); - } - else if ((1 == i % 2) && array[i]) - { - retVal = false; - TestFramework.LogError("007","Failed on the Managed Side:TestMethod_CallBackInOut. The " + (i + 1) + "st Item failed"); - } - } - - //Check the output - for (int i = 0; i < size; ++i) //Reverse PInvoke, true,true,true true,true - { - array[i] = true; - } - return retVal; - } - #endregion - - #region"Bool Array Reference" - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackRefIn(CallBackRefIn callback); - private delegate bool CallBackRefIn([In]int size, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1)] ref bool[] array); - - private static bool TestMethod_CallBackRefIn(int size, ref bool[] array) - { - bool retVal = true; - //Check the Input - if (SIZE != size) - { - retVal = false; - TestFramework.LogError("008","Failed on the Managed Side:TestMethod_CallBackRefIn:Parameter Size is wrong"); - } - //TODO: UnComment these line if the SizeConst attributes is support - //Since now the sizeconst doesnt support on ref,so only check the first item instead. - //Unhandled Exception: System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #2': Cannot use SizeParamIndex for ByRef array parameters. - //for (int i = 0; i < size; ++i) //Reverse PInvoke, true,false,true false,true - //{ - // if ((0 == i % 2) && !array[i]) - // { - // ReportFailure("Failed on the Managed Side:TestMethod_CallBackRefIn. The " + (i + 1) + "st Item failed", true.ToString(), false.ToString()); - // } - // else if ((1 == i % 2) && array[i]) - // { - // ReportFailure("Failed on the Managed Side:TestMethod_CallBackRefIn. The " + (i + 1) + "st Item failed", false.ToString(), true.ToString()); - // } - // } - if (!array[0]) - { - retVal = false; - TestFramework.LogError("009","Failed on the Managed Side:TestMethod_CallBackRefIn. The first Item failed"); - } - return retVal; - } - - - - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackRefOut(CallBackRefOut callback); - private delegate bool CallBackRefOut([In]int size, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1)] out bool[] array); - - private static bool TestMethod_CallBackRefOut(int size, out bool[] array) - { - bool retVal = true; - - //Check the Input - if (size != SIZE) - { - retVal = false; - TestFramework.LogError("010","Failed on the Managed Side:TestMethod_CallBackRefOut:Parameter Size is wrong"); - } - - array = new bool[SIZE]; - for (int i = 0; i < SIZE; ++i) //Reverse PInvoke, true,true,true true,true - { - array[i] = true; - } - return retVal; - } - - [DllImport("MarshalBoolArrayDLL")] - private static extern bool DoCallBackRefInOut(CallBackRefInOut callback); - private delegate bool CallBackRefInOut([In]int size, [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1)] ref bool[] array); - - private static bool TestMethod_CallBackRefInOut(int size, ref bool[] array) - { - bool retVal = true; - //Check the Input - if (SIZE != size) - { - retVal = false; - TestFramework.LogError("011","Failed on the Managed Side:TestMethod_CallBackRefInOut:Parameter Size is wrong"); - } - //TODO: UnComment these line if the SizeConst attributes is support - //Since now the sizeconst doesnt support on ref,so only check the first item instead. - //Unhandled Exception: System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #2': Cannot use SizeParamIndex for ByRef array parameters. - //for (int i = 0; i < size; ++i) //Reverse PInvoke, true,false,true false,true - //{ - // if ((0 == i % 2) && !array[i]) - // { - // ReportFailure("Failed on the Managed Side:TestMethod_CallBackRefInOut. The " + (i + 1) + "st Item failed", true.ToString(), false.ToString()); - // } - // else if ((1 == i % 2) && array[i]) - // { - // ReportFailure("Failed on the Managed Side:TestMethod_CallBackRefInOut. The " + (i + 1) + "st Item failed", false.ToString(), true.ToString()); - // } - // } - if (!array[0]) - { - retVal = false; - TestFramework.LogError("012","Failed on the Managed Side:TestMethod_CallBackRefInOut. The first Item failed"); - } - - //Output - array = new bool[SIZE]; - for (int i = 0; i < size; ++i) //Reverse PInvoke, true,true,true true,true - { - array[i] = true; - } - return retVal; - } - #endregion - - #endregion - - [System.Security.SecuritySafeCritical] - static int Main() - { - bool retVal = true; - - TestFramework.BeginScenario("Reverse PInvoke with In attribute"); - if (!DoCallBackIn(new CallBackIn(TestMethod_CallBackIn))) - { - retVal = false; - TestFramework.LogError("013","Error happens in Native side:DoCallBackIn"); - } - - TestFramework.BeginScenario("Reverse PInvoke with Out attribute"); - if (!DoCallBackOut(new CallBackOut(TestMethod_CallBackOut))) - { - retVal = false; - TestFramework.LogError("014","Error happens in Native side:DoCallBackOut"); - } - - TestFramework.BeginScenario("Reverse PInvoke with InOut attribute"); - if (!DoCallBackInOut(new CallBackInOut(TestMethod_CallBackInOut))) - { - retVal = false; - TestFramework.LogError("015","Error happens in Native side:DoCallBackInOut"); - } - - TestFramework.BeginScenario("Reverse PInvoke Reference In"); - if (!DoCallBackRefIn(new CallBackRefIn(TestMethod_CallBackRefIn))) - { - retVal = false; - TestFramework.LogError("016","Error happens in Native side:DoCallBackRefIn"); - } - - TestFramework.BeginScenario("Reverse PInvoke Reference Out"); - if (!DoCallBackRefOut(new CallBackRefOut(TestMethod_CallBackRefOut))) - { - retVal = false; - TestFramework.LogError("017","Error happens in Native side:DoCallBackRefOut"); - } - - TestFramework.BeginScenario("Reverse PInvoke Reference InOut"); - if (!DoCallBackRefInOut(new CallBackRefInOut(TestMethod_CallBackRefInOut))) - { - retVal = false; - TestFramework.LogError("019","Error happens in Native side:DoCallBackRefInOut"); - } - - if(retVal) - { - Console.WriteLine("Succeeded!"); - return 100; - } - - Console.WriteLine("Failed!"); - return 101; - } -} diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.csproj b/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.csproj deleted file mode 100644 index 71b516610d..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.csproj +++ /dev/null @@ -1,47 +0,0 @@ -<?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> - <AssemblyName>MarshalBoolArray</AssemblyName> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{F1E66554-8C8E-4141-85CF-D0CD6A0CD0B0}</ProjectGuid> - <OutputType>Exe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <FileAlignment>512</FileAlignment> - <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> - <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> - - <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> - <DefineConstants>$(DefineConstants);STATIC</DefineConstants> - </PropertyGroup> - <!-- Default configurations to help VS understand the configurations --> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> - </PropertyGroup> - <ItemGroup> - <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> - <Visible>False</Visible> - </CodeAnalysisDependentAssemblyPaths> - </ItemGroup> - <ItemGroup> - <Compile Include="MarshalBoolArray.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="project.json" /> - </ItemGroup> - <ItemGroup> - <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\..\Common\CoreCLRTestLibrary\CoreCLRTestLibrary.csproj"> - <Project>{c8c0dc74-fac4-45b1-81fe-70c4808366e0}</Project> - <Name>CoreCLRTestLibrary</Name> - </ProjectReference> - <ProjectReference Include="CMakeLists.txt" /> - </ItemGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> -</Project> diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.cpp b/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.cpp deleted file mode 100644 index 1a04224499..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -#include "platformdefines.cpp" -#include <stdio.h> -#include <stdlib.h> - -const int iManaged = 10; -const int iNative = 11; - -const int ArraySIZE = 5; - - -//Rule for Passing Value -// Reverse Pinvoke -//M--->N true,true,true,true,true -//N----M true,false,true,false,true - -//Reverse PInvoke -//Pass by value -typedef BOOL (__stdcall *CallBackIn)(int size,bool arr[]); -extern "C" BOOL DoCallBackIn(CallBackIn callback) -{ - //Init - bool * arr = (bool*)TP_CoTaskMemAlloc(ArraySIZE); - for(int i = 0;i < ArraySIZE; i++ ) - { - if( 0 == i%2) - { - arr[i] =true; - } - else - { - arr[i] = false; - } - } - - if(!callback(ArraySIZE,arr)) - { - printf("Native Side: in DoCallBackIn, The Callback return wrong value"); - return false; - } - - //Check the data - for(int i = 0;i < ArraySIZE; i++ )//Expected:true,false,true,false,true - { - if((0 == (i%2)) && !arr[i]) //expect true - { - printf("Native Side:Error in DoCallBackIn.The Item is %d\n",i+1); - TP_CoTaskMemFree(arr); - return false; - } - else if((1 == (i%2))&&arr[i]) //expect false - { - printf("Native Side:Error in DoCallBackIn.The Item is %d\n",i+1); - TP_CoTaskMemFree(arr); - return false; - } - } - TP_CoTaskMemFree(arr); - return true; -} - -typedef BOOL (__stdcall *CallBackOut)(int size,bool arr[]); -extern "C" BOOL DoCallBackOut(CallBackOut callback) -{ - bool * arr =(bool *)TP_CoTaskMemAlloc(ArraySIZE); - - if(!callback(ArraySIZE,arr)) - { - printf("Native Side: in DoCallBackOut, The Callback return wrong value"); - return FALSE; - } - - //Check the data returnd from Managed Side - for(int i = 0;i < ArraySIZE; i++ ) - { - if(!arr[i]) //expect true - { - printf("Native Side:Error in DoCallBackOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(arr); - return false; - } - } - TP_CoTaskMemFree(arr); - return true; -} - -typedef BOOL (__stdcall *CallBackInOut)(int size,bool arr[]); -extern "C" BOOL DoCallBackInOut(CallBackInOut callback) -{ - //Init - bool * arr =(bool *)TP_CoTaskMemAlloc(ArraySIZE); - for(int i = 0;i < ArraySIZE; i++ ) - { - if( 0 == i%2) - { - arr[i] = true; - } - else - { - arr[i] = false; - } - } - - if(!callback(ArraySIZE,arr)) - { - printf("Native Side: in DoCallBackInOut, The Callback return wrong value"); - - return FALSE; - } - - //Check the data - for(int i = 0;i < ArraySIZE; i++ ) - { - if(!arr[i]) //expect true - { - printf("Native Side:Error in DoCallBackInOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(arr); - return false; - } - } - TP_CoTaskMemFree(arr); - return true; -} - - -//Reverse PInvoke -//Pass by reference -typedef BOOL (__stdcall *CallBackRefIn)(int size,bool ** arr); -extern "C" BOOL DoCallBackRefIn(CallBackRefIn callback) -{ - //Init:true,false,true,false,true - bool *parr = (bool *)TP_CoTaskMemAlloc(ArraySIZE); - - for(int i = 0;i < ArraySIZE;++i) - { - if( 0 == i%2) - { - parr[i] = true; - } - else - { - parr[i] = false; - } - } - - if(!callback(ArraySIZE,&parr)) // &parr - { - printf("Native Side: in DoCallBackRefIn, The Callback return wrong value"); - return FALSE; - } - - //Check the data werent changed - for(int i = 0;i<ArraySIZE;++i) - { - if((0==(i%2)) && !parr[i]) //expect true - { - printf("Native Side:Error in DoCallBackInOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(parr); - return false; - } - else if((1==(i%2))&&parr[i]) //expect false - { - printf("Native Side:Error in DoCallBackInOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(parr); - return false; - } - } - TP_CoTaskMemFree(parr); - return true; -} - -typedef BOOL (__stdcall *CallBackRefOut)(int size,bool ** arr); -extern "C" BOOL DoCallBackRefOut(CallBackRefOut callback) -{ - - bool* parr = NULL; - - if(!callback(ArraySIZE,&parr)) - { - printf("Native Side: in DoCallBackRefOut, The Callback return wrong value"); - return FALSE; - } - - //Check the data were changed to true,true - for(int i = 0;i<ArraySIZE;++i) - { - if(!(*(parr + i))) //expect true - { - printf("Native Side:Error in DoCallBackRefOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(parr); - return false; - } - } - TP_CoTaskMemFree(parr); - return true; -} - -typedef BOOL (__stdcall *CallBackRefInOut)(int size,bool ** arr); -extern "C" BOOL DoCallBackRefInOut(CallBackRefInOut callback) -{ - //Init,true,false,true,false - bool* parr = (bool*)TP_CoTaskMemAlloc(ArraySIZE); - for(int i = 0;i<ArraySIZE;++i) - { - if( 0 == i%2) - { - parr[i] = true; - } - else - { - parr[i] = false; - } - } - - if(!callback(ArraySIZE,&parr)) - { - printf("Native Side: in DoCallBackRefInOut, The Callback return wrong value"); - return FALSE; - } - - //Check the data were changed to true,true - for(int i = 0;i<ArraySIZE;++i) - { - if(!(parr[i])) //expect true - { - printf("Native Side:Error in DoCallBackRefOut.The Item is %d\n",i+1); - TP_CoTaskMemFree(parr); - return false; - } - } - TP_CoTaskMemFree(parr); - return true; -} diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.def b/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.def deleted file mode 100644 index c6ec74ce33..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArrayDLL.def +++ /dev/null @@ -1,8 +0,0 @@ -EXPORTS - DoCallBackIn - DoCallBackOut - DoCallBackInOut - - DoCallBackRefIn - DoCallBackRefOut - DoCallBackRefInOut
\ No newline at end of file diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/app.config b/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/app.config deleted file mode 100644 index 62803f5972..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/app.config +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> - </dependentAssembly> - </assemblyBinding> - </runtime> -</configuration>
\ No newline at end of file diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/project.json b/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/project.json deleted file mode 100644 index 0976b60932..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/marshalboolarray/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10-beta-23302", - "System.Collections.NonGeneric": "4.0.1-beta-23302", - "System.Collections.Specialized": "4.0.1-beta-23302", - "System.ComponentModel": "4.0.1-beta-23302", - "System.Console": "4.0.0-beta-23302", - "System.Diagnostics.Process": "4.0.0-beta-23302", - "System.Globalization": "4.0.10-beta-23302", - "System.Globalization.Calendars": "4.0.0-beta-23302", - "System.IO": "4.0.10-beta-23302", - "System.IO.FileSystem": "4.0.0-beta-23302", - "System.IO.FileSystem.Primitives": "4.0.0-beta-23302", - "System.Linq": "4.0.1-beta-23302", - "System.Linq.Queryable": "4.0.1-beta-23302", - "System.Reflection": "4.0.10-beta-23302", - "System.Reflection.Primitives": "4.0.0-beta-23302", - "System.Runtime": "4.0.20-beta-23302", - "System.Runtime.Extensions": "4.0.10-beta-23302", - "System.Runtime.Handles": "4.0.0-beta-23302", - "System.Runtime.InteropServices": "4.0.20-beta-23302", - "System.Runtime.Loader": "4.0.0-beta-23302", - "System.Text.Encoding": "4.0.10-beta-23302", - "System.Threading": "4.0.10-beta-23302", - "System.Xml.ReaderWriter": "4.0.11-beta-23302", - "System.Xml.XDocument": "4.0.11-beta-23302", - "System.Xml.XmlDocument": "4.0.1-beta-23302", - "System.Xml.XmlSerializer": "4.0.11-beta-23302" - }, - "frameworks": { - "dnxcore50": {} - } -} diff --git a/tests/src/Interop/ReversePInvoke/Marshalling/project.json b/tests/src/Interop/ReversePInvoke/Marshalling/project.json deleted file mode 100644 index 14c11d232b..0000000000 --- a/tests/src/Interop/ReversePInvoke/Marshalling/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816", - "System.Collections": "4.0.10", - "System.Collections.NonGeneric": "4.0.1-beta-23302", - "System.Collections.Specialized": "4.0.1-beta-23302", - "System.ComponentModel": "4.0.1-beta-23302", - "System.Console": "4.0.0-beta-23302", - "System.Diagnostics.Process": "4.0.0-beta-23302", - "System.Globalization": "4.0.10", - "System.Globalization.Calendars": "4.0.0", - "System.IO": "4.0.10", - "System.IO.FileSystem": "4.0.0", - "System.IO.FileSystem.Primitives": "4.0.0", - "System.Linq": "4.0.1-beta-23302", - "System.Linq.Queryable": "4.0.1-beta-23302", - "System.Reflection": "4.0.10", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.Handles": "4.0.0", - "System.Runtime.InteropServices": "4.0.20", - "System.Runtime.Loader": "4.0.0-beta-23302", - "System.Text.Encoding": "4.0.10", - "System.Threading": "4.0.10", - "System.Xml.ReaderWriter": "4.0.11-beta-23302", - "System.Xml.XDocument": "4.0.11-beta-23302", - "System.Xml.XmlDocument": "4.0.1-beta-23302", - "System.Xml.XmlSerializer": "4.0.11-beta-23302" - }, - "frameworks": { - "dnxcore50": {} - } -} diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs Binary files differindex 373a1b0a68..ce9302d1c4 100755 --- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs +++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp index 8fa6f1706a..ac43d40aa6 100755 --- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp +++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp @@ -1,6 +1,8 @@ -#include <xplatform.h> - +// 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. +#include <xplatform.h> const char* strManaged = "Managed\0String\0"; size_t lenstrManaged = 7; // the length of strManaged diff --git a/tests/src/Interop/StringMarshalling/LPSTR/PinvokeDef.cs b/tests/src/Interop/StringMarshalling/LPSTR/PinvokeDef.cs index 3f37625a32..ce8455f9fa 100755 --- a/tests/src/Interop/StringMarshalling/LPSTR/PinvokeDef.cs +++ b/tests/src/Interop/StringMarshalling/LPSTR/PinvokeDef.cs @@ -1,3 +1,7 @@ +// 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.Runtime.InteropServices; using System; using System.Reflection; diff --git a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs Binary files differindex 29a8723db0..cc7369f155 100755 --- a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs +++ b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs diff --git a/tests/src/Interop/StringMarshalling/LPTSTR/LPSTRTest.csproj b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj index ed9f53febf..ed9f53febf 100755..100644 --- a/tests/src/Interop/StringMarshalling/LPTSTR/LPSTRTest.csproj +++ b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj diff --git a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestNative.cpp b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestNative.cpp index a65abb8276..95f250be92 100755 --- a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestNative.cpp +++ b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestNative.cpp @@ -1,3 +1,7 @@ +// 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. + #include <xplatform.h> const WCHAR* strManaged = W("Managed\0String\0"); diff --git a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestPInvokeDef.cs b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestPInvokeDef.cs index e08df9c796..f54397ba6b 100755 --- a/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestPInvokeDef.cs +++ b/tests/src/Interop/StringMarshalling/LPTSTR/LPTSTRTestPInvokeDef.cs @@ -1,3 +1,7 @@ +// 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.Runtime.InteropServices; using System; using System.Reflection; diff --git a/tests/src/Interop/common/types.h b/tests/src/Interop/common/types.h index 575fc320ca..097a2392e4 100644 --- a/tests/src/Interop/common/types.h +++ b/tests/src/Interop/common/types.h @@ -1,4 +1,6 @@ - +// 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. #ifndef _INTEROP_TYPES__H #define _INTEROP_TYPES__H diff --git a/tests/src/Interop/common/xplatform.h b/tests/src/Interop/common/xplatform.h index 3d30f0b75b..0d358bd356 100644 --- a/tests/src/Interop/common/xplatform.h +++ b/tests/src/Interop/common/xplatform.h @@ -1,3 +1,7 @@ +// 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. + #ifndef __XPLAT_H__ #define __XPLAT_H__ |