From 6e1f680ec5285426fcaef70e5a0277649aee03b8 Mon Sep 17 00:00:00 2001 From: roker Date: Tue, 6 Jul 2021 16:34:05 +0200 Subject: [PATCH] use string_view in unittest_nfc. That avoids copying and makes compiler happy, too! --- test/unittest_nfc.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unittest_nfc.cc b/test/unittest_nfc.cc index ce8c0ed..ee1927a 100644 --- a/test/unittest_nfc.cc +++ b/test/unittest_nfc.cc @@ -9,10 +9,10 @@ namespace { struct TestEntry { - std::string input; + string_view input; bool is_nfc; IsNFC quick; - std::string nfc; + string_view nfc; }; typedef TestEntry TE; @@ -46,8 +46,8 @@ const std::vector testValues = { "a\xcc\x85\xcc\xbc", false, IsNFC::No , "a\xcc\xbc\xcc\x85"}, // a + + (overline + seagull_below) { "a\xcc\xbc\xcc\x85", true, IsNFC::Yes , "a\xcc\xbc\xcc\x85"}, // a + + (seagull_below + overline) - { std::string(nullo, nullo+1), true, IsNFC::Yes, std::string(nullo, nullo+1) }, // Yeah, 1 NUL byte - { std::string(nullo, nullo+4), true, IsNFC::Yes, std::string(nullo, nullo+4) }, // Yeah, 4 NUL bytes + { string_view(nullo, 1), true, IsNFC::Yes, string_view(nullo, 1) }, // Yeah, 1 NUL byte + { string_view(nullo, 4), true, IsNFC::Yes, string_view(nullo, 4) }, // Yeah, 4 NUL bytes { "EOF", true, IsNFC::Yes, "EOF" } };