Author: thebeing
Date: Tue Oct 11 14:35:29 2016
New Revision: 40140

URL: http://svn.gna.org/viewcvs/gnustep?rev=40140&view=rev
Log:
Fix testcase for 0xfffe in a string (in initial position it
it is just used to derive the byte-order and then discarded)

Modified:
    libs/base/trunk/Tests/base/NSString/noncharacter.m

Modified: libs/base/trunk/Tests/base/NSString/noncharacter.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tests/base/NSString/noncharacter.m?rev=40140&r1=40139&r2=40140&view=diff
==============================================================================
--- libs/base/trunk/Tests/base/NSString/noncharacter.m  (original)
+++ libs/base/trunk/Tests/base/NSString/noncharacter.m  Tue Oct 11 14:35:29 2016
@@ -8,7 +8,7 @@
 {
   NSString *str;
   unichar u;
-
+  unichar u2[2];
   u = (unichar)0xfdd0;
   str = [[NSString alloc] initWithCharacters: &u length: 1];
   PASS([str length] == 1, "fdd0 codpepoint is permitted in string");
@@ -26,11 +26,14 @@
   PASS([str length] == 1, "fffd codpepoint is permitted in string");
   PASS([str characterAtIndex: 0] == 0xfffd, "fffd is returned properly");
   [str release];
-
-  u = (unichar)0xfffe;
-  str = [[NSString alloc] initWithCharacters: &u length: 1];
-  PASS([str length] == 1, "fffe codpepoint is permitted in string");
-  PASS([str characterAtIndex: 0] == 0xfffe, "fffe is returned properly");
+  /* eth, so that we don't have the BOM as the first character (it would be
+   * removed) */
+  u2[0] = (unichar)0x00f0;
+  /* BOM as second non-character codepoint should be allowed */
+  u2[1] = (unichar)0xfffe;
+  str = [[NSString alloc] initWithCharacters: u2 length: 2];
+  PASS([str length] == 2, "fffe codpepoint is permitted in string");
+  PASS([str characterAtIndex: 1] == 0xfffe, "fffe is returned properly");
   [str release];
 
   u = (unichar)0xffff;


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to