Hi, This is a test case for the _popen/_pclose functions. License: LGPL Changelog: * dlls/msvcrt/tests/Makefile.in, dlls/msvcrt/tests/popen.c: Jaco.Greeff <jaco@puxedo.org> - Test case for the _popen and _pclose family of functions --[ inline patch ]-- diff -aurN msvcrt-popen-test.orig/dlls/msvcrt/tests/Makefile.in msvcrt-popen-test.new/dlls/msvcrt/tests/Makefile.in --- msvcrt-popen-test.orig/dlls/msvcrt/tests/Makefile.in 2002-11-02 17:23:08.000000000 +0000 +++ msvcrt-popen-test.new/dlls/msvcrt/tests/Makefile.in 2002-11-02 17:24:34.000000000 +0000 @@ -7,6 +7,7 @@ EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt CTESTS = \ + popen.c \ scanf.c @MAKE_TEST_RULES@ diff -aurN msvcrt-popen-test.orig/dlls/msvcrt/tests/popen.c msvcrt-popen-test.new/dlls/msvcrt/tests/popen.c --- msvcrt-popen-test.orig/dlls/msvcrt/tests/popen.c 1970-01-01 00:00:00.000000000 +0000 +++ msvcrt-popen-test.new/dlls/msvcrt/tests/popen.c 2002-11-02 17:25:06.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Unit test suite for _popen/_wpopen/_pclose functions. + * + * Copyright 2002 Jaco Greeff + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "stdio.h" +#include "wine/test.h" + +static void test_popen(void) +{ + CHAR szBuff[2048]; + FILE *fProcess; + + ok((fProcess = _popen("dir", "r")) != NULL, "_popen failed"); + ok(fread(szBuff, sizeof(CHAR), 2047, fProcess) != -1, "read from process failed"); + ok(_pclose(fProcess) == 0, "_pclose failed"); +} + +START_TEST(popen) +{ + test_popen(); +}