From patchwork Thu Jul 30 12:40:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 502146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7A461140789 for ; Thu, 30 Jul 2015 22:41:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=PAU7RGSm; dkim-atps=neutral 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:mime-version:content-type; q=dns; s= default; b=lhTpHm610kI8Z5f1bHvfCLWuZAl8q23MPJ737fVAp4BGogE5S1kNn c8QabfRnePpstqABPk7gwMVYqsiZehV4UMGjgZHRpoC954FaRhCCSldLtW1DN6/5 uIo/E96ha4ds524TWCCqbRwO3kLBA6ytQylLERYSs+glKzSOJIcoO0= 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:mime-version:content-type; s= default; bh=FChXRDR4ugdbeDKdbZ4jN6dN+rA=; b=PAU7RGSmdd+nlpaz2irt S6j/O1rHl7ZtKrM5T0QK0v7LBsmWci6xI45o0pUmUNaL+8lRr9x5BhVvzfz8hCID s5qGLRjtgM5BxkJHTbG7/uryXED3WQ7jV3JapNFEZLHhNUR5N1drF80dDKEuXAcY /zfcPQof2KIxSw712iufI7Q= Received: (qmail 97879 invoked by alias); 30 Jul 2015 12:40:53 -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 97857 invoked by uid 89); 30 Jul 2015 12:40:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 30 Jul 2015 12:40:51 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 6385EAB966; Thu, 30 Jul 2015 12:40:50 +0000 (UTC) Received: from localhost (ovpn-116-56.ams2.redhat.com [10.36.116.56]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6UCemSf030929; Thu, 30 Jul 2015 08:40:49 -0400 Date: Thu, 30 Jul 2015 13:40:48 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [v3 patch] Fix FAIL in experimental/filesystem/operations/current_path.cc Message-ID: <20150730124048.GN13355@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) This test is failing on Darwin, it turns out to be because TMPDIR is set to a symlink, so after changing to that directory current_path() returns a different path. We should canonicalize the paths before comparing them. Tested x86_64-linux, committed to trunk. commit 4948553fcf04e6d3255d6c440bfc82aac71cfbe3 Author: Jonathan Wakely Date: Thu Jul 30 13:32:15 2015 +0100 * testsuite/experimental/filesystem/operations/current_path.cc: Use canonical paths for comparisons. diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc index 325a5a8..c242ac0 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc @@ -42,11 +42,11 @@ test02() auto oldwd = fs::current_path(); auto tmpdir = fs::temp_directory_path(); current_path(tmpdir); - VERIFY( fs::current_path() == tmpdir ); + VERIFY( canonical(fs::current_path()) == canonical(tmpdir) ); std::error_code ec; current_path(oldwd, ec); - VERIFY( fs::current_path() == oldwd ); - VERIFY( fs::current_path(ec) == oldwd ); + VERIFY( canonical(fs::current_path()) == canonical(oldwd) ); + VERIFY( canonical(fs::current_path(ec)) == canonical(oldwd) ); } int