[gimp] app/tests: Cleanup temp files after tests



commit 8bf46b3efbf72d70b25e72460cc117e39ff97b50
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Feb 9 23:48:18 2011 +0100

    app/tests: Cleanup temp files after tests
    
    Remove files in /tmp after tests so that other users on the same
    machine (like buildbots) also can run make distcheck without getting
    "can't overwrite file" errors.

 app/tests/test-save-and-export.c |    5 +++++
 app/tests/test-xcf.c             |    6 +++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/app/tests/test-save-and-export.c b/app/tests/test-save-and-export.c
index efcdea9..4cd90d7 100644
--- a/app/tests/test-save-and-export.c
+++ b/app/tests/test-save-and-export.c
@@ -19,6 +19,7 @@
 #include <string.h>
 
 #include <gegl.h>
+#include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -246,6 +247,8 @@ saved_imported_file_uris (GimpTestFixture *fixture,
   g_assert_cmpstr (gimp_image_get_uri (image), ==, save_uri);
   g_assert (gimp_image_get_imported_uri (image) == NULL);
   g_assert (gimp_image_get_exported_uri (image) == NULL);
+
+  g_unlink (save_filename);
 }
 
 /**
@@ -285,6 +288,8 @@ exported_file_uris (GimpTestFixture *fixture,
   g_assert (gimp_image_get_uri (image) == NULL);
   g_assert (gimp_image_get_imported_uri (image) == NULL);
   g_assert_cmpstr (gimp_image_get_exported_uri (image), ==, save_uri);
+
+  g_unlink (save_filename);
 }
 
 int main(int argc, char **argv)
diff --git a/app/tests/test-xcf.c b/app/tests/test-xcf.c
index e93dc96..768f1d8 100644
--- a/app/tests/test-xcf.c
+++ b/app/tests/test-xcf.c
@@ -17,6 +17,8 @@
 
 #include <string.h>
 
+#include <glib/gstdio.h>
+
 #include <gegl.h>
 
 #include <gtk/gtk.h>
@@ -323,7 +325,6 @@ gimp_write_and_read_file (gboolean with_unusual_stuff,
 
   /* Load from file */
   loaded_image = gimp_test_load_image (image->gimp, uri);
-  g_free (uri);
 
   /* Assert on the loaded file. If success, it means that there is no
    * significant information loss when we wrote the image to a file
@@ -333,6 +334,9 @@ gimp_write_and_read_file (gboolean with_unusual_stuff,
                          with_unusual_stuff,
                          compat_paths,
                          use_gimp_2_8_features);
+
+  g_unlink (uri);
+  g_free (uri);
 }
 
 /**



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