msvcrt _tempnam dll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
	dlls/msvcrt/tests/file.c 
	Test _tempname behaviour

Test succeeds with native msvcrt.dll. Patch to msvcrt/file.c comming.

-- 
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/msvcrt/tests/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/tests/file.c,v
retrieving revision 1.1
diff -u -r1.1 file.c
--- wine/dlls/msvcrt/tests/file.c	17 Dec 2002 04:18:07 -0000	1.1
+++ wine/dlls/msvcrt/tests/file.c	15 Feb 2003 18:39:14 -0000
@@ -21,9 +21,27 @@
 #include <windef.h>
 #include <stdio.h>
 #include <fcntl.h>
+#include <stdlib.h>
 #include <io.h>
 
 #include "wine/test.h"
+static void test_tempnam( void)
+{
+  char* tempf;
+  FILE *tempfh;
+  char *tmpd= getenv("TMP");
+
+  tempf=_tempnam(".","wne");
+  ok(tempf !=NULL ,"_tempnam failed");
+  tempfh = fopen(tempf,"r"); 
+  ok(tempfh == NULL ,"_tempnam should not create file");
+  if (tmpd)
+    ok(strstr(tempf,tmpd) != NULL,"_tempnam should return name in $TMP");
+  free(tempf);
+  tempf=_tempnam(NULL,"wne");
+  ok( tempf != NULL,"_tempnam should fall back to $TMP or cwd");
+  free (tempf);
+}
 
 static void test_fdopen( void )
 {
@@ -48,4 +66,5 @@
 START_TEST(file)
 {
     test_fdopen();
+    test_tempnam();
 }


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux