lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5110] Don't assume /tmp exists


From: Greg Chicares
Subject: [lmi-commits] [5110] Don't assume /tmp exists
Date: Fri, 24 Sep 2010 16:39:40 +0000

Revision: 5110
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5110
Author:   chicares
Date:     2010-09-24 16:39:39 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Don't assume /tmp exists

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/Makefile.am
    lmi/trunk/authenticity_test.cpp
    lmi/trunk/name_value_pairs_test.cpp
    lmi/trunk/objects.make
    lmi/trunk/path_utility_test.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/ChangeLog 2010-09-24 16:39:39 UTC (rev 5110)
@@ -26821,3 +26821,12 @@
 Check execute permission. This would detect the defects removed
 20100225T1616Z, 20100316T0205Z, and 20100719T1357Z.
 
+20100924T1639Z <address@hidden> [656]
+
+  Makefile.am
+  authenticity_test.cpp
+  name_value_pairs_test.cpp
+  objects.make
+  path_utility_test.cpp
+Don't assume /tmp exists.
+

Modified: lmi/trunk/Makefile.am
===================================================================
--- lmi/trunk/Makefile.am       2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/Makefile.am       2010-09-24 16:39:39 UTC (rev 5110)
@@ -724,6 +724,8 @@
   name_value_pairs.cpp \
   name_value_pairs_test.cpp
 test_name_value_pairs_CXXFLAGS = $(AM_CXXFLAGS)
+test_name_value_pairs_LDADD = \
+  $(BOOST_LIBS)
 
 test_ncnnnpnn_SOURCES = \
   $(common_test_objects) \

Modified: lmi/trunk/authenticity_test.cpp
===================================================================
--- lmi/trunk/authenticity_test.cpp     2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/authenticity_test.cpp     2010-09-24 16:39:39 UTC (rev 5110)
@@ -37,6 +37,7 @@
 
 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
 
 #include <cstddef> // std::size_t
 #include <cstdio>
@@ -274,20 +275,21 @@
 /// Authenticate also from the root directory on a different drive, on
 /// a multiple-root system. This is perforce platform specific; msw is
 /// used because it happens to be common. This test assumes that an
-/// 'E:' drive exists and is not the "current" drive.
+/// 'F:' drive exists and is not the "current" drive.
 ///
 /// BOOST !! This test traps an exception that boost-1.33.1 can throw
-/// if exists("E:/") returns true but ::GetFileAttributesA() fails.
+/// if exists("F:/") returns true but ::GetFileAttributesA() fails.
 /// That's supposed to be impossible because the is_directory()
 /// documentation says:
 ///   "Throws: if !exists(ph)"
-/// but it can be reproduced by placing an unformatted disk in "E:".
+/// but it can be reproduced by placing an unformatted disk in "F:".
 
 void PasskeyTest::TestFromAfar() const
 {
     CheckNominal(__FILE__, __LINE__);
 
     fs::path const remote_dir_0(fs::complete("/tmp"));
+    fs::create_directory(remote_dir_0);
     BOOST_TEST(fs::exists(remote_dir_0) && fs::is_directory(remote_dir_0));
     BOOST_TEST_EQUAL(0, chdir(remote_dir_0.string().c_str()));
     BOOST_TEST_EQUAL(remote_dir_0.string(), fs::current_path().string());
@@ -300,7 +302,7 @@
 #if defined LMI_MSW
     CheckNominal(__FILE__, __LINE__);
 
-    fs::path const remote_dir_1(fs::complete(fs::path("E:/", fs::native)));
+    fs::path const remote_dir_1(fs::complete(fs::path("F:/", fs::native)));
     BOOST_TEST(fs::exists(remote_dir_1));
     try
         {

Modified: lmi/trunk/name_value_pairs_test.cpp
===================================================================
--- lmi/trunk/name_value_pairs_test.cpp 2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/name_value_pairs_test.cpp 2010-09-24 16:39:39 UTC (rev 5110)
@@ -31,11 +31,17 @@
 #include "miscellany.hpp"
 #include "test_tools.hpp"
 
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+
 #include <cstdio> // std::remove()
 #include <fstream>
 
 int test_main(int, char*[])
 {
+    fs::path const tmpdir(fs::complete("/tmp"));
+    fs::create_directory(tmpdir);
+
     std::string filename0("/tmp/eraseme");
 
     {

Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make      2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/objects.make      2010-09-24 16:39:39 UTC (rev 5110)
@@ -760,6 +760,7 @@
   mpatrol_patch_test.o \
 
 name_value_pairs_test$(EXEEXT): \
+  $(boost_filesystem_objects) \
   $(common_test_objects) \
   facets.o \
   name_value_pairs.o \

Modified: lmi/trunk/path_utility_test.cpp
===================================================================
--- lmi/trunk/path_utility_test.cpp     2010-09-23 23:32:13 UTC (rev 5109)
+++ lmi/trunk/path_utility_test.cpp     2010-09-24 16:39:39 UTC (rev 5110)
@@ -34,6 +34,8 @@
 
 #include <boost/filesystem/exception.hpp>
 #include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
 
 #include <cstdio> // std::remove()
 #include <fstream>
@@ -139,15 +141,15 @@
 
 void test_unique_filepath_with_normal_filenames()
 {
+    fs::path const tmpdir(fs::complete("/tmp"));
+    fs::create_directory(tmpdir);
+
     // These tests would fail if read-only files with the following
     // names already exist.
 
     char const* p = "/tmp/eraseme.0";
     char const* q = "/tmp/eraseme.xyzzy";
 
-    // Assume directory /tmp/ exists: the makefile provided ensures
-    // that, even on platforms that don't always provide it.
-
     // Don't test the return codes here. These files probably don't
     // exist, in which case C99 7.19.4.1 doesn't clearly prescribe
     // the semantics of std::remove().




reply via email to

[Prev in Thread] Current Thread [Next in Thread]