26#define FILE1 "fc-test1.txt"
27#define FILE2 "fc-test2.txt"
28#define FILES " " FILE1 " " FILE2
29#define COMPARING "Comparing files fc-test1.txt and FC-TEST2.TXT\n"
30#define NO_DIFF "FC: no differences encountered\n"
31#define RESYNC_FAILED "Resync Failed. Files are too different.\n"
63 "FC: FC-TEST2.TXT longer than fc-test1.txt\n\n"
68 "FC: FC-TEST2.TXT longer than fc-test1.txt\n"
83 "***** fc-test1.txt\nA\n"
84 "***** FC-TEST2.TXT\nB\n"
89 "***** fc-test1.txt\nB\n"
90 "***** FC-TEST2.TXT\nA\n"
99 "***** fc-test1.txt\nAB\n"
100 "***** FC-TEST2.TXT\nBA\n"
112 __LINE__, 1,
"fc" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nB\nD\nE\n", -1, -1,
COMPARING
113 "***** fc-test1.txt\nB\nC\nD\n"
114 "***** FC-TEST2.TXT\nB\nB\nD\n"
119 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"B\nB\nC\nD\nE\n", -1, -1,
COMPARING
120 "***** fc-test1.txt\nA\nB\n"
121 "***** FC-TEST2.TXT\nB\nB\n"
125 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"C\nC\nC\nD\nE\n", -1, -1,
COMPARING
126 "***** fc-test1.txt\nA\nB\nC\n"
127 "***** FC-TEST2.TXT\nC\nC\nC\n"
131 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nC\nC\nD\nE\n", -1, -1,
COMPARING
132 "***** fc-test1.txt\nA\nB\nC\n"
133 "***** FC-TEST2.TXT\nA\nC\nC\n"
137 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nC\nC\nC\nE\n", -1, -1,
COMPARING
138 "***** fc-test1.txt\nA\n...\nE\n"
139 "***** FC-TEST2.TXT\nA\n...\nE\n"
143 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nD\nF\n", -1, -1,
COMPARING
144 "***** fc-test1.txt\nD\nE\n"
145 "***** FC-TEST2.TXT\nD\nF\n"
149 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nF\nF\n", -1, -1,
COMPARING
150 "***** fc-test1.txt\nC\nD\nE\n"
151 "***** FC-TEST2.TXT\nC\nF\nF\n"
155 __LINE__, 1,
"fc /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nF\nF\nF\n", -1, -1,
COMPARING
156 "***** fc-test1.txt\nB\n...\nE\n"
157 "***** FC-TEST2.TXT\nB\n...\nF\n"
161 __LINE__, 1,
"fc /A" FILES,
"A\nC\nE\nF\nE\n",
"A\nB\nC\nD\nE\n", -1, -1,
COMPARING
162 "***** fc-test1.txt\nA\nC\nE\n"
163 "***** FC-TEST2.TXT\nA\n...\nE\n"
165 "***** fc-test1.txt\nF\nE\n"
166 "***** FC-TEST2.TXT\n"
171 __LINE__, 1,
"fc /N /A" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nB\nD\nE\n", -1, -1,
COMPARING
172 "***** fc-test1.txt\n 2: B\n 3: C\n 4: D\n"
173 "***** FC-TEST2.TXT\n 2: B\n 3: B\n 4: D\n"
177 __LINE__, 1,
"fc /N /A" FILES,
"A\nC\nC\nD\nE\n",
"A\nB\nC\nD\nE\n", -1, -1,
COMPARING
178 "***** fc-test1.txt\n 1: A\n 2: C\n 3: C\n"
179 "***** FC-TEST2.TXT\n 1: A\n 2: B\n 3: C\n"
183 __LINE__, 1,
"fc /N /A" FILES,
"A\nC\nC\nC\nE\n",
"A\nB\nC\nD\nE\n", -1, -1,
COMPARING
184 "***** fc-test1.txt\n 1: A\n...\n 5: E\n"
185 "***** FC-TEST2.TXT\n 1: A\n...\n 5: E\n"
189 __LINE__, 1,
"fc /N /A" FILES,
"A\nC\nE\nF\nC\n",
"A\nB\nC\nD\nE\n", -1, -1,
COMPARING
190 "***** fc-test1.txt\n 1: A\n...\n 5: C\n"
191 "***** FC-TEST2.TXT\n 1: A\n 2: B\n 3: C\n"
193 "***** fc-test1.txt\n"
194 "***** FC-TEST2.TXT\n 4: D\n 5: E\n"
198 __LINE__, 1,
"fc /N /A" FILES,
"A\nC\nE\nF\nE\n",
"A\nB\nC\nD\nE\n", -1, -1,
COMPARING
199 "***** fc-test1.txt\n 1: A\n 2: C\n 3: E\n"
200 "***** FC-TEST2.TXT\n 1: A\n...\n 5: E\n"
202 "***** fc-test1.txt\n 4: F\n 5: E\n"
203 "***** FC-TEST2.TXT\n"
208 __LINE__, 0,
"fc" FILES,
"A\n\tB\nC",
"A\n B\nC", -1, -1,
COMPARING
212 __LINE__, 0,
"fc" FILES,
"A\n \tB\nC",
"A\n B\nC", -1, -1,
COMPARING
217 __LINE__, 1,
"fc /T" FILES,
"A\n\tB\nC",
"A\n B\nC", -1, -1,
COMPARING
218 "***** fc-test1.txt\nA\n\tB\nC\n"
219 "***** FC-TEST2.TXT\nA\n B\nC\n"
223 __LINE__, 1,
"fc /T" FILES,
"A\n \tB\nC",
"A\n B\nC", -1, -1,
COMPARING
224 "***** fc-test1.txt\nA\n \tB\nC\n"
225 "***** FC-TEST2.TXT\nA\n B\nC\n"
230 __LINE__, 0,
"fc /W" FILES,
"A\n \tB\nC",
"A\n B\nC", -1, -1,
COMPARING
234 __LINE__, 0,
"fc /W" FILES,
"\tA \nB\n",
"A\nB\n", -1, -1,
COMPARING
238 __LINE__, 1,
"fc /W" FILES,
" A \nB\n",
"AB\nB\n", -1, -1,
COMPARING
239 "***** fc-test1.txt\n A \nB\n"
240 "***** FC-TEST2.TXT\nAB\nB\n"
245 __LINE__, 0,
"fc /W /T" FILES,
"A\n \tB\nC",
"A\n B\nC", -1, -1,
COMPARING
249 __LINE__, 0,
"fc /W /T" FILES,
"A\n \tB\nC",
"A\n B\nC", -1, -1,
COMPARING
253 __LINE__, 1,
"fc /W /T" FILES,
"\tA \nB\n",
"AB\nB\n", -1, -1,
COMPARING
254 "***** fc-test1.txt\n\tA \nB\n"
255 "***** FC-TEST2.TXT\nAB\nB\n"
260 __LINE__, 1,
"fc /N" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nE\nE\n", -1, -1,
COMPARING
261 "***** fc-test1.txt\n 3: C\n 4: D\n 5: E\n"
262 "***** FC-TEST2.TXT\n 3: C\n 4: E\n"
264 "***** fc-test1.txt\n"
265 "***** FC-TEST2.TXT\n 5: E\n"
270 __LINE__, 1,
"fc" FILES,
"ABC\000DE",
"ABC\000\000\000", 6, 6,
COMPARING
271 "***** fc-test1.txt\nABC\nDE\n"
272 "***** FC-TEST2.TXT\nABC\n\n\n"
276 __LINE__, 1,
"fc" FILES,
"ABC\000DE",
"ABC\n\000\000", 6, 6,
COMPARING
277 "***** fc-test1.txt\nABC\nDE\n"
278 "***** FC-TEST2.TXT\nABC\n\n\n"
287 __LINE__, 0,
"fc" FILES,
"ABC\nABC",
"ABC\r\nABC", -1, -1,
COMPARING
291 __LINE__, 1,
"fc" FILES,
"ABC\nABC",
"ABC\r\r\nABC", -1, -1,
COMPARING
292 "***** fc-test1.txt\nABC\nABC\n"
293 "***** FC-TEST2.TXT\nABC\nABC\n"
304 __LINE__, 0,
"fc /U" FILES,
"A\000B\000",
"A\000B\000", 4, 4,
COMPARING
308 __LINE__, 1,
"fc /U" FILES,
"A\000B\000",
"A\000C\000", 4, 4,
COMPARING
309 "***** fc-test1.txt\nAB\n"
310 "***** FC-TEST2.TXT\nAC\n"
315 __LINE__, 1,
"fc /LB2" FILES,
"A\nB\nC\nD\nE\n",
"B\nB\nC\nD\nE\n", -1, -1,
COMPARING
316 "***** fc-test1.txt\nA\nB\n"
317 "***** FC-TEST2.TXT\nB\nB\n"
321 __LINE__, 1,
"fc /LB2" FILES,
"A\nB\nC\nD\nE\n",
"C\nC\nC\nD\nE\n", -1, -1,
COMPARING
323 "***** fc-test1.txt\nA\nB\n"
324 "***** FC-TEST2.TXT\nC\nC\n"
328 __LINE__, 1,
"fc /LB2" FILES,
"A\nB\nC\nD\nE\n",
"D\nD\nD\nD\nE\n", -1, -1,
COMPARING
330 "***** fc-test1.txt\nA\nB\n"
331 "***** FC-TEST2.TXT\nD\nD\n"
335 __LINE__, 1,
"fc /LB2" FILES,
"A\nB\nC\nD\nE\n",
"A\nC\nC\nD\nE\n", -1, -1,
COMPARING
337 "***** fc-test1.txt\nA\nB\n"
338 "***** FC-TEST2.TXT\nA\nC\n"
343 __LINE__, 1,
"fc /LB3" FILES,
"A\nB\nC\nD\nE\n",
"C\nC\nC\nD\nE\n", -1, -1,
COMPARING
344 "***** fc-test1.txt\nA\nB\nC\n"
345 "***** FC-TEST2.TXT\nC\nC\n"
347 "***** fc-test1.txt\nC\nD\n"
348 "***** FC-TEST2.TXT\nC\nC\nD\n"
352 __LINE__, 1,
"fc /LB3" FILES,
"A\nB\nC\nD\nE\n",
"D\nD\nD\nD\nE\n", -1, -1,
COMPARING
354 "***** fc-test1.txt\nA\nB\nC\n"
355 "***** FC-TEST2.TXT\nD\nD\nD\n"
360 __LINE__, 1,
"fc /N /LB2" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nE\nE\n", -1, -1,
COMPARING
362 "***** fc-test1.txt\n 3: C\n 4: D\n"
363 "***** FC-TEST2.TXT\n 3: C\n 4: E\n"
368 __LINE__, 1,
"fc /1" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nE\nE\n", -1, -1,
COMPARING
369 "***** fc-test1.txt\nC\nD\nE\n"
370 "***** FC-TEST2.TXT\nC\nE\n"
374 __LINE__, 1,
"fc /1" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nX\nX\nE\n", -1, -1,
COMPARING
375 "***** fc-test1.txt\nB\nC\nD\nE\n"
376 "***** FC-TEST2.TXT\nB\nX\nX\nE\n"
380 __LINE__, 1,
"fc /1" FILES,
"A\nB\nC\nD\nE\nF\n",
"A\nB\nX\nD\nX\nF", -1, -1,
COMPARING
381 "***** fc-test1.txt\nB\nC\nD\n"
382 "***** FC-TEST2.TXT\nB\nX\nD\n"
384 "***** fc-test1.txt\nD\nE\nF\n"
385 "***** FC-TEST2.TXT\nD\nX\nF\n"
390 __LINE__, 1,
"fc /3" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nC\nE\nE\n", -1, -1,
COMPARING
391 "***** fc-test1.txt\nC\nD\nE\n"
392 "***** FC-TEST2.TXT\nC\nE\n"
396 __LINE__, 1,
"fc /3" FILES,
"A\nB\nC\nD\nE\n",
"A\nB\nX\nX\nE\n", -1, -1,
COMPARING
397 "***** fc-test1.txt\nB\nC\nD\nE\n"
398 "***** FC-TEST2.TXT\nB\nX\nX\nE\n"
402 __LINE__, 1,
"fc /3" FILES,
"A\nB\nC\nD\nE\nF\n",
"A\nB\nX\nD\nX\nF", -1, -1,
COMPARING
403 "***** fc-test1.txt\nB\nC\nD\nE\nF\n"
404 "***** FC-TEST2.TXT\nB\nX\nD\nX\nF\n"
425 sa.nLength =
sizeof(
sa);
426 sa.lpSecurityDescriptor =
NULL;
453 if (phOutputRead && phOutputRead == phErrorRead)
458 else if (phErrorRead)
517 INT file1_size, file2_size;
519 DWORD cbAvail, cbRead;
525 file1_size =
pEntry->file1_size;
526 file2_size =
pEntry->file2_size;
527 if (file1_size == -1)
529 if (file2_size == -1)
553 ok(
ret,
"Line %d: CreateProcessA failed\n",
pEntry->lineno);
555#define TIMEOUT (10 * 1000)
563 if (cbAvail >
sizeof(szOutput))
564 cbAvail =
sizeof(szOutput) - 1;
566 ReadFile(hOutputRead, szOutput, cbAvail, &cbRead,
NULL);
572 ok(dwExitCode ==
pEntry->ret,
"Line %d: dwExitCode was 0x%lx\n",
pEntry->lineno, dwExitCode);
579 printf(
"---UP TO HERE\n");
601#define ENGLISH_CP 437
ACPI_SIZE strlen(const char *String)
static struct sockaddr_in sa
#define ok_int(expression, result)
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
INT WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
#define ReadFile(a, b, c, d, e)
#define GetCurrentProcess()
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCP(UINT wCodePageID)
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(VOID)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
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 PathFileExistsA(LPCSTR lpszPath)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_In_ BOOL _In_ HANDLE hProcess
static BOOL PrepareForRedirect(STARTUPINFOA *psi, PHANDLE phInputWrite, PHANDLE phOutputRead, PHANDLE phErrorRead)
static void DoTestEntry(const TEST_ENTRY *pEntry)
static const TEST_ENTRY s_entries[]
BOOL DoDuplicateHandle(HANDLE hFile, PHANDLE phFile, BOOL bInherit)
static void ConvertOutput(LPSTR psz)
struct TEST_ENTRY TEST_ENTRY
BOOL WINAPI PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage)
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define STD_OUTPUT_HANDLE
#define STARTF_USESTDHANDLES
#define DUPLICATE_SAME_ACCESS