[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    Re: [PATCHLET] DeleteFile With Empty Paths
From:       Ryan Cumming <ryan () completely ! kicks-ass ! org>
Date:       2002-11-07 23:48:54
[Download RAW message or body]

> Can you also create a testcase for this problem?

Hmm, I've never written a Wine testcase before. Does the following look good?

-Ryan

ChangeLog:
Add test for DeleteFileA with empty paths


["emptypath-test.diff" (text/x-diff)]

Index: file.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/file.c,v
retrieving revision 1.10
diff -u -r1.10 file.c
--- file.c	27 Aug 2002 01:56:08 -0000	1.10
+++ file.c	7 Nov 2002 23:47:46 -0000
@@ -571,6 +571,14 @@
     ok(ret, "DeleteFileW: error %ld\n", GetLastError());
 }
 
+static void test_DeleteFileA( void )
+{
+    BOOL ret;
+    ret = DeleteFileA("");
+    ok((!ret) && (GetLastError() == ERROR_FILE_NOT_FOUND),
+       "DeleteFile should fail with an empty path, and last error value should be \
ERROR_FILE_NOT_FOUND"); +}
+
 #define PATTERN_OFFSET	0x10
 
 void test_offset_in_overlapped_structure(void)
@@ -648,5 +656,6 @@
     test_CopyFileW();
     test_CreateFileA();
     test_CreateFileW();
+    test_DeleteFileA();
     test_offset_in_overlapped_structure();
 }



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic