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.
This commit is contained in:
Martin Nordholts 2011-02-09 23:48:18 +01:00
parent 3ba0554628
commit 8bf46b3efb
2 changed files with 10 additions and 1 deletions

View File

@ -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)

View File

@ -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);
}
/**