Fix test for recursive_directory_iterator::pop
authorJonathan Wakely <jwakely@redhat.com>
Wed, 26 Oct 2016 16:25:44 +0000 (17:25 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 26 Oct 2016 16:25:44 +0000 (17:25 +0100)
* testsuite/experimental/filesystem/iterators/pop.cc: Remove
unreliable dependency on directory order.

From-SVN: r241583

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/experimental/filesystem/iterators/pop.cc

index 9b73a08289128d13420e7d4d1528518bdd71c3aa..1c878a2a6f3f80550b0c0383339bc7f391f7b6ea 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-26  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/experimental/filesystem/iterators/pop.cc: Remove
+       unreliable dependency on directory order.
+
 2016-10-26  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
        Implement uniform_inside_sphere_distribution extension.
index fa1ae62bad7fdd960289d45d98253ab0eacfa0ee..d247ab47ddc6ae2ff29695f3b8b3cedfa4d03b5d 100644 (file)
@@ -78,13 +78,11 @@ test03()
   create_directories(p / "d1/d2/d3");
   create_directories(p / "d1/d2/e3");
   create_directories(p / "d1/e2/d3");
-  create_directories(p / "e1");
-  __gnu_test::scoped_file f(p / "d1/d2/d3/f");
-  for (int i = 0; i < 4; ++i)
+  for (int i = 0; i < 3; ++i)
   {
     fs::recursive_directory_iterator dir(p);
     std::advance(dir, i);
-    int expected_depth = std::min(i, 3); // fourth entry is a file, not dir
+    int expected_depth = i;
     VERIFY( dir.depth() == expected_depth );
     __builtin_printf("%d %d %s\n", i, dir.depth(), dir->path().c_str());
     dir.pop(ec);
@@ -102,7 +100,6 @@ test03()
     if (dir != end(dir))
       VERIFY( dir.depth() == (i -1) );
   }
-  f.path.clear();
   remove_all(p, ec);
 }