commit 84fc5b9d432788414e75df1f62bf8645db57f395 Author: Jonathan Wakely Date: Thu Jan 24 12:53:45 2019 +0000 Fix failing test due to inconsistent strcmp results * testsuite/27_io/filesystem/path/compare/strings.cc: Only compare sign of results. diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc index 3f0aa4bde06..83487ae35b6 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc @@ -26,6 +26,8 @@ using std::filesystem::path; +int sign(int i) { return i > 0 ? 1 : i < 0 ? -1 : 0; } + void test01() { @@ -36,8 +38,8 @@ test01() path p(s); VERIFY( p.compare(s) == 0 ); VERIFY( p.compare(s.c_str()) == 0 ); - VERIFY( p.compare(p0) == p.compare(s0) ); - VERIFY( p.compare(p0) == p.compare(s0.c_str()) ); + VERIFY( sign(p.compare(p0)) == sign(p.compare(s0)) ); + VERIFY( sign(p.compare(p0)) == sign(p.compare(s0.c_str())) ); } }