From patchwork Wed Oct 26 15:34:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 79439 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp127714qge; Wed, 26 Oct 2016 08:35:02 -0700 (PDT) X-Received: by 10.98.50.5 with SMTP id y5mr5121999pfy.141.1477496102194; Wed, 26 Oct 2016 08:35:02 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 81si2373283pfq.23.2016.10.26.08.35.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 08:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-439621-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-439621-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-439621-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=BzomlyLvmm/JB9PTAvDYsr/ZGxZ6ei jcwlQdoz4zE8/n6xRLu5U8ZtOznjuhK2BxQX7/anpoPBIvdKDhPP4doC68a2/Uwz 6N8JYfKHGKO7AypVYciVM4d+UrxT41sbONpJsWyEJvZbst5ZXtfLFNBDg76+BA8h y4FN6Cd7X0vD4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=X9ZbjOVR+ICm8JfLvL7jWafgIcs=; b=j80p +5VqV21kO6UoTXJMdSUDV8OfQoI15EbMFL2/WrlP3wYNM5wtMBTA+wCMWi/Ix8mc u7g3QvSLjrtS9x3PokFjaJaNYfLP7mJX5zywk3FJoBn077DKV8hedX7VW95/shc2 hbFYK8J/S/upZr7nTZ1UfFO7zeL6Vfl/mfEP9sk= Received: (qmail 24698 invoked by alias); 26 Oct 2016 15:34:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24677 invoked by uid 89); 26 Oct 2016 15:34:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 15:34:29 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 926BC804E0; Wed, 26 Oct 2016 15:34:28 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QFYRlf031482; Wed, 26 Oct 2016 11:34:28 -0400 Date: Wed, 26 Oct 2016 16:34:27 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Add recursive_directory_iterator::pop(error_code&) Message-ID: <20161026153427.GW2922@redhat.com> References: <20161026151952.GA17427@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161026151952.GA17427@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.0 (2016-08-17) On 26/10/16 16:19 +0100, Jonathan Wakely wrote: >Another Filesystem TS change, implementing LWG 2706. > > * include/experimental/bits/fs_dir.h (recursive_directory_iterator): > Overload pop (LWG 2706). > * src/filesystem/dir.cc (recursive_directory_iterator::pop): Define > new overload. > * testsuite/experimental/filesystem/iterators/pop.cc: New test. > This new test isn't reliable, it depends on directory order. This simplifies it so it behaves reliably. Committed to trunk. commit a16b18039731f450dfb4a8c4fff8db8b8da41817 Author: Jonathan Wakely Date: Wed Oct 26 16:31:19 2016 +0100 Fix test for recursive_directory_iterator::pop * testsuite/experimental/filesystem/iterators/pop.cc: Remove unreliable dependency on directory order. diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/pop.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/pop.cc index fa1ae62..d247ab4 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/iterators/pop.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/pop.cc @@ -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); }