aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-12-09 09:59:00 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-12-09 09:59:00 +0000
commit1d214c3f83521bcf0793f6460ace2bee89f670b8 (patch)
tree72140abf9c92936150993ef4f90a6801b3aedbfd /libstdc++-v3
parent023a3fb4915841a3eb469b71cf642b5763163e14 (diff)
libstdc++: Improve testing for path::operator+=(const string&)
* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases. From-SVN: r279111
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog2
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc19
2 files changed, 21 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 32d539806ad..b9a58dd99b7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,7 @@
2019-12-09 Jonathan Wakely <jwakely@redhat.com>
+ * testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.
+
PR libstdc++/92853
* src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
Do not process a trailing directory separator twice.
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc
index 80ce25ef119..f51707b171c 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc
@@ -113,10 +113,29 @@ test03()
p4 += s;
compare_paths(p4, path(s0+'/'+s));
}
+
+void
+test04()
+{
+ // Concat every test path onto every test path.
+ for (path p : __gnu_test::test_paths)
+ {
+ for (path x : __gnu_test::test_paths)
+ {
+ auto prior_native = p.native();
+ p += x.native();
+ VERIFY( p.native() == prior_native + x.native() );
+ path copy(p);
+ compare_paths( copy, p );
+ }
+ }
+}
+
int
main()
{
test01();
test02();
test03();
+ test04();
}