[Liblas-commits] r1290 - trunk/test/unit

liblas-commits at liblas.org liblas-commits at liblas.org
Thu May 28 07:06:57 EDT 2009


Author: mloskot
Date: Thu May 28 07:06:53 2009
New Revision: 1290
URL: http://liblas.org/changeset/1290

Log:
Cleaned complains about file unlink failure reported for temporary test files (Ticket #138).

Modified:
   trunk/test/unit/lasfile_test.cpp
   trunk/test/unit/laswriter_test.cpp

Modified: trunk/test/unit/lasfile_test.cpp
==============================================================================
--- trunk/test/unit/lasfile_test.cpp	(original)
+++ trunk/test/unit/lasfile_test.cpp	Thu May 28 07:06:53 2009
@@ -18,24 +18,25 @@
 
 namespace tut
 { 
+
     struct lasfile_data
     {
         std::string tmpfile_;
         std::string file10_;
 
         lasfile_data()
-            : tmpfile_(g_test_data_path + "//lasfile_tmp.las"),
-                file10_(g_test_data_path + "//TO_core_last_clip.las")
+            : tmpfile_(g_test_data_path + "/lasfile_tmp.las"),
+                file10_(g_test_data_path + "/TO_core_last_clip.las")
         {}
 
         ~lasfile_data()
         {
             // remove temporary file after each test case
             int const ret = std::remove(tmpfile_.c_str());
-			if (0 != ret)
-			{
-				std::cerr << "Failed to remove \'" << tmpfile_ << "\' file\n";
-			}
+            if (0 != ret)
+            {
+                ; // ignore, file may not exist
+            }
         }
     };
 
@@ -268,4 +269,3 @@
         test_default_header(header1);
     }
 }
-

Modified: trunk/test/unit/laswriter_test.cpp
==============================================================================
--- trunk/test/unit/laswriter_test.cpp	(original)
+++ trunk/test/unit/laswriter_test.cpp	Thu May 28 07:06:53 2009
@@ -35,8 +35,11 @@
         ~laswriter_data()
         {
             // remove temporary file after each test case
-            int const rc = std::remove(tmpfile_.c_str());
-            ensure_equals(rc, 0);
+            int const ret = std::remove(tmpfile_.c_str());
+            if (0 != ret)
+            {
+                ; // ignore, file may not exist
+            }
         }
     };
 


More information about the Liblas-commits mailing list