Skip to content

Commit

Permalink
Rewrite SafeHandle interop tests (dotnet#25784)
Browse files Browse the repository at this point in the history
* Completely rewrite the SafeHandle tests to not only be readable but easily understandable with nicer naming.

* Add useful portion of abstract-derived test back.  Enable SafeHandle test off-Windows.
  • Loading branch information
jkoritzinsky committed Jul 19, 2019
1 parent 4aa63bf commit e42331e
Show file tree
Hide file tree
Showing 37 changed files with 409 additions and 4,211 deletions.
4 changes: 4 additions & 0 deletions tests/src/Common/Platform/platformdefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ typedef unsigned int ULONG, *PULONG;
#define STDMETHODCALLTYPE
#endif

#ifndef STDMETHODVCALLTYPE
#define STDMETHODVCALLTYPE
#endif

#ifndef _MSC_VER
#if __i386__
#define __stdcall __attribute__((stdcall))
Expand Down
4 changes: 1 addition & 3 deletions tests/src/Interop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_subdirectory(PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke)
add_subdirectory(PInvoke/ExactSpelling)
add_subdirectory(PInvoke/CriticalHandles)
add_subdirectory(PInvoke/AsAny)
add_subdirectory(PInvoke/SafeHandles)
add_subdirectory(NativeCallable)
add_subdirectory(PrimitiveMarshalling/Bool)
add_subdirectory(PrimitiveMarshalling/UIntPtr)
Expand Down Expand Up @@ -70,9 +71,6 @@ if(WIN32)
add_subdirectory(PInvoke/Attributes/LCID)
add_subdirectory(PInvoke/Variant)
add_subdirectory(PInvoke/Varargs)
add_subdirectory(PInvoke/SafeHandles)
add_subdirectory(PInvoke/SafeHandles/ReliableUnmarshal)
add_subdirectory(PInvoke/SafeHandles/Interface)
add_subdirectory(PInvoke/NativeCallManagedComVisible)
# Windows-only due to bug (fixed as part of dotnet/coreclr#21415)
add_subdirectory(PInvoke/DateTime)
Expand Down

This file was deleted.

This file was deleted.

11 changes: 3 additions & 8 deletions tests/src/Interop/PInvoke/SafeHandles/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

cmake_minimum_required (VERSION 2.6)
project (PInvoke_SafeHandle)
include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake")
set(SOURCES
SafeHandleNative.cpp
)
# Additional files to reference:
# StructDefs.h
# SafeHandleNative.def
# add the executable
add_library (PInvoke_SafeHandle SHARED ${SOURCES})
# add the install targets
install (TARGETS PInvoke_SafeHandle DESTINATION bin)
add_library (SafeHandleNative SHARED ${SOURCES})
target_link_libraries(SafeHandleNative ${LINK_LIBRARIES_ADDITIONAL})
install (TARGETS SafeHandleNative DESTINATION bin)
161 changes: 0 additions & 161 deletions tests/src/Interop/PInvoke/SafeHandles/CleanUpCheck/CleanUpCheckTest.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit e42331e

Please sign in to comment.