From 61ef82ec2b2ca396667f92a4e5c6ceb729c42086 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 15 May 2016 17:11:27 +0300 Subject: Port to MinGW --- tests/path/driver.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/path') diff --git a/tests/path/driver.cxx b/tests/path/driver.cxx index 4df2a05..de8e8b1 100644 --- a/tests/path/driver.cxx +++ b/tests/path/driver.cxx @@ -15,11 +15,20 @@ using namespace butl; int main () { + // Make sure we have nothrow destructor and move constructor so that + // storage in containers is not pessimized. + // static_assert (is_nothrow_destructible::value, ""); - static_assert (is_nothrow_move_constructible::value, ""); - static_assert (is_nothrow_destructible::value, ""); + + // MINGW GCC 4.9 std::string is not nothrow-move-constructible, so path and + // dir_path (which have a member of std::string type) are not as such as + // well. + // +#if !defined(_WIN32) || !defined(__GNUC__) || __GNUC__ > 4 + static_assert (is_nothrow_move_constructible::value, ""); static_assert (is_nothrow_move_constructible::value, ""); +#endif assert (path ("/").string () == "/"); assert (path ("//").string () == "/"); @@ -174,7 +183,11 @@ main () assert (path (p.begin (), p.end ()) == p); assert (path (++p.begin (), p.end ()) == path ("foo/bar")); assert (path (++(++p.begin ()), p.end ()) == path ("bar")); + +#ifndef _WIN32 assert (path (p.begin (), ++p.begin ()) == path ("/")); +#endif + assert (path (++p.begin (), ++(++p.begin ())) == path ("foo")); assert (path (++(++p.begin ()), ++(++(++p.begin ()))) == path ("bar")); } -- cgit v1.1