mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Rewrite Zh-TW language test to use UTF-8 strings, dropping overrides
This commit is contained in:
@@ -20,7 +20,7 @@ class LanguagePackTest : public testing::Test
|
||||
{
|
||||
protected:
|
||||
static const utf8* LanguageEnGB;
|
||||
static const unsigned char LanguageZhTW[];
|
||||
static const utf8* LanguageZhTW;
|
||||
};
|
||||
|
||||
TEST_F(LanguagePackTest, create_empty)
|
||||
@@ -53,7 +53,7 @@ TEST_F(LanguagePackTest, language_pack_simple)
|
||||
|
||||
TEST_F(LanguagePackTest, language_pack_multibyte)
|
||||
{
|
||||
auto lang = LanguagePackFactory::FromText(0, reinterpret_cast<const utf8*>(LanguageZhTW));
|
||||
auto lang = LanguagePackFactory::FromText(0, LanguageZhTW);
|
||||
ASSERT_EQ(lang->GetId(), 0);
|
||||
ASSERT_EQ(lang->GetCount(), 4u);
|
||||
ASSERT_STREQ(lang->GetString(2), u8"懸吊式雲霄飛車");
|
||||
@@ -69,31 +69,7 @@ const utf8* LanguagePackTest::LanguageEnGB = "# STR_XXXX part is read and XXXX b
|
||||
"STR_0003 :Stand-up Roller Coaster\n";
|
||||
|
||||
// This includes a few entries extracted from zh-TW localisation.
|
||||
// It has to be declared as `unsigned char`, or else the values overflow signed byte.
|
||||
const unsigned char LanguagePackTest::LanguageZhTW[] = {
|
||||
0x53, 0x54, 0x52, 0x5f, 0x30, 0x30, 0x30, 0x30, 0x20, 0x20, 0x20, 0x20, 0x3a, 0xe8, 0x9e, 0xba, 0xe6, 0x97, 0x8b, 0xe5,
|
||||
0xbc, 0x8f, 0xe9, 0x9b, 0xb2, 0xe9, 0x9c, 0x84, 0xe9, 0xa3, 0x9b, 0xe8, 0xbb, 0x8a, 0x0a, 0x53, 0x54, 0x52, 0x5f, 0x30,
|
||||
0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, 0x3a, 0xe7, 0xab, 0x99, 0xe7, 0xab, 0x8b, 0xe5, 0xbc, 0x8f, 0xe9, 0x9b, 0xb2,
|
||||
0xe9, 0x9c, 0x84, 0xe9, 0xa3, 0x9b, 0xe8, 0xbb, 0x8a, 0x0a, 0x53, 0x54, 0x52, 0x5f, 0x30, 0x30, 0x30, 0x32, 0x20, 0x20,
|
||||
0x20, 0x20, 0x3a, 0xe6, 0x87, 0xb8, 0xe5, 0x90, 0x8a, 0xe5, 0xbc, 0x8f, 0xe9, 0x9b, 0xb2, 0xe9, 0x9c, 0x84, 0xe9, 0xa3,
|
||||
0x9b, 0xe8, 0xbb, 0x8a, 0x0a, 0x53, 0x54, 0x52, 0x5f, 0x30, 0x30, 0x30, 0x33, 0x20, 0x20, 0x20, 0x20, 0x3a, 0xe5, 0x8f,
|
||||
0x8d, 0xe8, 0xbd, 0x89, 0xe5, 0xbc, 0x8f, 0xe9, 0x9b, 0xb2, 0xe9, 0x9c, 0x84, 0xe9, 0xa3, 0x9b, 0xe8, 0xbb, 0x8a, 0x0a,
|
||||
0x3c, 0x46, 0x6f, 0x72, 0x65, 0x73, 0x74, 0x20, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x73, 0x3e, 0x0a, 0x53,
|
||||
0x54, 0x52, 0x5f, 0x53, 0x43, 0x4e, 0x52, 0x20, 0x20, 0x20, 0x20, 0x3a, 0x46, 0x6f, 0x72, 0x65, 0x73, 0x74, 0x20, 0x46,
|
||||
0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x73, 0x0a, 0x53, 0x54, 0x52, 0x5f, 0x50, 0x41, 0x52, 0x4b, 0x20, 0x20, 0x20,
|
||||
0x20, 0x3a, 0x46, 0x6f, 0x72, 0x65, 0x73, 0x74, 0x20, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x73, 0x0a, 0x53,
|
||||
0x54, 0x52, 0x5f, 0x44, 0x54, 0x4c, 0x53, 0x20, 0x20, 0x20, 0x20, 0x3a, 0xe5, 0x9c, 0xa8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, 0x2c, 0x20, 0xe5, 0xb0, 0x87, 0xe6, 0x9c, 0x83, 0xe6, 0x96, 0xbc, 0xe9,
|
||||
0xa3, 0x9b, 0xe9, 0xa6, 0xb3, 0xe4, 0xb8, 0xad, 0xe9, 0xab, 0x94, 0xe9, 0xa9, 0x97, 0xe9, 0xa3, 0x9b, 0xe4, 0xb8, 0x80,
|
||||
0xe8, 0x88, 0xac, 0xe7, 0x9a, 0x84, 0xe5, 0xbf, 0xab, 0xe6, 0x84, 0x9f, 0x0a, 0x53, 0x54, 0x52, 0x5f, 0x43, 0x50, 0x54,
|
||||
0x59, 0x20, 0x20, 0x20, 0x20, 0x3a, 0xe6, 0xaf, 0x8f, 0xe8, 0xbb, 0x8a, 0xe5, 0x8d, 0xa1, 0x34, 0xe4, 0xbd, 0x8d, 0xe4,
|
||||
0xb9, 0x98, 0xe5, 0xae, 0xa2, 0x0a, 0x00,
|
||||
};
|
||||
const utf8* LanguagePackTest::LanguageZhTW = u8"STR_0000 :螺旋式雲霄飛車\n"
|
||||
u8"STR_0001 :站立式雲霄飛車\n"
|
||||
u8"STR_0002 :懸吊式雲霄飛車\n"
|
||||
u8"STR_0003 :反轉式雲霄飛車\n";
|
||||
|
||||
Reference in New Issue
Block a user