#include <windows.h>
#include "wine/test.h"
Go to the source code of this file.
◆ runcmd()
Definition at line 24 of file xcopy.c.
25{
28 char* wcmd;
30
31
34
35
36
37
40 if (!rc)
41 return 260;
42
46 else
50
51 return rc;
52}
ACPI_SIZE strlen(const char *String)
#define HeapFree(x, y, z)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
struct _STARTUPINFOA STARTUPINFOA
#define CREATE_NEW_CONSOLE
Referenced by test_date_format(), test_keep_attributes(), and test_parms_syntax().
◆ START_TEST()
Definition at line 135 of file xcopy.c.
136{
139
143
149 {
150 skip(
"skipping xcopy tests\n");
151 return;
152 }
154
158
161}
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
static void test_parms_syntax(void)
static void test_keep_attributes(void)
static void test_date_format(void)
static char tmpdir[MAX_PATH]
◆ test_date_format()
Definition at line 54 of file xcopy.c.
55{
57
58 rc =
runcmd(
"xcopy /D:20-01-2000 xcopy1 xcopytest");
59 ok(rc == 4,
"xcopy /D:d-m-y test returned rc=%u\n", rc);
61 "xcopy should not have created xcopytest\\xcopy1\n");
62
63 rc =
runcmd(
"xcopy /D:01-20-2000 xcopy1 xcopytest");
64 ok(rc == 0,
"xcopy /D:m-d-y test failed rc=%u\n", rc);
66 "xcopy did not create xcopytest\\xcopy1\n");
68
69 rc =
runcmd(
"xcopy /D:1-20-2000 xcopy1 xcopytest");
70 ok(rc == 0,
"xcopy /D:m-d-y test failed rc=%u\n", rc);
72 "xcopy did not create xcopytest\\xcopy1\n");
74}
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
static DWORD runcmd(const char *cmd)
#define INVALID_FILE_ATTRIBUTES
Referenced by START_TEST().
◆ test_keep_attributes()
static void test_keep_attributes |
( |
void |
| ) |
|
|
static |
Definition at line 111 of file xcopy.c.
112{
114
116
117 rc =
runcmd(
"xcopy xcopy1 xcopytest");
118 ok(rc == 0,
"xcopy failed to copy read only file\n");
120 "xcopy should not have copied file permissions\n");
123
124 rc =
runcmd(
"xcopy /K xcopy1 xcopytest");
125 ok(rc == 0,
"xcopy failed to copy read only file with /k\n");
127 "xcopy did not keep file permissions\n");
130
132
133 }
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
#define FILE_ATTRIBUTE_READONLY
Referenced by START_TEST().
◆ test_parms_syntax()
Definition at line 76 of file xcopy.c.
77{
79
80 rc =
runcmd(
"xcopy /H/D:20-01-2000 xcopy1 xcopytest");
81 ok(rc == 4,
"xcopy /H/D:d-m-y test returned rc=%u\n", rc);
83 "xcopy should not have created xcopytest\\xcopy1\n");
84
85 rc =
runcmd(
"xcopy /D:01-20-2000/H xcopy1 xcopytest");
86 ok(rc == 0,
"xcopy /H/D:m-d-y test failed rc=%u\n", rc);
88 "xcopy did not create xcopytest\\xcopy1\n");
90
91
92
93
94
95
96
97
98
99 rc =
runcmd(
"xcopy /D/S xcopytest xcopytest2\\");
100 ok(rc == 0,
"xcopy /D/S test failed rc=%u\n", rc);
102 "xcopy copied empty directory incorrectly\n");
103
104 rc =
runcmd(
"xcopy /D/S/E xcopytest xcopytest2\\");
105 ok(rc == 0,
"xcopy /D/S/E test failed rc=%u\n", rc);
107 "xcopy failed to copy empty directory\n");
109}
Referenced by START_TEST().