gmime r1210 - trunk/tests



Author: fejj
Date: Sat Feb  2 15:25:31 2008
New Revision: 1210
URL: http://svn.gnome.org/viewvc/gmime?rev=1210&view=rev

Log:
only create tmp dir if we need it

Modified:
   trunk/tests/test-mbox.c

Modified: trunk/tests/test-mbox.c
==============================================================================
--- trunk/tests/test-mbox.c	(original)
+++ trunk/tests/test-mbox.c	Sat Feb  2 15:25:31 2008
@@ -232,13 +232,15 @@
 	int fd, i;
 	DIR *dir;
 	
+#ifdef ENABLE_MBOX_MATCH
+	if (g_mkdir ("./tmp", 0755) == -1 && errno != EEXIST)
+		return 0;
+#endif
+	
 	g_mime_init (0);
 	
 	testsuite_init (argc, argv);
 	
-	system ("/bin/rm -rf ./tmp");
-	system ("/bin/mkdir -p ./tmp");
-	
 	path = datadir;
 	for (i = 1; i < argc; i++) {
 		if (argv[i][0] != '-') {
@@ -419,7 +421,11 @@
 		goto exit;
 	}
 	
-exit:
+ exit:
+	
+#ifdef ENABLE_MBOX_MATCH
+	g_rmdir ("./tmp");
+#endif
 	
 	testsuite_end ();
 	



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