lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4c0e541 3/3: Resolve another unit-test failur


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4c0e541 3/3: Resolve another unit-test failure; remove temporary directories
Date: Sun, 16 Aug 2020 19:34:52 -0400 (EDT)

branch: master
commit 4c0e5416c87a42c1afe3afd9a5f71ac9506b1480
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Resolve another unit-test failure; remove temporary directories
    
    * name_value_pairs_test.cpp: Removed temporary directory. This resolved
    an observed unit-test failure.
    
    * authenticity_test.cpp: Removed temporary directory. The unit test had
    not failed, because no attempt was made to create a file there, and
    permissions happened to allow cd'ing thither with filesystem::chdir().
    Removed the directory anyway, if only because it's good hygiene.
    
    It would alternatively have been possible to uniquify these temporary
    directories. That's arguably beneficial because it would make failures
    less likely (and the failed test will continue to fail on the server
    until the directory owned by 'nemo' is deleted, e.g.:
      sudo rmdir /srv/chroot/whatever/tmp/name_value_pairs_test
    ). However, uniquification would require adding 'path_utility.o' to
    these tests' link commands (and that would only sidestep the failure,
    because the offending directory owned by 'nemo' can only be removed
    by 'nemo' or by the superuser (or a sudoer)).
---
 authenticity_test.cpp     | 1 +
 name_value_pairs_test.cpp | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/authenticity_test.cpp b/authenticity_test.cpp
index 02dc359..7b442a1 100644
--- a/authenticity_test.cpp
+++ b/authenticity_test.cpp
@@ -294,6 +294,7 @@ void PasskeyTest::TestFromAfar() const
     BOOST_TEST_EQUAL(remote_dir_0.string(), fs::current_path().string());
     BOOST_TEST_EQUAL(0, chdir(Pwd_.string().c_str()));
     BOOST_TEST_EQUAL(Pwd_.string(), fs::current_path().string());
+    fs::remove(remote_dir_0);
 
 #if defined LMI_MSW
     CheckNominal(__FILE__, __LINE__);
diff --git a/name_value_pairs_test.cpp b/name_value_pairs_test.cpp
index f7c23b7..b2b6052 100644
--- a/name_value_pairs_test.cpp
+++ b/name_value_pairs_test.cpp
@@ -106,5 +106,7 @@ int test_main(int, char*[])
     std::map<std::string, std::string> m1 = nv_pairs_1.map();
     BOOST_TEST_EQUAL(0, m1.size());
 
+    fs::remove(tmpdir);
+
     return EXIT_SUCCESS;
 }



reply via email to

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