[MSVCRT:APITEST]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 9 Oct 2012 22:03:50 +0000 (22:03 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 9 Oct 2012 22:03:50 +0000 (22:03 +0000)
Move cmdline_util to CmdLineUtil and locate it in bin/data instead of bin

svn path=/trunk/; revision=57527

rostests/apitests/msvcrt/CMakeLists.txt
rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt [new file with mode: 0644]
rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.c [moved from rostests/apitests/msvcrt/cmdline_util/cmdline_util.c with 97% similarity]
rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.h [new file with mode: 0644]
rostests/apitests/msvcrt/CommandLine.c
rostests/apitests/msvcrt/cmdline_util/CMakeLists.txt [deleted file]

index 07022be..fc853c7 100644 (file)
@@ -1,7 +1,5 @@
 
-add_subdirectory(cmdline_util)
-
-add_definitions(-D_DLL -D__USE_CRTIMP)
+add_subdirectory(CmdLineUtil)
 
 list(APPEND SOURCE
     CommandLine.c
diff --git a/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt b/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6a07063
--- /dev/null
@@ -0,0 +1,8 @@
+
+list(APPEND SOURCE
+     CmdLineUtil.c)
+
+add_executable(CmdLineUtil ${SOURCE})
+set_module_type(CmdLineUtil win32gui UNICODE)
+add_importlibs(CmdLineUtil msvcrt kernel32 ntdll)
+add_cd_file(TARGET CmdLineUtil DESTINATION reactos/bin/data FOR all)
@@ -10,6 +10,8 @@
 #include <windows.h>
 #include <ndk/ntndk.h>
 
+#include "CmdLineUtil.h"
+
 int APIENTRY wWinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPWSTR    lpCmdLine,
@@ -23,7 +25,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
     UNICODE_STRING CmdLine_U = NtCurrentPeb()->ProcessParameters->CommandLine;
 
     /* Write the results into a file. */
-    HANDLE hFile = CreateFileW(L"C:\\cmdline.dat",
+    HANDLE hFile = CreateFileW(DATAFILE,
                                GENERIC_WRITE,
                                0, NULL,
                                CREATE_ALWAYS,
diff --git a/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.h b/rostests/apitests/msvcrt/CmdLineUtil/CmdLineUtil.h
new file mode 100644 (file)
index 0000000..974cb0f
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * PROJECT:         ReactOS API Tests
+ * LICENSE:         GPLv2+ - See COPYING in the top level directory
+ * PURPOSE:         Test for CRT command-line handling - Utility GUI program.
+ * PROGRAMMER:      Hermès BÉLUSCA - MAÏTO <hermes.belusca@sfr.fr>
+ */
+
+#pragma once
+
+// The path to the data file.
+#define DATAFILE    L"C:\\cmdline.dat"
+
+/* EOF */
index e6b6c99..fd9779f 100644 (file)
 #include <wine/test.h>
 #include <ndk/ntndk.h>
 
-#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.
diff --git a/rostests/apitests/msvcrt/cmdline_util/CMakeLists.txt b/rostests/apitests/msvcrt/cmdline_util/CMakeLists.txt
deleted file mode 100644 (file)
index ce0cf5b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-add_definitions(-D_DLL -D__USE_CRTIMP)
-
-list(APPEND SOURCE
-     cmdline_util.c)
-
-add_executable(cmdline_util ${SOURCE})
-set_module_type(cmdline_util win32gui UNICODE)
-add_importlibs(cmdline_util msvcrt kernel32 ntdll)
-add_cd_file(TARGET cmdline_util DESTINATION reactos/bin FOR all)