]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add a unicode filename sample for test_read_format_rar for issue 247.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Mar 2012 07:55:47 +0000 (16:55 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Mar 2012 07:55:47 +0000 (16:55 +0900)
libarchive/test/test_read_format_rar.c
libarchive/test/test_read_format_rar_unicode.rar.uu

index 8a73a78e5a09bc860c7020c5534d69b05016ba2c..a7c61f9c3ec1d2398c4812b2163d6cef40ebfccb 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2003-2007 Tim Kientzle
  * Copyright (c) 2011 Andres Mejia
+ * Copyright (c) 2011-2012 Michihiro NAKAJIMA
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -278,9 +279,19 @@ test_unicode_UTF8(void)
   assertEqualInt(41453, archive_entry_mode(ae));
   assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff)));
 
+  /* Sixth header */
+  assertA(0 == archive_read_next_header(a, &ae));
+  assertEqualUTF8String(
+    "abcdefghijklmnopqrs\xE3\x83\x86\xE3\x82\xB9\xE3\x83\x88.txt",
+    archive_entry_pathname(ae));
+  assertA((int)archive_entry_mtime(ae));
+  assertEqualInt(16, archive_entry_size(ae));
+  assertEqualInt(33204, archive_entry_mode(ae));
+  assertEqualIntA(a, 16, archive_read_data(a, buff, sizeof(buff)));
+
   /* Test EOF */
   assertA(1 == archive_read_next_header(a, &ae));
-  assertEqualInt(5, archive_file_count(a));
+  assertEqualInt(6, archive_file_count(a));
   assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
   assertEqualInt(ARCHIVE_OK, archive_read_free(a));
 }
@@ -364,9 +375,19 @@ test_unicode_CP932(void)
   assertEqualInt(41453, archive_entry_mode(ae));
   assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff)));
 
+  /* Sixth header */
+  assertA(0 == archive_read_next_header(a, &ae));
+  assertEqualUTF8String(
+    "abcdefghijklmnopqrs\x83\x65\x83\x58\x83\x67.txt",
+    archive_entry_pathname(ae));
+  assertA((int)archive_entry_mtime(ae));
+  assertEqualInt(16, archive_entry_size(ae));
+  assertEqualInt(33204, archive_entry_mode(ae));
+  assertEqualIntA(a, 16, archive_read_data(a, buff, sizeof(buff)));
+
   /* Test EOF */
   assertA(1 == archive_read_next_header(a, &ae));
-  assertEqualInt(5, archive_file_count(a));
+  assertEqualInt(6, archive_file_count(a));
   assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
   assertEqualInt(ARCHIVE_OK, archive_read_free(a));
 }
index cfe6e40d51f3ca56371fb8996eb3f05c1d9b4e58..8469e995bc381f1e2532594ad6d555382f32277f 100644 (file)
@@ -11,7 +11,8 @@ M5H*U@J*#=(-(@XN#7P"(:&A@,(@P7*JP95<P1##5,*BI,.LPP#``\"8YA&UX
 M=."2,P````````````(`````#VGA/A0P#@`0````E5R"OH+F`(AH:&`PB#``
 M\.H)?ED.="""2``V````-@````,E@OM=6%0+/Q0P*`#MH0``Z*&HXX&@XX*(
 M7..#E>."H>."I..#JP"(:&A@,(@P7*K5,*$PI##K,.:\HN6ME^F5M^.!A..#
-ME>."H>."I..#J^60C6QO;F<M9FEL96YA;64M:6XMYKRBY:V7+G1X=,0]>P!`
-"!P``
+ME>."H>."I..#J^60C6QO;F<M9FEL96YA;64M:6XMYKRBY:V7+G1X=)MJ=""`
+M0``/````$`````,%T+85W81G0!TS(`"T@0``86)C9&5F9VAI:FML;6YO<'%R
+D<^.#AN."N>.#B"YT>'0`D/\0?^2Y_">#,#TN'-+$/7L`0`<`
 `
 end