msvcrt-B04: _popen test
Jaco Greeff
jaco at puxedo.org
Tue Nov 5 05:22:31 CST 2002
Updated to make sure that the A?? patches applies cleanly to current CVS.
License:
LGPL
Changelog:
* dlls/msvcrt/tests/Makefile.in, dlls/msvcrt/tests/popen.c: Jaco Greeff
<jaco at puxedo.org>
- popen test case
-------------- next part --------------
diff -aurN msvcrt-B03/dlls/msvcrt/tests/Makefile.in msvcrt-B04/dlls/msvcrt/tests/Makefile.in
--- msvcrt-B03/dlls/msvcrt/tests/Makefile.in Tue Nov 5 11:48:30 2002
+++ msvcrt-B04/dlls/msvcrt/tests/Makefile.in Tue Nov 5 11:50:43 2002
@@ -7,6 +7,7 @@
EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
CTESTS = \
+ popen.c \
printf.c \
scanf.c
diff -aurN msvcrt-B03/dlls/msvcrt/tests/popen.c msvcrt-B04/dlls/msvcrt/tests/popen.c
--- msvcrt-B03/dlls/msvcrt/tests/popen.c Thu Jan 1 02:00:00 1970
+++ msvcrt-B04/dlls/msvcrt/tests/popen.c Tue Nov 5 11:50:43 2002
@@ -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