aboutsummaryrefslogtreecommitdiff
path: root/tests/path/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/path/driver.cxx')
-rw-r--r--tests/path/driver.cxx17
1 files changed, 15 insertions, 2 deletions
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<path>::value, "");
- static_assert (is_nothrow_move_constructible<path>::value, "");
-
static_assert (is_nothrow_destructible<dir_path>::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<path>::value, "");
static_assert (is_nothrow_move_constructible<dir_path>::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"));
}