From bd3ddc608a35a57cabd6efb8a9d9bc20ded1cb52 Mon Sep 17 00:00:00 2001 From: Claybird Date: Mon, 4 Nov 2019 16:21:01 +0900 Subject: [PATCH] Fixed test case to support NFD normalization --- .../test/test_read_format_lha_filename_utf16.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libarchive/test/test_read_format_lha_filename_utf16.c b/libarchive/test/test_read_format_lha_filename_utf16.c index b2729fb13..2aa02434c 100644 --- a/libarchive/test/test_read_format_lha_filename_utf16.c +++ b/libarchive/test/test_read_format_lha_filename_utf16.c @@ -63,15 +63,30 @@ test_read_format_lha_filename_UTF16_UTF8(const char *refname) /* Verify regular file. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); +#if defined(__APPLE__) + /* NFD normalization */ + assertEqualString("U\xCC\x88O\xCC\x88A\xCC\x88u\xCC\x88o\xCC\x88a\xCC\x88/" + "a\xCC\x88o\xCC\x88u\xCC\x88A\xCC\x88O\xCC\x88U\xCC\x88.txt", + archive_entry_pathname(ae)); +#else + /* NFC normalization */ assertEqualString("\xc3\x9c\xc3\x96\xc3\x84\xc3\xbc\xc3\xb6\xc3\xa4/" "\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c.txt", archive_entry_pathname(ae)); +#endif assertEqualInt(12, archive_entry_size(ae)); /* Verify directory. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); +#if defined(__APPLE__) + /* NFD normalization */ + assertEqualString("U\xCC\x88O\xCC\x88A\xCC\x88u\xCC\x88o\xCC\x88a\xCC\x88/", + archive_entry_pathname(ae)); +#else + /* NFC normalization */ assertEqualString("\xc3\x9c\xc3\x96\xc3\x84\xc3\xbc\xc3\xb6\xc3\xa4/", archive_entry_pathname(ae)); +#endif assertEqualInt(0, archive_entry_size(ae)); /* End of archive. */ -- 2.47.2