From patchwork Sun Sep 15 19:39:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Honermann X-Patchwork-Id: 1162525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-509027-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=honermann.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="eyiDd6lB"; dkim=pass (1024-bit key; unprotected) header.d=honermann.net header.i=@honermann.net header.b="GNMhTfFU"; dkim-atps=neutral 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 46Wfqp6G5Vz9sN1 for ; Mon, 16 Sep 2019 05:40:54 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=Vh9Ws1RvZ7OFQtBptNoAdtLmva0/2AamwFJgm1Lc+w3bGi5J8kFUB uF7RBK+/MfHU7FEXy3i18cdJ89M9wrAUwuwuAm03ydBNd2nwJsNT/vqNRDTA/v2G mMD0ik996rAyJKTEoOscbArqV0VmhdRWXRYcMRt9I0ao0ZBiyFRW0E= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=KO2Ahw6AGH/Z6uSSU9doVkUS3oM=; b=eyiDd6lBUv5rfsV2/MnK 29hkjih1Z9kn+mtFu+5VXQF7wj89MTyie7h+w8JA0UGVo0lEVExbKqIro+qBDaux P98wOMU27Fw4RKyMCQyVCrtDg4g7TrSXr/UktTUPFRFbkinc+UxrBDa7J1/3qu9z eQeGs3YZ2FMmY/jEq+4W7nc= Received: (qmail 5053 invoked by alias); 15 Sep 2019 19:39:59 -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 4993 invoked by uid 89); 15 Sep 2019 19:39:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=VERIFY, exercise, thereof X-HELO: smtp69.iad3b.emailsrvr.com Received: from smtp69.iad3b.emailsrvr.com (HELO smtp69.iad3b.emailsrvr.com) (146.20.161.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Sep 2019 19:39:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=honermann.net; s=20180930-2j89z3ji; t=1568576395; bh=T2Bl3YPf2RZ2GzWy1Vn/+a6JMER94KyfPkLcKvmuU/g=; h=From:Subject:To:Date:From; b=GNMhTfFUA2ys0+DU61omKgWtCZSft+bsejttlHs/8P8lAYXCPPS4qGcKzSq6Uj1n6 M1q8wAsLVNAeuVAZdJr5m2DmLGCOglfoJKK1A3sUZzS9s1unxjeOy0xcIkK1bUv5qN T8elSv6YTQpK5FmucgwXN3EY93e9dNnP2daPmUTs= X-Auth-ID: tom@honermann.net Received: by smtp9.relay.iad3b.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 14DDF200B8; Sun, 15 Sep 2019 15:39:55 -0400 (EDT) X-Sender-Id: tom@honermann.net Received: from [192.168.1.20] (pool-72-84-244-119.rcmdva.fios.verizon.net [72.84.244.119]) (using TLSv1.2 with cipher AES128-SHA) by 0.0.0.0:25 (trex/5.7.12); Sun, 15 Sep 2019 15:39:55 -0400 From: Tom Honermann Subject: [PATCH 3/4]: C++ P1423R3 char8_t remediation: Updates to existing tests To: "libstdc++@gcc.gnu.org" , gcc-patches Message-ID: Date: Sun, 15 Sep 2019 15:39:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes This patch updates existing tests to validate the new value for the __cpp_lib_char8_t feature test macros and to exercise u8path factory function invocations with std::string, std::string_view, and interator pair arguments. libstdc++-v3/ChangeLog: 2019-09-15 Tom Honermann * libstdc++-v3/testsuite/experimental/feat-char8_t.cc: Updated the expected __cpp_lib_char8_t feature test macro value. * libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc: Added testing of u8path invocation with std::string, std::string_view, and iterators thereof. * libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path.cc: Added testing of u8path invocation with std::string, std::string_view, and iterators thereof. Tom. diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc index aff722b5867..fb337ce1284 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++17 } } #include +#include #include namespace fs = std::filesystem; @@ -34,6 +35,22 @@ test01() p = fs::u8path("\xf0\x9d\x84\x9e"); VERIFY( p.u8string() == u8"\U0001D11E" ); + + std::string s1 = "filename2"; + p = fs::u8path(s1); + VERIFY( p.u8string() == u8"filename2" ); + + std::string s2 = "filename3"; + p = fs::u8path(s2.begin(), s2.end()); + VERIFY( p.u8string() == u8"filename3" ); + + std::string_view sv1{ s1 }; + p = fs::u8path(sv1); + VERIFY( p.u8string() == u8"filename2" ); + + std::string_view sv2{ s2 }; + p = fs::u8path(sv2.begin(), sv2.end()); + VERIFY( p.u8string() == u8"filename3" ); } void diff --git a/libstdc++-v3/testsuite/experimental/feat-char8_t.cc b/libstdc++-v3/testsuite/experimental/feat-char8_t.cc index e843604266c..c9b277a4626 100644 --- a/libstdc++-v3/testsuite/experimental/feat-char8_t.cc +++ b/libstdc++-v3/testsuite/experimental/feat-char8_t.cc @@ -12,6 +12,6 @@ #ifndef __cpp_lib_char8_t # error "__cpp_lib_char8_t" -#elif __cpp_lib_char8_t != 201811L -# error "__cpp_lib_char8_t != 201811L" +#elif __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t != 201907L" #endif diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path.cc index bdeb3946a15..83219b7ddda 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path.cc @@ -35,6 +35,14 @@ test01() p = fs::u8path("\xf0\x9d\x84\x9e"); VERIFY( p.u8string() == u8"\U0001D11E" ); + + std::string s1 = "filename2"; + p = fs::u8path(s1); + VERIFY( p.u8string() == u8"filename2" ); + + std::string s2 = "filename3"; + p = fs::u8path(s2.begin(), s2.end()); + VERIFY( p.u8string() == u8"filename3" ); } void