[glom] test_document_autosave: Change the temp filename to avoid a clash.



commit cf535b79f3a7295c7d27823fb8f25c1bb9fa7cd3
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 e1cdf4a..7f1b0f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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-09  Murray Cumming  <murrayc murrayc com>
+
 	Self-Hosting: Don't keep trying indefinitely when trying various ports.
 
 	* glom/libglom/connectionpool_backends/postgres_self.cc: connect():
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]