Skip to content

Commit

Permalink
Fix compilation of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Nov 7, 2020
1 parent edc9d6b commit f50bfc5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ add_test(NAME sawyercoding COMMAND test_sawyercoding)
set(LANGUAGEPACK_TEST_SOURCES
"${CMAKE_CURRENT_LIST_DIR}/LanguagePackTest.cpp"
"${ROOT_DIR}/src/openrct2/localisation/LanguagePack.cpp"
"${ROOT_DIR}/src/openrct2/core/FileStream.cpp"
"${ROOT_DIR}/src/openrct2/core/Path.cpp"
"${ROOT_DIR}/src/openrct2/core/RTL.FriBidi.cpp"
"${ROOT_DIR}/src/openrct2/core/RTL.ICU.cpp"
"${ROOT_DIR}/src/openrct2/core/StringBuilder.cpp"
"${ROOT_DIR}/src/openrct2/core/StringReader.cpp"
)
add_executable(test_languagepack ${LANGUAGEPACK_TEST_SOURCES})
if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
Expand All @@ -140,6 +144,8 @@ set(INI_TEST_SOURCES
"${ROOT_DIR}/src/openrct2/config/IniWriter.cpp"
"${ROOT_DIR}/src/openrct2/core/IStream.cpp"
"${ROOT_DIR}/src/openrct2/core/MemoryStream.cpp"
"${ROOT_DIR}/src/openrct2/core/StringBuilder.cpp"
"${ROOT_DIR}/src/openrct2/core/StringReader.cpp"
)
add_executable(test_ini ${INI_TEST_SOURCES})
SET_CHECK_CXX_FLAGS(test_ini)
Expand Down
17 changes: 17 additions & 0 deletions test/tests/LanguagePackTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

#include "openrct2/localisation/LanguagePack.h"

#include "openrct2/core/File.h"
#include "openrct2/localisation/Language.h"
#include "openrct2/localisation/StringIds.h"
#include "openrct2/platform/platform.h"

#include <gtest/gtest.h>

Expand Down Expand Up @@ -124,3 +126,18 @@ const unsigned char LanguagePackTest::LanguageZhTW[] = {
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,
};

bool platform_ensure_directory_exists(const utf8* path)
{
return true;
}

bool platform_directory_exists(const utf8* path)
{
return true;
}

bool File::Exists(const std::string& path)
{
return true;
}

0 comments on commit f50bfc5

Please sign in to comment.