From 0425b8b7f02ac170abdeb653bc416e2071448d15 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Nov 2017 17:18:58 +0100 Subject: [PATCH] Properly terminate UTF-16 strings in cMB2WC() unit test Such strings must have 2 NUL bytes at the end, just the one added implicitly to all C strings isn't enough. --- tests/mbconv/mbconvtest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/mbconv/mbconvtest.cpp b/tests/mbconv/mbconvtest.cpp index 0b2b1507c6..5a0afa4e5b 100644 --- a/tests/mbconv/mbconvtest.cpp +++ b/tests/mbconv/mbconvtest.cpp @@ -1484,8 +1484,8 @@ TEST_CASE("wxMBConv::cMB2WC", "[mbconv][mb2wc]") CHECK( convUTF16.cMB2WC("\0").length() == 0 ); CHECK( convUTF16.cMB2WC(wxCharBuffer()).length() == 0 ); - CHECK( convUTF16.cMB2WC("H\0i\0").length() == 2 ); - CHECK( convUTF16.cMB2WC(wxCharBuffer::CreateNonOwned("H\0i\0", 4)).length() == 2 ); + CHECK( convUTF16.cMB2WC("H\0i\0\0").length() == 2 ); + CHECK( convUTF16.cMB2WC(wxCharBuffer::CreateNonOwned("H\0i\0\0", 4)).length() == 2 ); CHECK( wxConvUTF7.cMB2WC("").length() == 0 ); CHECK( wxConvUTF7.cMB2WC(wxCharBuffer()).length() == 0 );