X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=rostests%2Fapitests%2Fmsvcrt%2FCommandLine.c;h=5f6d76dfad0b751a72be32e29e6fd13028095545;hp=e6b6c999c810f9c335c8cff3e4a64d34a7a45bc4;hb=7dd746b9cb2a6dc6f4c186bc5da279bc6aefcd18;hpb=6dacc020db15a6dc9cebf7a968101a73c68e1c00;ds=sidebyside diff --git a/rostests/apitests/msvcrt/CommandLine.c b/rostests/apitests/msvcrt/CommandLine.c index e6b6c999c81..5f6d76dfad0 100644 --- a/rostests/apitests/msvcrt/CommandLine.c +++ b/rostests/apitests/msvcrt/CommandLine.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS API Tests * LICENSE: GPLv2+ - See COPYING in the top level directory * PURPOSE: Test for CRT command-line handling. - * PROGRAMMER: Hermès BÉLUSCA - MAÏTO + * PROGRAMMER: Hermès BÉLUSCA - MAÏTO */ #define WIN32_NO_STATUS @@ -11,20 +11,16 @@ #include #include -#define COUNT_OF(x) (sizeof((x))/sizeof((x)[0])) +#include "./CmdLineUtil/CmdLineUtil.h" -/* - * The path to the data file is hardcoded in cmdline_util.c - * Please synchronize it whenever you do a change. - */ -#define DATAFILE L"C:\\cmdline.dat" +#define COUNT_OF(x) (sizeof((x))/sizeof((x)[0])) /** * Extracts the command tail from the command line * (deletes the program's name and keep the rest). **/ #define SPACECHAR L' ' -#define DQUOTECHAR L'\"' +#define DQUOTECHAR L'"' LPWSTR ExtractCmdLine(IN LPWSTR lpszCommandLine) { @@ -98,18 +94,18 @@ typedef struct _TEST_CASE static TEST_CASE TestCases[] = { - {L"cmdline_util.exe"}, - {L"cmdline_util.exe foo bar"}, - {L"cmdline_util.exe \"foo bar\""}, - {L"cmdline_util.exe foo \"bar John\" Doe"}, - - {L"\"cmdline_util.exe\""}, - {L"\"cmdline_util.exe\" foo bar"}, - {L"\"cmdline_util.exe\" \"foo bar\""}, - {L"\"cmdline_util.exe\" foo \"bar John\" Doe"}, - - {L"\"cmdline_util.exe\""}, - {L"\"cmdline_util.exe \"foo bar\"\""}, + {L"CmdLineUtil.exe"}, + {L"CmdLineUtil.exe foo bar"}, + {L"CmdLineUtil.exe \"foo bar\""}, + {L"CmdLineUtil.exe foo \"bar John\" Doe"}, + + {L"\"CmdLineUtil.exe\""}, + {L"\"CmdLineUtil.exe\" foo bar"}, + {L"\"CmdLineUtil.exe\" \"foo bar\""}, + {L"\"CmdLineUtil.exe\" foo \"bar John\" Doe"}, + + {L"\"CmdLineUtil.exe\""}, + {L"\"CmdLineUtil.exe \"foo bar\"\""}, }; static void Test_CommandLine(IN ULONG TestNumber, @@ -237,6 +233,7 @@ static void Test_CommandLine(IN ULONG TestNumber, ExtractCmdLine_U(&NTCmdLine); /* Print the results */ + /* *(LPWSTR)((ULONG_PTR)NTCmdLine.Buffer + NTCmdLine.Length) = 0; printf("WinMain cmdline = '%S'\n" "Win32 cmdline = '%S'\n" @@ -245,6 +242,7 @@ static void Test_CommandLine(IN ULONG TestNumber, WinMainCmdLine, Win32CmdLine, NTCmdLine.Buffer, NTCmdLine.Length); + */ /* * Now check the results.