1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 10:02:27 +01:00

Extend LanguagePack test with negative tests

This commit is contained in:
Michał Janiszewski
2016-12-01 23:28:01 +01:00
parent a2d30ac405
commit 86a336dd3d

View File

@@ -1,4 +1,5 @@
#include "localisation/LanguagePack.h"
#include "localisation/string_ids.h"
#include <gtest/gtest.h>
TEST(LanguagePackTest, create_empty)
@@ -34,6 +35,10 @@ TEST(LanguagePackTest, language_pack_simple)
ASSERT_STREQ(lang->GetString(0x7000), "Arid Heights scenario string");
ASSERT_EQ(lang->GetObjectOverrideStringId("CONDORRD", 0), 0x6000);
ASSERT_STREQ(lang->GetString(0x6000), "my test ride");
// Test some negatives too
ASSERT_EQ(lang->GetString(1000), nullptr);
ASSERT_EQ(lang->GetScenarioOverrideStringId("No such park", 0), STR_NONE);
ASSERT_EQ(lang->GetObjectOverrideStringId(" ", 0), STR_NONE);
delete lang;
}
@@ -98,4 +103,4 @@ const unsigned char LanguageZhTW[] = {
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
};
};