[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bc805ad 28/33: Augment path-validation unit t
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bc805ad 28/33: Augment path-validation unit test |
Date: |
Mon, 3 May 2021 08:15:55 -0400 (EDT) |
branch: master
commit bc805aded6abecb10ce3afdfdc33cf4872d3c565
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Augment path-validation unit test
---
path_utility_test.cpp | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index d600460..dcf0be6 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -428,6 +428,34 @@ void test_path_validation()
,"Unit test file '<|>' not found."
);
+ // Posix doesn't forbid filenames with more than two consecutive
+ // dots; msw-nt forbids them; and, worse, msw-95 allows them and
+ // defines them to mean the {grandparent, great grandparent, ...}
+ // of a directory.
+ //
+ // This conditional block of tests is pointless today, but if
+ // semantic validity in the OS context is to be enforced by lmi's
+ // 'validate_' functions, they will become valuable.
+#if defined LMI_POSIX
+ LMI_TEST_THROW
+ (validate_filepath("...", context)
+ ,std::runtime_error
+ ,"Unit test file '...' not found."
+ );
+#elif defined LMI_MSW
+ if(!running_under_wine())
+ {
+ // At least some versions of 'wine' don't throw here.
+ LMI_TEST_THROW
+ (validate_directory("...", context)
+ ,std::runtime_error
+ ,"Unit test file '...' not found."
+ );
+ }
+#else // Unknown platform.
+ throw "Unrecognized platform."
+#endif // Unknown platform.
+
// Not empty.
LMI_TEST_THROW
(validate_filepath("", context)
- [lmi-commits] [lmi] master fdc0f5a 07/33: Deboostify even more, (continued)
- [lmi-commits] [lmi] master fdc0f5a 07/33: Deboostify even more, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master 41274a8 14/33: Improve documentation, Greg Chicares, 2021/05/03
- [lmi-commits] [lmi] master e4d2f31 08/33: Rename a function, Greg Chicares, 2021/05/03
- [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 <=
- [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, 2021/05/03
- [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