ReactOS  0.4.15-dev-976-g0f66c66
popen.c File Reference
#include <apitest.h>
#include <stdio.h>
Include dependency graph for popen.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

static void Test_popen ()
 
 START_TEST (popen)
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file popen.c.

Function Documentation

◆ START_TEST()

START_TEST ( popen  )

Definition at line 33 of file popen.c.

34 {
35  Test_popen();
36 }
static void Test_popen()
Definition: popen.c:13

◆ Test_popen()

static void Test_popen ( )
static

Definition at line 13 of file popen.c.

14 {
15  FILE * f;
16  int r;
17  char str[20];
18 
19  /* NOTE: We suppose that the NT test installation has an accessible cmd.exe */
20  f = _popen("cmd.exe /C \"echo Hallo\"", "r");
21  ok(f != NULL, "_popen returns NULL!\n");
22 
23  ZeroMemory(str, sizeof(str));
24  fgets(str, sizeof(str) - 1, f);
25  ok(lstrcmp(str, "Hallo\n") == 0, "fgets: expected \"Hallo\", got %s.\n", str);
26 
27  r = _pclose(f);
28  ok(r == 0, "_pclose: expected 0, got %i.\n", r);
29  r = *_errno();
30  ok(r == 0, "_errno: expected 0, got %i,\n", r);
31 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_Check_return_ _CRTIMP FILE *__cdecl _popen(_In_z_ const char *_Command, _In_z_ const char *_Mode)
#define ZeroMemory
Definition: winbase.h:1648
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
_CRTIMP int *__cdecl _errno(void)
Definition: errno.c:19
#define lstrcmp
Definition: winbase.h:3712
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
#define f
Definition: ke_i.h:83
#define ok(value,...)
Definition: atltest.h:57
int CDECL _pclose(FILE *file)
Definition: popen.c:175

Referenced by START_TEST().