[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bfa1255 27/33: Enable some tests that were co
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bfa1255 27/33: Enable some tests that were conditionally suppressed |
Date: |
Mon, 3 May 2021 08:15:55 -0400 (EDT) |
branch: master
commit bfa1255c94824a082a1221a798c15b0ae63434f1
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Enable some tests that were conditionally suppressed
Whether these tests should be retained is a separate question.
But performing one on msw only, when it performs in exactly the
same way on posix, was inconsistent.
---
path_utility.cpp | 3 +++
path_utility_test.cpp | 21 ++++++++++-----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/path_utility.cpp b/path_utility.cpp
index 9232cbb..f67d19a 100644
--- a/path_utility.cpp
+++ b/path_utility.cpp
@@ -347,6 +347,9 @@ void validate_path
{
fs::path const path{a_path};
+ // BOOST !! This is where well-formedness with respect to OS rules
+ // ought to be tested.
+
if(path.empty())
{
alarum() << context << " must not be empty." << LMI_FLUSH;
diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index 52a3b3b..d600460 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -406,28 +406,27 @@ void test_path_validation()
validate_filepath("path_utility_test_file", context);
validate_filepath("./path_utility_test_file", context);
- // Not well formed.
-#if 0
- // Neither posix nor msw allows NUL in paths. However, the boost
- // filesystem library doesn't throw an explicit exception here;
- // instead, it aborts with:
- // "Assertion `src.size() == std::strlen( src.c_str() )' failed."
- // Perhaps std::filesystem will trap this and throw an exception.
+ // BOOST !! With boost::filesystem, a path was not well-formed
+ // if it contained forbidden characters. With std::filesystem,
+ // semantic validity is not considered, and any syntactically
+ // valid path is well formed. Therefore, shouldn't the lmi
+ // 'validate_*' functions test semantic validity? If not, the
+ // next two tests are senseless.
+
+ // Neither posix nor msw allows NUL in paths.
std::string nulls = {'\0', '\0'};
LMI_TEST_THROW
(validate_filepath(nulls, context)
,std::runtime_error
- ,lmi_test::what_regex("invalid name \"<|>\" in path")
+ ,"Unit test file '' not found."
);
-#endif // 0
-#if defined LMI_MSW
+ // Posix doesn't forbid these characters, though msw does.
LMI_TEST_THROW
(validate_filepath("<|>", context)
,std::runtime_error
,"Unit test file '<|>' not found."
);
-#endif // defined LMI_MSW
// Not empty.
LMI_TEST_THROW
- [lmi-commits] [lmi] master 2038991 15/33: Improve concinnity, (continued)
- [lmi-commits] [lmi] master 2038991 15/33: Improve concinnity, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 9235f33 16/33: Avoid implicit conversion to fs::path, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 4ab2c4e 20/33: Further improve modify_directory() documentation, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master b64436f 19/33: Improve modify_directory() documentation and tests, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 0e3d61a 21/33: Rework modify_directory() documentation; augment unit test, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 40096c3 24/33: Conserve 70-character comment width, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 4473403 29/33: Improve output spacing, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master bc805ad 28/33: Augment path-validation unit test, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 6fd9f69 32/33: Remove the last occurrence of /name.check/, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 0c2d6b4 30/33: Revert "Revert "Trap exceptions from filesystem library"", Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master bfa1255 27/33: Enable some tests that were conditionally suppressed,
Greg Chicares <=
- [lmi-commits] [lmi] master 8538df8 31/33: Improve unit tests and their documentation, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 6ddb0fa 25/33: Rework a 'wine' workaround again, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 0296ac4 33/33: Deboostify still more, Greg Chicares, 2021/05/03