[glom/glom-1-16] test_document_autosave: Change the temp filename to avoid a clash.



commit 640fa7afd4bd1fa2552c28e7b5d9a6bb0d8e39ab
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Aug 9 14:49:00 2010 +0200

    test_document_autosave: Change the temp filename to avoid a clash.
    
    * tests/test_document_autosave.cc: Rename the file because we sometimes
      seem to clash with a directory of the same name.

 ChangeLog                       |    7 +++++++
 tests/test_document_autosave.cc |   10 ++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 429562f..d8b5c12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-09  Murray Cumming  <murrayc murrayc com>
+
+	test_document_autosave: Change the temp filename to avoid a clash.
+
+	* tests/test_document_autosave.cc: Rename the file because we sometimes
+  seem to clash with a directory of the same name.
+
 2010-08-10  Murray Cumming  <murrayc murrayc com>
 
 	Catch exceptions from std::locale::global().
diff --git a/tests/test_document_autosave.cc b/tests/test_document_autosave.cc
index 7208237..9ef3496 100644
--- a/tests/test_document_autosave.cc
+++ b/tests/test_document_autosave.cc
@@ -30,7 +30,7 @@ void cleanup()
   {
     //TODO: Catch exceptions:
     Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(file_uri);
-    file->remove();
+    file->remove(); //This should be OK because it is a file, not a directory.
   }
   catch(const Gio::Error& ex)
   {
@@ -38,12 +38,14 @@ void cleanup()
     if(ex.code() == Gio::Error::NOT_FOUND)
       return;
 
-    std::cerr << G_STRFUNC << ": Exception from Gio::File::remove(): " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": Exception from Gio::File::remove(): " << ex.what() << std::endl
+      << "  file_uri= " << file_uri << std::endl;
     exit(EXIT_FAILURE);
   }
   catch(const Glib::Error& ex)
   {
-    std::cerr << G_STRFUNC << ":Exception from Gio::File::remove(): " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ":Exception from Gio::File::remove(): " << ex.what() << std::endl
+      << "  file_uri= " << file_uri << std::endl;
     exit(EXIT_FAILURE);
   }
 }
@@ -53,7 +55,7 @@ int main()
   Glom::libglom_init();
 
   //For instance, /tmp/testfile.glom");
-  const std::string temp_filename = "testglom";
+  const std::string temp_filename = "testglom_document_autosave";
   const std::string temp_filepath = Glib::build_filename(Glib::get_tmp_dir(),
     temp_filename);
   file_uri = Glib::filename_to_uri(temp_filepath);



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