mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Add _unicodeString method to return GSUnicodeString subclass instance for tests
This commit is contained in:
parent
2f3fcb98e0
commit
c6e4220409
1 changed files with 60 additions and 0 deletions
|
@ -1100,6 +1100,23 @@ tsbytes(uintptr_t s, char *buf)
|
|||
return 8;
|
||||
}
|
||||
|
||||
/* 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
|
||||
|
||||
/**
|
||||
|
@ -3845,6 +3862,23 @@ transmute(GSStr self, NSString *aString)
|
|||
return size;
|
||||
}
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
|
@ -4556,6 +4590,15 @@ agree, create a new GSUInlineString otherwise.
|
|||
}
|
||||
}
|
||||
|
||||
/* 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
|
||||
{
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
@ -6249,6 +6292,23 @@ literalIsEqual(NXConstantString *self, id anObject)
|
|||
return NSUTF8StringEncoding;
|
||||
}
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue