Author: hbelusca Date: Mon Jul 17 15:27:40 2017 New Revision: 75364
URL: http://svn.reactos.org/svn/reactos?rev=75364&view=rev Log: [MSVCRT_APITEST]: Commit a simple test for popen(), by Andreas Maier. CORE-11568
Added: trunk/rostests/apitests/msvcrt/popen.c (with props) Modified: trunk/rostests/apitests/msvcrt/CMakeLists.txt trunk/rostests/apitests/msvcrt/testlist.c
Modified: trunk/rostests/apitests/msvcrt/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CMakeLists... ============================================================================== --- trunk/rostests/apitests/msvcrt/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/CMakeLists.txt [iso-8859-1] Mon Jul 17 15:27:40 2017 @@ -4,6 +4,7 @@ list(APPEND SOURCE CommandLine.c ieee.c + popen.c splitpath.c testlist.c)
Added: trunk/rostests/apitests/msvcrt/popen.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/popen.c?re... ============================================================================== --- trunk/rostests/apitests/msvcrt/popen.c (added) +++ trunk/rostests/apitests/msvcrt/popen.c [iso-8859-1] Mon Jul 17 15:27:40 2017 @@ -0,0 +1,38 @@ +/* + * PROJECT: ReactOS API Tests + * LICENSE: See COPYING in the top level directory + * PURPOSE: Test for CRT process handling. + * PROGRAMMER: Andreas Maier andy1.m@gmx.de + */ + +#include <apitest.h> + +#define WIN32_NO_STATUS +#include <stdio.h> + +static void Test_popen() +{ + FILE * f; + int r; + char str[20]; + + /* NOTE: We suppose that the NT test installation has an accessible cmd.exe */ + f = _popen("cmd.exe /C "echo Hallo"", "r"); + ok(f != NULL, "_popen returns NULL!\n"); + + ZeroMemory(str, sizeof(str)); + fgets(str, sizeof(str) - 1, f); + ok(lstrcmp(str, "Hallo\n") == 0, "fgets: expected "Hallo", got %s.\n", str); + + r = _pclose(f); + ok(r == 0, "_pclose: expected 0, got %i.\n", r); + r = *_errno(); + ok(r == 0, "_errno: expected 0, got %i,\n", r); +} + +START_TEST(popen) +{ + Test_popen(); +} + +/* EOF */
Propchange: trunk/rostests/apitests/msvcrt/popen.c ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/rostests/apitests/msvcrt/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/testlist.c... ============================================================================== --- trunk/rostests/apitests/msvcrt/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/testlist.c [iso-8859-1] Mon Jul 17 15:27:40 2017 @@ -5,12 +5,14 @@
extern void func_CommandLine(void); extern void func_ieee(void); +extern void func_popen(void); extern void func_splitpath(void);
const struct test winetest_testlist[] = { { "CommandLine", func_CommandLine }, { "ieee", func_ieee }, + { "popen", func_popen }, { "splitpath", func_splitpath },
{ 0, 0 }