Add PInvoke/Array tests (#19266)
authorZeng Jiang <v-jiazen@microsoft.com>
Thu, 15 Nov 2018 21:32:25 +0000 (05:32 +0800)
committerJeremy Koritzinsky <jkoritzinsky@gmail.com>
Thu, 15 Nov 2018 21:32:25 +0000 (13:32 -0800)
commitf5a23fe0e3120e449ddce4b9c025305a786a2481
tree8e0eb92b131dd936e97cb381542b8d974d4e3dfa
parentc71cd48bea0f93dca49793d6bf66fd90e9b9eeb5
Add PInvoke/Array tests (#19266)

* Add PInvoke/Array tests

* Fix compile warnings

* Get tests passing on Windows again.

* Change error_t type to work xplat.

* Change error_t in types.h as well

* Clean up build slightly.

* PR feedback and native test code refactoring.

* Clean up header.

* Add a xplat implementation of _itoa_s for our tests.

* CHAR -> char

* Make calling convention cdecl to avoid stdcall mangling.

* Make return test native code cdecl as well (missed it before).

* Fix bug in platformdefines _itoa_s

* Return early in TP_itoX_s when num == 0
19 files changed:
tests/src/Common/Platform/platformdefines.cpp
tests/src/Common/Platform/platformdefines.h
tests/src/Interop/CMakeLists.txt
tests/src/Interop/PInvoke/Array/MarshalArray.h [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/FldDef_DefaultArray.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/FldDef_LPArray.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/CMakeLists.txt [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/MarshalArrayByValArrayNative.cpp [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/CMakeLists.txt [new file with mode: 0644]
tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp [new file with mode: 0644]
tests/src/Interop/common/types.h