@ -11,18 +11,7 @@ TEST(PlStringTest,ToUtf16)
plStringBuffer < uint16_t > expected = plStringBuffer < uint16_t > ( text , arrsize ( text ) ) ;
plStringBuffer < uint16_t > expected = plStringBuffer < uint16_t > ( text , arrsize ( text ) ) ;
plStringBuffer < uint16_t > output = plString ( " abcd " ) . ToUtf16 ( ) ;
plStringBuffer < uint16_t > output = plString ( " abcd " ) . ToUtf16 ( ) ;
const uint16_t * c = output . GetData ( ) ;
EXPECT_EQ ( expected . GetSize ( ) , output . GetSize ( ) ) ; //not really a good test
const uint16_t * d = expected . GetData ( ) ;
printf ( " expected size %d output size %d \n " , expected . GetSize ( ) , output . GetSize ( ) ) ;
for ( int i = 0 ; i < expected . GetSize ( ) ; i + + )
{
printf ( " %u %s \n " , c , c ) ;
printf ( " %u %s \n " , d , d ) ;
EXPECT_EQ ( d , c ) ;
c + + ;
d + + ;
}
}
}
TEST ( PlStringTest , ToWchar )
TEST ( PlStringTest , ToWchar )
@ -111,7 +100,7 @@ TEST(PlStringTest,FindLast)
result = input . FindLast ( ' f ' , plString : : kCaseInsensitive ) ;
result = input . FindLast ( ' f ' , plString : : kCaseInsensitive ) ;
EXPECT_EQ ( - 1 , result ) ;
EXPECT_EQ ( - 1 , result ) ;
plString input1 = plString ( " éeÉß " ) ;
plString input1 = plString ( " éeÉß " ) ;
//available accented char, case sensitive
//available accented char, case sensitive
result = input1 . FindLast ( ' e ' , plString : : kCaseSensitive ) ;
result = input1 . FindLast ( ' e ' , plString : : kCaseSensitive ) ;
EXPECT_EQ ( 2 , result ) ;
EXPECT_EQ ( 2 , result ) ;