msvcrt-A05: _popen/_pclose test

Jaco Greeff jaco at puxedo.org
Sun Nov 3 09:37:48 CST 2002


This msvcrt-A?? series patch implements a test case
for the _popen and _pclose functions

License:
LGPL

Changelog:
* dlls/msvcrt/tests/Makefile.in, dlls/msvcrt/tests/popen.c:
Jaco Greeff <jaco at puxedo.org>
- Test case for the _popen and _pclose functions

--[ inline patch ]--

diff -aurN msvcrt-A04/dlls/msvcrt/tests/Makefile.in
msvcrt-A05/dlls/msvcrt/tests/Makefile.in
--- msvcrt-A04/dlls/msvcrt/tests/Makefile.in	2002-11-02 22:51:10.000000000 +0000
+++ msvcrt-A05/dlls/msvcrt/tests/Makefile.in	2002-11-02 23:03:00.000000000 +0000
@@ -7,6 +7,7 @@
 EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
 
 CTESTS = \
+	popen.c \
 	printf.c \
 	scanf.c 
 
diff -aurN msvcrt-A04/dlls/msvcrt/tests/popen.c
msvcrt-A05/dlls/msvcrt/tests/popen.c
--- msvcrt-A04/dlls/msvcrt/tests/popen.c	1970-01-01 00:00:00.000000000 +0000
+++ msvcrt-A05/dlls/msvcrt/tests/popen.c	2002-11-02 23:03:24.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();
+}




More information about the wine-patches mailing list