From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 19:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9AE3290F33822BEEF42D8FD9" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00918.txt.bz2 This is a multi-part message in MIME format. --------------9AE3290F33822BEEF42D8FD9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 810 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. --------------9AE3290F33822BEEF42D8FD9 Content-Type: text/x-patch; name="p1423r3-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="p1423r3-3.patch" Content-length: 2259 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 --------------9AE3290F33822BEEF42D8FD9--