mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Ensure we are testing the internal 16bit unicode representation class.
This commit is contained in:
parent
ab60bab84a
commit
1066ec7015
3 changed files with 74 additions and 25 deletions
|
@ -719,6 +719,26 @@ newUInline(unsigned length, NSZone *zone)
|
|||
return me;
|
||||
}
|
||||
|
||||
@implementation NSString (RegressionTesting)
|
||||
/* This method is provided to enable regression tests to ensure they are
|
||||
* using an object whose internal representation is wide (unicode) text,
|
||||
* so that all the comparison operations between 8bit and 16bit strings
|
||||
* can be tested.
|
||||
*/
|
||||
- (NSString*) _unicodeString
|
||||
{
|
||||
GSUInlineString *o;
|
||||
unsigned i = [self length];
|
||||
|
||||
o = [newUInline(i, [self zone]) autorelease];
|
||||
while (i-- > 0)
|
||||
{
|
||||
o->_contents.u[i] = [self characterAtIndex: i];
|
||||
}
|
||||
return o;
|
||||
}
|
||||
@end
|
||||
|
||||
/* Predeclare a few functions
|
||||
*/
|
||||
static void GSStrWiden(GSStr s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue