diff options
Diffstat (limited to 'src/pal/tests/palsuite/threading/GetCurrentProcess/test1')
3 files changed, 72 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt new file mode 100644 index 0000000000..44105348be --- /dev/null +++ b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + process.c +) + +add_executable(paltest_getcurrentprocess_test1 + ${SOURCES} +) + +add_dependencies(paltest_getcurrentprocess_test1 coreclrpal) + +target_link_libraries(paltest_getcurrentprocess_test1 + pthread + m + coreclrpal +) diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c new file mode 100644 index 0000000000..17d9af6282 --- /dev/null +++ b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c @@ -0,0 +1,40 @@ +// 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. + +/*============================================================ +** +** Source: GetCurrentProcess/test1/process.c +** +** Purpose: Test for to see if the process GetCurrentProcess +** returns a handle to the current process or not. +** +** Dependencies: TerminateProcess +** +** +**=========================================================*/ + +#include <palsuite.h> + +INT __cdecl main( int argc, char **argv ) +{ + + HANDLE hProcess; + + if(0 != (PAL_Initialize(argc, argv))) + { + return ( FAIL ); + } + + hProcess = GetCurrentProcess(); + Trace ("Testing the handle returned by GetCurrentProcess\n"); + if ( 0 == ( TerminateProcess ( hProcess, PASS ) ) ) + { + Fail ("Testing GetCurrentProcess, the TerminateProcess function " + "failed.\n"); + } + + PAL_Terminate(); + return ( PASS ); + +} diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat new file mode 100644 index 0000000000..8eb2759fb9 --- /dev/null +++ b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat @@ -0,0 +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. + +Version = 1.0 +Section = threading +Function = GetCurrentProcess +Name = Positive Test for GetCurrentProcess +TYPE = DEFAULT +EXE1 = process +Description += Test to see if the function GetCurrentProcess returns a handle to the += current process or not. |