[PATCH 1/2] msvcrt: add _makepath() tests

Peter Beutner p.beutner at gmx.net
Mon Aug 6 08:34:20 CDT 2007


---
 dlls/msvcrt/tests/dir.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/tests/dir.c b/dlls/msvcrt/tests/dir.c
index 009cbdb..f3c4d08 100644
--- a/dlls/msvcrt/tests/dir.c
+++ b/dlls/msvcrt/tests/dir.c
@@ -31,6 +31,22 @@
 #include <process.h>
 #include <errno.h>
 
+static void test_makepath(void)
+{
+    char buffer[MAX_PATH];
+
+    _makepath(buffer, "C", "\\foo", "dummy", "txt");
+    ok( strcmp(buffer, "C:\\foo\\dummy.txt") == 0, "unexpected result: %s\n", buffer);
+    _makepath(buffer, "C:", "\\foo\\", "dummy", ".txt");
+    ok( strcmp(buffer, "C:\\foo\\dummy.txt") == 0, "unexpected result: %s\n", buffer);
+
+    /* this works with native and e.g. Freelancer depends on it */
+    strcpy(buffer, "foo");
+    _makepath(buffer, NULL, buffer, "dummy.txt", NULL);
+    todo_wine { ok( strcmp(buffer, "foo\\dummy.txt") == 0,
+                    "unexpected result: %s\n", buffer); }
+}
+
 static void test_fullpath(void)
 {
     char full[MAX_PATH];
@@ -91,4 +107,5 @@ static void test_fullpath(void)
 START_TEST(dir)
 {
     test_fullpath();
+    test_makepath();
 }
-- 
1.5.2.2





More information about the wine-patches mailing list