Fix failing test due to inconsistent strcmp results
* testsuite/27_io/filesystem/path/compare/strings.cc: Only compare sign of results. From-SVN: r268238
This commit is contained in:
parent
738c56d410
commit
400a08e284
|
@ -1,3 +1,8 @@
|
||||||
|
2019-01-24 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* testsuite/27_io/filesystem/path/compare/strings.cc: Only compare
|
||||||
|
sign of results.
|
||||||
|
|
||||||
2019-01-22 Jonathan Wakely <jwakely@redhat.com>
|
2019-01-22 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/88740
|
PR libstdc++/88740
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
using std::filesystem::path;
|
using std::filesystem::path;
|
||||||
|
|
||||||
|
int sign(int i) { return i > 0 ? 1 : i < 0 ? -1 : 0; }
|
||||||
|
|
||||||
void
|
void
|
||||||
test01()
|
test01()
|
||||||
{
|
{
|
||||||
|
@ -36,8 +38,8 @@ test01()
|
||||||
path p(s);
|
path p(s);
|
||||||
VERIFY( p.compare(s) == 0 );
|
VERIFY( p.compare(s) == 0 );
|
||||||
VERIFY( p.compare(s.c_str()) == 0 );
|
VERIFY( p.compare(s.c_str()) == 0 );
|
||||||
VERIFY( p.compare(p0) == p.compare(s0) );
|
VERIFY( sign(p.compare(p0)) == sign(p.compare(s0)) );
|
||||||
VERIFY( p.compare(p0) == p.compare(s0.c_str()) );
|
VERIFY( sign(p.compare(p0)) == sign(p.compare(s0.c_str())) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue