diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2015-01-30 14:14:42 -0800 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2015-01-30 14:14:42 -0800 |
commit | ef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch) | |
tree | dee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /src/pal/tests/palsuite/threading/ExitProcess | |
download | coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2 coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip |
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'src/pal/tests/palsuite/threading/ExitProcess')
10 files changed, 212 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt new file mode 100644 index 0000000000..1962ade358 --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +add_subdirectory(test1) +add_subdirectory(test2) +add_subdirectory(test3) + diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt new file mode 100644 index 0000000000..11da23e792 --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + ExitProcess.c +) + +add_executable(paltest_exitprocess_test1 + ${SOURCES} +) + +add_dependencies(paltest_exitprocess_test1 CoreClrPal) + +target_link_libraries(paltest_exitprocess_test1 + pthread + rt + m + CoreClrPal +) diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c b/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c new file mode 100644 index 0000000000..0832061566 --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c @@ -0,0 +1,33 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +/*============================================================ +** +** Source: exitprocess/test1/exitprocess.c +** +** Purpose: Test to ensure ExitProcess returns the argument given +** to it. +** +** +**=========================================================*/ + +#include <palsuite.h> + +int __cdecl main( int argc, char **argv ) + +{ + + if(0 != (PAL_Initialize(argc, argv))) + { + return ( FAIL ); + } + + ExitProcess(PASS); + + Fail ("ExitProcess(0) failed to exit.\n Test Failed.\n"); + + return ( FAIL); + +} diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat b/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat new file mode 100644 index 0000000000..3c330cdfbc --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat @@ -0,0 +1,13 @@ +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# + +Version = 1.0 +Section = threading +Function = ExitProcess +Name = Positive Test for ExitProcess +TYPE = DEFAULT +EXE1 = exitprocess +Description += Test the ExitProcess function. The test runs the ExitProcess function += with the TEST_RETURN enumeration value PASS diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt new file mode 100644 index 0000000000..b4fc001ffc --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + test2.c +) + +add_executable(paltest_exitprocess_test2 + ${SOURCES} +) + +add_dependencies(paltest_exitprocess_test2 CoreClrPal) + +target_link_libraries(paltest_exitprocess_test2 + pthread + rt + m + CoreClrPal +) diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c b/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c new file mode 100644 index 0000000000..adc703622f --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c @@ -0,0 +1,31 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +/*============================================================================= +** +** Source: test2.c +** +** Purpose: Positive test for ExitProcess. +** +** Dependencies: none +** + +** +**===========================================================================*/ +#include <palsuite.h> + + + +int __cdecl main( int argc, char **argv ) + +{ + /* call ExitProcess() -- should work without PAL_Initialize() */ + ExitProcess(PASS); + + + /* return failure if we reach here -- note no attempt at */ + /* meaningful output because we never called PAL_Initialize(). */ + return FAIL; +} diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat b/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat new file mode 100644 index 0000000000..f0fb1a6432 --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat @@ -0,0 +1,14 @@ +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# + +Version = 1.0 +Section = threading +Function = ExitProcess +Name = Positive test for ExitProcess +TYPE = DEFAULT +EXE1 = test2 +Description += Test to ensure proper operation of the ExitProcess() += API by ensuring it works before PAL_Initialize() is += called. diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt new file mode 100644 index 0000000000..4f2b34f22c --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + test3.c +) + +add_executable(paltest_exitprocess_test3 + ${SOURCES} +) + +add_dependencies(paltest_exitprocess_test3 CoreClrPal) + +target_link_libraries(paltest_exitprocess_test3 + pthread + rt + m + CoreClrPal +) diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c b/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c new file mode 100644 index 0000000000..90f689089f --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c @@ -0,0 +1,41 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +/*============================================================================= +** +** Source: test3.c +** +** Purpose: Positive test for ExitProcess. +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** + +** +**===========================================================================*/ +#include <palsuite.h> + + + +int __cdecl main( int argc, char **argv ) + +{ + /* initialize the PAL */ + if( PAL_Initialize(argc, argv) != 0 ) + { + return( FAIL ); + } + + /* terminate the PAL */ + PAL_Terminate(); + + /* call ExitProcess() -- should work after PAL_Terminate() */ + ExitProcess( PASS ); + + + /* return failure if we reach here -- note no attempt at */ + /* meaningful output because we've called PAL_Terminte(). */ + return FAIL; +} diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat b/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat new file mode 100644 index 0000000000..522325f96c --- /dev/null +++ b/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat @@ -0,0 +1,14 @@ +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# + +Version = 1.0 +Section = threading +Function = ExitProcess +Name = Positive test for ExitProcess +TYPE = DEFAULT +EXE1 = test3 +Description += Test to ensure proper operation of the ExitProcess() += API by ensuring it works after PAL_Terminate() is += called. |