summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp')
-rw-r--r--src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp b/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp
new file mode 100644
index 0000000000..6feedfce76
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp
@@ -0,0 +1,41 @@
+// 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: terminateprocess/test1/terminateprocess.c
+**
+** Purpose: Test to see if TerminateProcess will
+** terminate the current process.
+**
+** Dependencies: GetCurrentProcess
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+INT __cdecl main( int argc, char **argv )
+{
+
+ HANDLE hProcess;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return (FAIL);
+ }
+
+ hProcess = GetCurrentProcess();
+
+ Trace ("Testing TerminateProcess function.\n");
+
+ if ( 0 == ( TerminateProcess ( hProcess, PASS ) ) )
+ {
+ Fail ("TerminateProcess failed.\n");
+ }
+
+ PAL_TerminateEx(FAIL);
+ return (FAIL);
+
+}