Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-03-17 13:40:25 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-03-17 13:40:25 +0300
commit154876409ea7a87e2c4af08418954f8d884c67fe (patch)
treed32f7e752f076f86988e710e25f115082a2079d2 /test
parentcbd573161b6703febcdc4f26d701066430317d27 (diff)
Workaround path_view test failures on libstdc++.
Mandate at least C++ 17 on Mac OS, in order to find <filesystem>.
Diffstat (limited to 'test')
-rw-r--r--test/tests/path_view.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/test/tests/path_view.cpp b/test/tests/path_view.cpp
index 81f1b5ce..a0488b5e 100644
--- a/test/tests/path_view.cpp
+++ b/test/tests/path_view.cpp
@@ -30,7 +30,15 @@ template <class U> inline void CheckPathView(const LLFIO_V2_NAMESPACE::filesyste
using LLFIO_V2_NAMESPACE::filesystem::path;
auto r1 = c(p);
auto r2 = c(path_view(p));
- BOOST_CHECK(r1 == r2);
+ if(r2.empty() && r1.native().size() == 1 && r1.native()[0] == '.')
+ {
+ // libstdc++ returns "." as the tail component for /a/b/ type paths
+ BOOST_CHECK(true);
+ }
+ else
+ {
+ BOOST_CHECK(r1 == r2);
+ }
// if(r1 != r2)
{
std::cerr << "For " << desc << " with path " << p << "\n";
@@ -60,14 +68,30 @@ static inline void CheckPathIteration(const LLFIO_V2_NAMESPACE::filesystem::path
for(; it1 != test1.end() && it2 != test2.end(); ++it1, ++it2)
{
std::cout << " " << *it1 << " == " << *it2 << "?" << std::endl;
- BOOST_CHECK(*it1 == it2->path());
+ if(it2->empty() && it1->native().size() == 1 && it1->native()[0] == '.')
+ {
+ // libstdc++ returns "." as the tail component for /a/b/ type paths
+ BOOST_CHECK(true);
+ }
+ else
+ {
+ BOOST_CHECK(*it1 == it2->path());
+ }
}
BOOST_CHECK(it1 == test1.end());
BOOST_CHECK(it2 == test2.end());
for(--it1, --it2; it1 != test1.begin() && it2 != test2.begin(); --it1, --it2)
{
std::cout << " " << *it1 << " == " << *it2 << "?" << std::endl;
- BOOST_CHECK(*it1 == it2->path());
+ if(it2->empty() && it1->native().size() == 1 && it1->native()[0] == '.')
+ {
+ // libstdc++ returns "." as the tail component for /a/b/ type paths
+ BOOST_CHECK(true);
+ }
+ else
+ {
+ BOOST_CHECK(*it1 == it2->path());
+ }
}
BOOST_CHECK(it1 == test1.begin());
BOOST_CHECK(it2 == test2.begin());