From fdcbd583e396c36f438a8b731ce0324bd8081493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 27 Nov 2016 23:22:13 +0100 Subject: [PATCH 01/26] Add first test for sawyercoding --- test/tests/sawyercoding_test.cpp | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/tests/sawyercoding_test.cpp diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp new file mode 100644 index 0000000000..3e8c163eda --- /dev/null +++ b/test/tests/sawyercoding_test.cpp @@ -0,0 +1,44 @@ +extern "C" { + #include "util/sawyercoding.h" +} + +#include + +// TODO: Seed with some proper randomness +char randomdata[] = { 0x01, 0x02, 0x03, 0x04 }; + +#define BUFFER_SIZE 0x600000 + +static void test_encode_decode(uint8_t encoding_type) { + sawyercoding_chunk_header chdr_in, chdr_out; + chdr_in.encoding = encoding_type; + chdr_in.length = sizeof(randomdata); + uint8_t * encodedDataBuffer = new uint8_t[BUFFER_SIZE]; + size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8 *)randomdata, chdr_in); + ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); + memcpy(&chdr_out, encodedDataBuffer, sizeof(sawyercoding_chunk_header)); + ASSERT_EQ(chdr_out.encoding, encoding_type); + uint8_t * decodeBuffer = new uint8_t[BUFFER_SIZE]; + size_t decodedDataSize = sawyercoding_read_chunk_buffer(decodeBuffer, encodedDataBuffer + sizeof(sawyercoding_chunk_header), chdr_out, BUFFER_SIZE); + ASSERT_EQ(decodedDataSize, sizeof(randomdata)); + int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); + ASSERT_EQ(result, 0); + delete [] decodeBuffer; + delete [] encodedDataBuffer; +} + +TEST(sawyercoding, write_read_chunk_none) { + test_encode_decode(CHUNK_ENCODING_NONE); +} + +TEST(sawyercoding, write_read_chunk_rle) { + test_encode_decode(CHUNK_ENCODING_RLE); +} + +TEST(sawyercoding, write_read_chunk_rle_compressed) { + test_encode_decode(CHUNK_ENCODING_RLECOMPRESSED); +} + +TEST(sawyercoding, write_read_chunk_rotate) { + test_encode_decode(CHUNK_ENCODING_ROTATE); +} From be1028b20e5637160ef462cfff509ac1ee20f694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 28 Nov 2016 14:33:50 +0100 Subject: [PATCH 02/26] Add CMakeLists.txt file for tests --- test/tests/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/tests/CMakeLists.txt diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt new file mode 100644 index 0000000000..6bb47463b9 --- /dev/null +++ b/test/tests/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.6) +include(FindGTest) +set(SAWYERCODING_TEST_SOURCES "sawyercoding_test.cpp" "../../src/diagnostic.c" "../../src/util/sawyercoding.c" "../../src/localisation/utf8.c") +set (CMAKE_CXX_STANDARD 11) +find_package(GTest REQUIRED) +add_executable(test_sawyercoding ${SAWYERCODING_TEST_SOURCES}) +target_link_libraries(test_sawyercoding gtest gtest_main pthread) +target_include_directories(test_sawyercoding PUBLIC "../../src") +target_include_directories(test_sawyercoding PUBLIC "/usr/include/SDL2") From f496fceb00d4fe14b0393d3107b8361872a172cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 28 Nov 2016 23:27:21 +0100 Subject: [PATCH 03/26] Download and compile our own gtest --- test/tests/CMakeLists.txt | 52 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt index 6bb47463b9..a9b327886d 100644 --- a/test/tests/CMakeLists.txt +++ b/test/tests/CMakeLists.txt @@ -1,8 +1,56 @@ cmake_minimum_required(VERSION 2.6) -include(FindGTest) + + +INCLUDE(ExternalProject) + +ExternalProject_Add( + googletest-distribution + URL https://github.com/google/googletest/archive/release-1.8.0.tar.gz + URL_HASH SHA1=e7e646a6204638fe8e87e165292b8dd9cd4c36ed + TIMEOUT 10 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) + +# Specify include dir +ExternalProject_Get_Property(googletest-distribution SOURCE_DIR) +set(GOOGLETEST_DISTRIB_SOURCE_DIR "${SOURCE_DIR}") + +ExternalProject_Add( + googletest + DEPENDS googletest-distribution + DOWNLOAD_COMMAND "" + SOURCE_DIR "${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest" + # Disable install step + INSTALL_COMMAND "" + # Wrap download, configure and build steps in a script to log output + LOG_DOWNLOAD ON + LOG_CONFIGURE ON + LOG_BUILD ON) + + +# Specify include dir +set(GTEST_INCLUDE_DIR ${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest/include) + +# Library +ExternalProject_Get_Property(googletest BINARY_DIR) +set(GOOGLETEST_BINARY_DIR "${BINARY_DIR}") +set(GTEST_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a) +set(GTEST_MAIN_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a) +set(GTEST_LIBRARY gtest) +set(GTEST_MAIN_LIBRARY gtest_main) +add_library(${GTEST_LIBRARY} UNKNOWN IMPORTED) +add_library(${GTEST_MAIN_LIBRARY} UNKNOWN IMPORTED) +set_property(TARGET ${GTEST_LIBRARY} PROPERTY IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}) +set_property(TARGET ${GTEST_MAIN_LIBRARY} PROPERTY IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}) +add_dependencies(${GTEST_LIBRARY} googletest) +add_dependencies(${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY}) + +include_directories(${GTEST_INCLUDE_DIR}) + set(SAWYERCODING_TEST_SOURCES "sawyercoding_test.cpp" "../../src/diagnostic.c" "../../src/util/sawyercoding.c" "../../src/localisation/utf8.c") set (CMAKE_CXX_STANDARD 11) -find_package(GTest REQUIRED) add_executable(test_sawyercoding ${SAWYERCODING_TEST_SOURCES}) target_link_libraries(test_sawyercoding gtest gtest_main pthread) target_include_directories(test_sawyercoding PUBLIC "../../src") From cae3f776f357a2b8ff9f496c496dc0cb03cb163a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 28 Nov 2016 14:37:27 +0100 Subject: [PATCH 04/26] Run tests on travis --- CMakeLists.txt | 6 ++++++ scripts/linux/build.sh | 2 +- test/tests/CMakeLists.txt | 9 ++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd75803adc..c3d5c02679 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,7 @@ option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags") option(DISABLE_OPENGL "Disable OpenGL support.") option(DISABLE_RCT2 "Build a standalone version, without using code and data segments from vanilla. On by default." ON) option(USE_MMAP "Use mmap to try loading rct2's data segment into memory.") +option(WITH_TESTS "Build tests") set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fstrict-aliasing -Werror -Wundef -Wmissing-declarations -Winit-self -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-missing-braces -Wno-comment") @@ -407,6 +408,11 @@ install(FILES resources/logo/icon_x256.png DESTINATION share/icons/hicolor/256x2 install(FILES resources/logo/icon_flag.svg DESTINATION share/icons/hicolor/scalable/apps RENAME openrct2.svg) install(FILES distribution/linux/openrct2.desktop DESTINATION share/applications) +if (WITH_TESTS) + enable_testing() + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/tests/) +endif () + if (UNIX AND (NOT USE_MMAP) AND (NOT DISABLE_RCT2) AND (FORCE32)) file(GLOB_RECURSE ORCT2_RIDE_SOURCES "src/ride/*/*.c") file(GLOB_RECURSE ORCT2_RIDE_DEP_SOURCES "src/ride/ride_data.c" "src/ride/track_data.c" "src/ride/track_data_old.c" "src/ride/track_paint.c" "src/addresses.c" "src/diagnostic.c" "src/hook.c" "src/paint/map_element/map_element.c" "src/paint/paint_helpers.c") diff --git a/scripts/linux/build.sh b/scripts/linux/build.sh index 1370a63132..af7e33201e 100755 --- a/scripts/linux/build.sh +++ b/scripts/linux/build.sh @@ -75,7 +75,7 @@ pushd build chmod a+rwx $(pwd) chmod g+s $(pwd) # CMAKE and MAKE opts from environment - docker run -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:64bit-only bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS" + docker run -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:64bit-only bash -c "cmake ../ -DWITH_TESTS=on $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS && make test ARGS=\"-V\"" elif [[ $TARGET == "linux" ]] then cmake $OPENRCT2_CMAKE_OPTS .. -DCMAKE_BUILD_TYPE=debug diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt index a9b327886d..977522fef2 100644 --- a/test/tests/CMakeLists.txt +++ b/test/tests/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) - +# Bootstrap GoogleTest INCLUDE(ExternalProject) ExternalProject_Add( @@ -47,11 +47,14 @@ set_property(TARGET ${GTEST_MAIN_LIBRARY} PROPERTY IMPORTED_LOCATION ${GTEST_MAI add_dependencies(${GTEST_LIBRARY} googletest) add_dependencies(${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY}) -include_directories(${GTEST_INCLUDE_DIR}) +include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) + +# Start of our tests set(SAWYERCODING_TEST_SOURCES "sawyercoding_test.cpp" "../../src/diagnostic.c" "../../src/util/sawyercoding.c" "../../src/localisation/utf8.c") set (CMAKE_CXX_STANDARD 11) add_executable(test_sawyercoding ${SAWYERCODING_TEST_SOURCES}) target_link_libraries(test_sawyercoding gtest gtest_main pthread) target_include_directories(test_sawyercoding PUBLIC "../../src") -target_include_directories(test_sawyercoding PUBLIC "/usr/include/SDL2") +add_test(NAME sawyercoding + COMMAND test_sawyercoding) From b0e5333ce6984e45f5d02bf61d627d3ad6c5bf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 29 Nov 2016 11:56:21 +0100 Subject: [PATCH 05/26] Improve sawyercoding_test.cpp --- test/tests/sawyercoding_test.cpp | 426 +++++++++++++++++++++++++++++-- 1 file changed, 399 insertions(+), 27 deletions(-) diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index 3e8c163eda..2dce17f261 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -1,44 +1,416 @@ extern "C" { - #include "util/sawyercoding.h" +#include "util/sawyercoding.h" } #include -// TODO: Seed with some proper randomness -char randomdata[] = { 0x01, 0x02, 0x03, 0x04 }; +// These are populated further down in this file, but to do so, they need to be marked `extern`. +extern const uint8 randomdata[1024]; +extern const uint8 nonedata[1029]; +extern const uint8 rledata[1038]; +extern const uint8 rlecompresseddata[1949]; +extern const uint8 rotatedata[1038]; #define BUFFER_SIZE 0x600000 -static void test_encode_decode(uint8_t encoding_type) { - sawyercoding_chunk_header chdr_in, chdr_out; - chdr_in.encoding = encoding_type; - chdr_in.length = sizeof(randomdata); - uint8_t * encodedDataBuffer = new uint8_t[BUFFER_SIZE]; - size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8 *)randomdata, chdr_in); - ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); - memcpy(&chdr_out, encodedDataBuffer, sizeof(sawyercoding_chunk_header)); - ASSERT_EQ(chdr_out.encoding, encoding_type); - uint8_t * decodeBuffer = new uint8_t[BUFFER_SIZE]; - size_t decodedDataSize = sawyercoding_read_chunk_buffer(decodeBuffer, encodedDataBuffer + sizeof(sawyercoding_chunk_header), chdr_out, BUFFER_SIZE); - ASSERT_EQ(decodedDataSize, sizeof(randomdata)); - int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); - ASSERT_EQ(result, 0); - delete [] decodeBuffer; - delete [] encodedDataBuffer; +static void test_encode_decode(uint8 encoding_type) +{ + sawyercoding_chunk_header chdr_in, chdr_out; + chdr_in.encoding = encoding_type; + chdr_in.length = sizeof(randomdata); + uint8 * encodedDataBuffer = new uint8[BUFFER_SIZE]; + size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8 *)randomdata, chdr_in); + ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); + memcpy(&chdr_out, encodedDataBuffer, sizeof(sawyercoding_chunk_header)); + ASSERT_EQ(chdr_out.encoding, encoding_type); + uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; + size_t decodedDataSize = sawyercoding_read_chunk_buffer(decodeBuffer, encodedDataBuffer + sizeof(sawyercoding_chunk_header), + chdr_out, BUFFER_SIZE); + ASSERT_EQ(decodedDataSize, sizeof(randomdata)); + int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); + ASSERT_EQ(result, 0); + delete[] decodeBuffer; + delete[] encodedDataBuffer; } -TEST(sawyercoding, write_read_chunk_none) { - test_encode_decode(CHUNK_ENCODING_NONE); +static void test_decode(const uint8 * data) +{ + sawyercoding_chunk_header chdr_in; + memcpy(&chdr_in, data, sizeof(sawyercoding_chunk_header)); + uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; + size_t decodedDataSize = + sawyercoding_read_chunk_buffer(decodeBuffer, data + sizeof(sawyercoding_chunk_header), chdr_in, BUFFER_SIZE); + ASSERT_EQ(decodedDataSize, sizeof(randomdata)); + int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); + ASSERT_EQ(result, 0); + delete[] decodeBuffer; } -TEST(sawyercoding, write_read_chunk_rle) { - test_encode_decode(CHUNK_ENCODING_RLE); +TEST(sawyercoding, write_read_chunk_none) +{ + test_encode_decode(CHUNK_ENCODING_NONE); } -TEST(sawyercoding, write_read_chunk_rle_compressed) { - test_encode_decode(CHUNK_ENCODING_RLECOMPRESSED); +TEST(sawyercoding, write_read_chunk_rle) +{ + test_encode_decode(CHUNK_ENCODING_RLE); } -TEST(sawyercoding, write_read_chunk_rotate) { - test_encode_decode(CHUNK_ENCODING_ROTATE); +TEST(sawyercoding, write_read_chunk_rle_compressed) +{ + test_encode_decode(CHUNK_ENCODING_RLECOMPRESSED); } + +TEST(sawyercoding, write_read_chunk_rotate) +{ + test_encode_decode(CHUNK_ENCODING_ROTATE); +} + +// Note we only check if provided data decompresses to the same data, not if it compresses the same. +// The reason for that is we may improve encoding at some point, but the test won't be affected, +// as we already do a decode test and rountrip (encode + decode), which validates all uses. + +TEST(sawyercoding, decode_chunk_none) +{ + test_decode(nonedata); +} + +TEST(sawyercoding, decode_chunk_rle) +{ + test_decode(rledata); +} + +TEST(sawyercoding, decode_chunk_rlecompressed) +{ + test_decode(rlecompresseddata); +} + +TEST(sawyercoding, decode_chunk_rotate) +{ + test_decode(rotatedata); +} + +// 1024 bytes of random data +// use `dd if=/dev/urandom bs=1024 count=1 | xxd -i` to get your own +extern const uint8 randomdata[] = { + 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0x0e, 0xc4, 0xac, 0xdc, 0x84, 0xd7, 0x68, 0xf1, 0x4d, 0xcb, 0xaf, 0x1e, 0x5a, + 0x29, 0x40, 0x87, 0x80, 0x3f, 0xf9, 0xb8, 0xad, 0x01, 0xd3, 0x79, 0x3d, 0xe9, 0x87, 0xa8, 0x95, 0x68, 0xc0, 0xc2, 0x3d, + 0x15, 0x87, 0xdb, 0xa6, 0x90, 0x8c, 0x26, 0x98, 0x2a, 0x3f, 0x2e, 0x0c, 0x82, 0x43, 0x00, 0x10, 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, 0xfe, 0x08, 0xec, 0x20, 0x18, 0x0a, 0x4e, 0xc5, 0xb6, 0x42, 0xe4, 0x70, + 0xbb, 0xba, 0x1b, 0xec, 0x01, 0x9c, 0xe5, 0x1c, 0xf4, 0xd2, 0x68, 0x0b, 0x30, 0x2d, 0xec, 0xda, 0x23, 0xff, 0xbd, 0x95, + 0x46, 0x55, 0x59, 0xab, 0x03, 0x0f, 0xe4, 0xeb, 0x8c, 0xca, 0xc1, 0x13, 0x28, 0x49, 0x12, 0x66, 0xd7, 0x85, 0xcb, 0x21, + 0x8d, 0x8a, 0x34, 0x4c, 0x2e, 0x28, 0x25, 0x79, 0xbf, 0x98, 0x04, 0xcd, 0x8a, 0x3e, 0xad, 0x08, 0xd3, 0x21, 0x32, 0xed, + 0x54, 0x7e, 0x17, 0xfe, 0x89, 0xe9, 0x09, 0x18, 0xac, 0x96, 0xda, 0x51, 0x61, 0x85, 0x44, 0xd2, 0xdf, 0xd9, 0x61, 0xa2, + 0x44, 0x07, 0x29, 0xa5, 0xdc, 0x16, 0xac, 0x3d, 0x6e, 0x27, 0xb6, 0x5a, 0x15, 0x87, 0x6c, 0x48, 0x3e, 0x34, 0xdd, 0xec, + 0xf2, 0x7c, 0xc6, 0x87, 0x0f, 0xcf, 0xac, 0xde, 0x42, 0x02, 0x93, 0xff, 0x4f, 0x10, 0x0f, 0x03, 0xf3, 0x1b, 0x1e, 0xaf, + 0x94, 0x8e, 0x77, 0x7c, 0x66, 0x65, 0xfb, 0xd9, 0x0d, 0xf8, 0x36, 0x0c, 0xac, 0xdc, 0x8e, 0xd1, 0x1e, 0x19, 0xa8, 0x87, + 0x97, 0x39, 0x77, 0x98, 0x6c, 0xfb, 0x5d, 0xc1, 0x09, 0x7e, 0x5d, 0xab, 0xde, 0xdc, 0x1f, 0x21, 0xd0, 0x7a, 0xaa, 0xeb, + 0x96, 0x60, 0xf9, 0x95, 0xed, 0x13, 0xf4, 0x82, 0xa9, 0x94, 0x7e, 0xa8, 0x5e,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x9b, 0x09, 0x88, 0xe2, 0xd5, 0xec, + 0xb4, 0xdd, 0x2b, 0xda, 0x29, 0x6f, 0x1b, 0x81, 0x21, 0xe4, 0x5c, 0x36, 0x73, 0x2d, 0x9d, 0xdd, 0xb6, 0x69, 0x21, 0x40, + 0x4e, 0x70, 0xde, 0x9d, 0x0c, 0x17, 0x1d, 0x15, 0x29, 0x5b, 0xd0, 0x66, 0x72, 0xb8, 0x38, 0x80, 0xbe, 0x9e, 0xd7, 0x5e, + 0xb5, 0x72, 0x22, 0xbc +}; + +// Following are compressed versions of the data above. + +extern const uint8 nonedata[] = { + 0x00, 0x00, 0x04, 0x00, 0x00, 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0x0e, 0xc4, 0xac, 0xdc, 0x84, 0xd7, 0x68, 0xf1, + 0x4d, 0xcb, 0xaf, 0x1e, 0x5a, 0x29, 0x40, 0x87, 0x80, 0x3f, 0xf9, 0xb8, 0xad, 0x01, 0xd3, 0x79, 0x3d, 0xe9, 0x87, 0xa8, + 0x95, 0x68, 0xc0, 0xc2, 0x3d, 0x15, 0x87, 0xdb, 0xa6, 0x90, 0x8c, 0x26, 0x98, 0x2a, 0x3f, 0x2e, 0x0c, 0x82, 0x43, 0x00, + 0x10, 0x6d, 0x60, 0xb9, 0xd4, 0xed, 0xf1, 0x49, 0xbb, 0xf6, 0x7f, 0x21, 0x24, 0xc3, 0xfb, 0x42, 0xe1, 0xfc, 0xb8, 0x82, + 0x5e, 0x01, 0x5d, 0x96, 0x2d, 0x0f, 0x48, 0x12, 0xdf, 0x4b, 0x6c, 0x7e, 0x99, 0x01, 0xfa, 0x46, 0x7d, 0x2c, 0xeb, 0xd6, + 0xf3, 0x77, 0xa3, 0x85, 0x8e, 0x00, 0x34, 0xee, 0x73, 0x31, 0x76, 0x53, 0x17, 0x5a, 0x2b, 0x19, 0x65, 0x2f, 0x32, 0x99, + 0x57, 0xc4, 0xf8, 0x05, 0x0d, 0xc3, 0x59, 0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4, 0xb7, 0xd4, 0x2c, 0x98, 0xfa, 0xb5, 0x95, 0xac, 0x33, 0x1a, 0x53, 0x9d, 0xe3, 0x4e, 0x5d, 0x4f, + 0x54, 0x0d, 0xe8, 0xa4, 0x32, 0x25, 0x4d, 0x5e, 0x4c, 0xe1, 0xae, 0x46, 0x85, 0x1e, 0xc4, 0x20, 0xdf, 0x73, 0x1e, 0x81, + 0x40, 0xa2, 0x33, 0x75, 0x1e, 0x1d, 0x1d, 0x7c, 0x1f, 0x07, 0xe5, 0x9e, 0x76, 0x9f, 0x42, 0xeb, 0xc4, 0xb4, 0xd3, 0xcb, + 0x55, 0xe8, 0xbf, 0xf7, 0xeb, 0x7c, 0x2d, 0xa5, 0xfd, 0xda, 0xb4, 0x5b, 0x1f, 0xa8, 0xd2, 0xeb, 0xdf, 0xd9, 0xf2, 0x35, + 0xc6, 0x0c, 0x36, 0x66, 0x28, 0x95, 0xe2, 0x34, 0x64, 0xea, 0xaf, 0x3a, 0x36, 0x3c, 0x38, 0x31, 0x99, 0x8d, 0x80, 0x78, + 0x18, 0x48, 0x2c, 0xe9, 0xe5, 0xb7, 0xe6, 0x2e, 0x73, 0xf1, 0x7c, 0x84, 0x21, 0x04, 0x00, 0x8e, 0x12, 0x66, 0x6c, 0x9b, + 0x09, 0x88, 0xe2, 0xd5, 0xec, 0xb4, 0xdd, 0x2b, 0xda, 0x29, 0x6f, 0x1b, 0x81, 0x21, 0xe4, 0x5c, 0x36, 0x73, 0x2d, 0x9d, + 0xdd, 0xb6, 0x69, 0x21, 0x40, 0x4e, 0x70, 0xde, 0x9d, 0x0c, 0x17, 0x1d, 0x15, 0x29, 0x5b, 0xd0, 0x66, 0x72, 0xb8, 0x38, + 0x80, 0xbe, 0x9e, 0xd7, 0x5e, 0xb5, 0x72, 0x22, 0xbc +}; + +extern const uint8 rledata[] = { + 0x01, 0x09, 0x04, 0x00, 0x00, 0x7d, 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0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xd6, 0x2f, 0xbc, 0xe1, + 0xb7, 0xbb, 0x48, 0x88, 0x86, 0x19, 0xbb, 0x52, 0xfc, 0x18, 0xc9, 0xe3, 0x90, 0x88, 0x6c, 0x54, 0x53, 0x08, 0x26, 0xff, + 0x38, 0xe3, 0x5e, 0x06, 0xa1, 0xac, 0xc2, 0x83, 0x23, 0x0d, 0x42, 0xe6, 0xa9, 0x81, 0x38, 0x0b, 0x4f, 0x16, 0x2a, 0x77, + 0x3b, 0x24, 0xfb, 0x94, 0x53, 0x78, 0x6a, 0xf3, 0x17, 0x6a, 0x60, 0x44, 0x58, 0x5c, 0x50, 0x80, 0xc8, 0x0f, 0x87, 0x7d, + 0x7b, 0x95, 0x0a, 0xdc, 0xf1, 0x1a, 0x6a, 0xa3, 0xff, 0x79, 0xda, 0x14, 0xd4, 0x6c, 0x7a, 0xfd, 0x7e, 0x1e, 0xfe, 0xd2, + 0x28, 0xd0, 0x06, 0x95, 0x40, 0x80, 0xa1, 0x84, 0xc9, 0xc0, 0x4b, 0xa5, 0x97, 0xb2, 0xb9, 0x20, 0x27, 0x94, 0x87, 0x91, + 0xba, 0xb2, 0xc6, 0xdb, 0x78, 0x19, 0x40, 0x35, 0x9f, 0xbd, 0xfb, 0xc1, 0x45, 0xbe, 0xdc, 0x30, 0xad, 0x38, 0xd4, 0x14, + 0x46, 0x98, 0x2a, 0x90, 0xc8, 0x85, 0x5e, 0x7e, 0x76, 0x0f, 0xc4, 0x20, 0x07, 0x54, 0x1a, 0x60, 0x3a, 0x8c, 0x75, 0xb0, + 0x43, 0xab, 0xbb, 0x05, 0xca, 0x93, 0xeb, 0x18, 0x94, 0xf1, 0x64, 0x8a, 0x01, 0xe0, 0xe6, 0x24, 0x78, 0x50, 0x93, 0xd3, + 0xb9, 0xe1, 0xbf, 0x1c, 0xb0, 0x5c, 0xad, 0x94, 0x17, 0x8a, 0xd1, 0xef, 0x66, 0x08, 0xa7, 0x08, 0x6d, 0x6a, 0xb7, 0x06, + 0x31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 0x40, 0xf6, 0xee, 0x50, 0x67, 0x57, 0xf4, 0xd8, 0xd1, 0x95, 0x17, 0x2c, 0x5a, 0x72, 0x8f, 0xdc, + 0xeb, 0x6c, 0x9b, 0x24, 0xfc, 0x67, 0x11, 0x07, 0x82, 0x2a, 0xae, 0xfb, 0xd9, 0xfd, 0x89, 0x75, 0x71, 0x75, 0x74, 0x08, + 0x0d, 0xf7, 0xba, 0x5d, 0x56, 0xdf, 0x7e, 0x52, 0x5b, 0xce, 0xef, 0xeb, 0xf6, 0x32, 0x11, 0x93, 0x5f, 0xab, 0xfe, 0x08, + 0xec, 0x20, 0x18, 0x0a, 0x4e, 0xc5, 0xb6, 0x42, 0xe4, 0x70, 0xbb, 0xba, 0x1b, 0xec, 0x01, 0x9c, 0xe5, 0x1c, 0xf4, 0xd2, + 0x7d, 0x68, 0x0b, 0x30, 0x2d, 0xec, 0xda, 0x23, 0xff, 0xbd, 0x95, 0x46, 0x55, 0x59, 0xab, 0x03, 0x0f, 0xe4, 0xeb, 0x8c, + 0xca, 0xc1, 0x13, 0x28, 0x49, 0x12, 0x66, 0xd7, 0x85, 0xcb, 0x21, 0x8d, 0x8a, 0x34, 0x4c, 0x2e, 0x28, 0x25, 0x79, 0xbf, + 0x98, 0x04, 0xcd, 0x8a, 0x3e, 0xad, 0x08, 0xd3, 0x21, 0x32, 0xed, 0x54, 0x7e, 0x17, 0xfe, 0x89, 0xe9, 0x09, 0x18, 0xac, + 0x96, 0xda, 0x51, 0x61, 0x85, 0x44, 0xd2, 0xdf, 0xd9, 0x61, 0xa2, 0x44, 0x07, 0x29, 0xa5, 0xdc, 0x16, 0xac, 0x3d, 0x6e, + 0x27, 0xb6, 0x5a, 0x15, 0x87, 0x6c, 0x48, 0x3e, 0x34, 0xdd, 0xec, 0xf2, 0x7c, 0xc6, 0x87, 0x0f, 0xcf, 0xac, 0xde, 0x42, + 0x02, 0x93, 0xff, 0x4f, 0x10, 0x0f, 0x03, 0xf3, 0x1b, 0x1e, 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, 0xf7, 0xeb, 0x7c, 0x2d, 0xa5, 0xfd, 0xda, 0xb4, + 0x5b, 0x1f, 0xa8, 0xd2, 0xeb, 0xdf, 0xd9, 0xf2, 0x35, 0xc6, 0x0c, 0x36, 0x66, 0x28, 0x95, 0xe2, 0x34, 0x64, 0xea, 0xaf, + 0x3a, 0x36, 0x3c, 0x38, 0x31, 0x99, 0x8d, 0x80, 0x78, 0x18, 0x48, 0x2c, 0xe9, 0xe5, 0xb7, 0xe6, 0x2e, 0x73, 0xf1, 0x7c, + 0x84, 0x21, 0x04, 0x00, 0x8e, 0x12, 0x66, 0x6c, 0x9b, 0x09, 0x88, 0xe2, 0xd5, 0xec, 0xb4, 0xdd, 0x2b, 0xda, 0x29, 0x6f, + 0x1b, 0x81, 0x21, 0xe4, 0x5c, 0x36, 0x73, 0x2d, 0x9d, 0xdd, 0xb6, 0x69, 0x21, 0x40, 0x4e, 0x70, 0xde, 0x9d, 0x0c, 0x17, + 0x1d, 0x15, 0x29, 0x5b, 0xd0, 0x66, 0x72, 0xb8, 0x38, 0x80, 0xbe, 0x9e, 0xd7, 0x5e, 0xb5, 0x72, 0x22, 0xbc +}; + +extern const uint8 rlecompresseddata[] = { + 0x02, 0x98, 0x07, 0x00, 0x00, 0x7d, 0xff, 0x3a, 0xff, 0x97, 0xff, 0x63, 0xff, 0x8b, 0xff, 0xbf, 0xff, 0xe5, 0xff, 0x6e, + 0xff, 0x0e, 0xff, 0xc4, 0xff, 0xac, 0xff, 0xdc, 0xff, 0x84, 0xff, 0xd7, 0xff, 0x68, 0xff, 0xf1, 0xff, 0x4d, 0xff, 0xcb, + 0xff, 0xaf, 0xff, 0x1e, 0xff, 0x5a, 0xff, 0x29, 0xff, 0x40, 0xff, 0x87, 0xff, 0x80, 0xff, 0x3f, 0xff, 0xf9, 0xff, 0xb8, + 0xff, 0xad, 0xff, 0x01, 0xff, 0xd3, 0xff, 0x79, 0xff, 0x3d, 0xff, 0xe9, 0xa8, 0xff, 0xa8, 0xff, 0x95, 0x48, 0xff, 0xc0, + 0xff, 0xc2, 0xc0, 0xff, 0x15, 0x68, 0xff, 0xdb, 0xff, 0xa6, 0xff, 0x90, 0xff, 0x8c, 0xff, 0x26, 0xff, 0x98, 0xff, 0x2a, + 0x38, 0xff, 0x2e, 0xff, 0x0c, 0xff, 0x82, 0xff, 0x43, 0xff, 0x00, 0xff, 0x10, 0xff, 0x6d, 0xff, 0x60, 0xff, 0xb9, 0xff, + 0xd4, 0xff, 0xed, 0xff, 0xf1, 0xff, 0x49, 0xff, 0xbb, 0xff, 0xf6, 0xff, 0x7d, 0x7f, 0xff, 0x21, 0xff, 0x24, 0xff, 0xc3, + 0xff, 0xfb, 0xff, 0x42, 0xff, 0xe1, 0xff, 0xfc, 0xff, 0xb8, 0x50, 0xff, 0x5e, 0xff, 0x01, 0xff, 0x5d, 0xff, 0x96, 0xff, + 0x2d, 0xff, 0x0f, 0xff, 0x48, 0xff, 0x12, 0xff, 0xdf, 0xff, 0x4b, 0xff, 0x6c, 0xff, 0x7e, 0xff, 0x99, 0xa0, 0xff, 0xfa, + 0xff, 0x46, 0xff, 0x7d, 0xff, 0x2c, 0xff, 0xeb, 0xff, 0xd6, 0xff, 0xf3, 0xff, 0x77, 0xff, 0xa3, 0xff, 0x85, 0xff, 0x8e, + 0xff, 0x00, 0xff, 0x34, 0xff, 0xee, 0xff, 0x73, 0xff, 0x31, 0xff, 0x76, 0xff, 0x53, 0xff, 0x17, 0xff, 0x5a, 0xff, 0x2b, + 0xff, 0x19, 0xff, 0x65, 0xff, 0x2f, 0xff, 0x32, 0x28, 0xff, 0x57, 0xff, 0xc4, 0xff, 0xf8, 0xff, 0x05, 0xff, 0x0d, 0xff, + 0xc3, 0xff, 0x59, 0xff, 0x29, 0xff, 0x9a, 0x90, 0xff, 0x3c, 0xff, 0x33, 0xff, 0x58, 0xff, 0x8c, 0xff, 0xd1, 0xff, 0x33, + 0x1f, 0xff, 0x3b, 0xff, 0xa5, 0xff, 0x66, 0xff, 0xa7, 0xff, 0xfc, 0xff, 0x7c, 0x48, 0xff, 0xa9, 0xff, 0x1a, 0xff, 0x5e, + 0x10, 0xff, 0x92, 0xff, 0x9e, 0xff, 0x71, 0xff, 0x27, 0xff, 0x07, 0xff, 0xbc, 0xe0, 0xff, 0xed, 0xff, 0xe5, 0xff, 0xc6, + 0xff, 0x0e, 0xff, 0x74, 0xff, 0xdb, 0xff, 0x15, 0xff, 0x91, 0xff, 0xd7, 0xfe, 0xff, 0x63, 0xf7, 0xff, 0x30, 0xff, 0x6e, + 0xff, 0x6a, 0xff, 0x00, 0xff, 0x40, 0x98, 0xff, 0x76, 0xff, 0x8a, 0xff, 0xb2, 0xff, 0x31, 0xff, 0xa3, 0xff, 0x81, 0xff, + 0x83, 0xff, 0xc8, 0x38, 0xff, 0x08, 0xff, 0x1f, 0x28, 0xff, 0x8d, 0xff, 0x13, 0xff, 0x3e, 0xff, 0x9a, 0xff, 0xca, 0xff, + 0x9c, 0xff, 0xd4, 0xff, 0x01, 0xff, 0x28, 0xff, 0xe6, 0xff, 0xaf, 0xff, 0xd6, 0xff, 0x2f, 0xff, 0xbc, 0xff, 0xe1, 0xff, + 0xb7, 0xff, 0xbb, 0xff, 0x48, 0xff, 0x88, 0xff, 0x86, 0xff, 0x19, 0xd8, 0xff, 0x52, 0xff, 0xfc, 0xff, 0x18, 0xff, 0xc9, + 0xff, 0xe3, 0xff, 0x90, 0xb0, 0xff, 0x6c, 0xff, 0x54, 0xff, 0x53, 0xff, 0x08, 0xff, 0x26, 0xfe, 0xff, 0x57, 0x38, 0xb0, + 0xff, 0x5e, 0xff, 0x06, 0xff, 0xa1, 0xff, 0xac, 0xff, 0xc2, 0xff, 0x83, 0xff, 0x23, 0xff, 0x0d, 0xff, 0x42, 0xff, 0xe6, + 0xff, 0xa9, 0xff, 0x81, 0x90, 0xff, 0x0b, 0xff, 0x4f, 0xff, 0x16, 0xff, 0x2a, 0xff, 0x77, 0xff, 0x3b, 0xff, 0x24, 0xff, + 0xfb, 0xff, 0x94, 0x20, 0xff, 0x78, 0xff, 0x6a, 0xff, 0xf3, 0xff, 0x17, 0xe8, 0xff, 0x60, 0xff, 0x44, 0xff, 0x58, 0xff, + 0x5c, 0xff, 0x50, 0xff, 0x80, 0xff, 0xc8, 0xff, 0x0f, 0xff, 0x87, 0xff, 0x7b, 0xff, 0x95, 0xff, 0x0a, 0xff, 0xdc, 0xff, + 0xf1, 0xff, 0x1a, 0x68, 0xff, 0xa3, 0xfe, 0xff, 0x7d, 0x79, 0xff, 0xda, 0xff, 0x14, 0xff, 0xd4, 0xff, 0x6c, 0xff, 0x7a, + 0xff, 0xfd, 0xff, 0x7e, 0xff, 0x1e, 0xff, 0xfe, 0xff, 0xd2, 0xff, 0x28, 0xff, 0xd0, 0xff, 0x06, 0x50, 0xff, 0x40, 0x18, + 0xff, 0xa1, 0xff, 0x84, 0xff, 0xc9, 0xff, 0xc0, 0xff, 0x4b, 0xff, 0xa5, 0xff, 0x97, 0xff, 0xb2, 0xff, 0xb9, 0xff, 0x20, + 0xff, 0x27, 0xff, 0x94, 0xff, 0x87, 0xff, 0x91, 0xff, 0xba, 0xc0, 0xff, 0xc6, 0xff, 0xdb, 0xff, 0x78, 0xff, 0x19, 0x50, + 0xff, 0x35, 0xff, 0x9f, 0xff, 0xbd, 0xff, 0xfb, 0xff, 0xc1, 0xff, 0x45, 0xff, 0xbe, 0xff, 0xdc, 0xff, 0x30, 0xff, 0xad, + 0xff, 0x38, 0xff, 0xd4, 0xff, 0x14, 0xff, 0x46, 0xff, 0x98, 0xff, 0x2a, 0xff, 0x90, 0xff, 0xc8, 0xff, 0x85, 0xff, 0x5e, + 0xff, 0x7e, 0xff, 0x76, 0xff, 0x0f, 0xff, 0xc4, 0xff, 0x20, 0xff, 0x07, 0xff, 0x54, 0xff, 0x7d, 0x1a, 0xff, 0x60, 0xff, + 0x3a, 0xff, 0x8c, 0xff, 0x75, 0xff, 0xb0, 0xff, 0x43, 0xff, 0xab, 0xff, 0xbb, 0xff, 0x05, 0xff, 0xca, 0xff, 0x93, 0xff, + 0xeb, 0xff, 0x18, 0xff, 0x94, 0xff, 0xf1, 0xff, 0x64, 0xff, 0x8a, 0xff, 0x01, 0xff, 0xe0, 0xff, 0xe6, 0xff, 0x24, 0xff, + 0x78, 0xff, 0x50, 0x98, 0xff, 0xd3, 0xff, 0xb9, 0xff, 0xe1, 0xff, 0xbf, 0xff, 0x1c, 0x38, 0xff, 0x5c, 0xff, 0xad, 0x68, + 0xff, 0x17, 0x70, 0xff, 0xd1, 0xff, 0xef, 0xff, 0x66, 0xff, 0x08, 0xff, 0xa7, 0xf0, 0xff, 0x6d, 0xff, 0x6a, 0xff, 0xb7, + 0xff, 0x06, 0xff, 0x31, 0xff, 0xa6, 0xff, 0x9d, 0xff, 0xe5, 0xff, 0xb2, 0xff, 0xd8, 0xff, 0xf9, 0xd0, 0xff, 0xf2, 0x20, + 0xff, 0x63, 0xff, 0xba, 0xff, 0x36, 0xff, 0x7a, 0xff, 0x53, 0xff, 0xc0, 0xff, 0x22, 0xff, 0x40, 0xff, 0x3e, 0xff, 0xa1, + 0xff, 0x95, 0x7d, 0x70, 0xff, 0xae, 0xff, 0x8c, 0xff, 0x35, 0xff, 0x7d, 0xff, 0x34, 0xd8, 0xff, 0x0c, 0xff, 0x69, 0xff, + 0x8a, 0xff, 0x0e, 0xff, 0xd4, 0x68, 0xff, 0x19, 0xff, 0xc9, 0xff, 0x90, 0xff, 0x78, 0x30, 0xff, 0x38, 0xff, 0xc8, 0xff, + 0xa0, 0xff, 0xc6, 0xff, 0x49, 0xff, 0xef, 0xff, 0xe3, 0xff, 0xb2, 0xff, 0x1d, 0xff, 0x7c, 0xff, 0xd3, 0xa8, 0xff, 0x33, + 0xff, 0x51, 0x40, 0xff, 0x2b, 0xff, 0xd2, 0xff, 0x8e, 0xff, 0xa8, 0xff, 0x6d, 0xff, 0x9c, 0xff, 0x01, 0xff, 0x06, 0xff, + 0x9f, 0xff, 0x93, 0xff, 0xa5, 0xff, 0x13, 0xff, 0x86, 0xff, 0x67, 0xff, 0x72, 0xff, 0x3e, 0xff, 0xc7, 0x00, 0xff, 0x97, + 0xff, 0xe6, 0x28, 0xff, 0xce, 0xff, 0x61, 0xff, 0x5a, 0xff, 0x57, 0xff, 0x10, 0xff, 0xf7, 0xff, 0x49, 0xff, 0x32, 0xff, + 0xea, 0xff, 0x8f, 0xb0, 0xff, 0x37, 0xe0, 0x78, 0xff, 0x25, 0x65, 0xff, 0x76, 0x38, 0xff, 0xf4, 0xff, 0x63, 0xff, 0x9c, + 0xff, 0x44, 0x48, 0xff, 0x4c, 0xff, 0x7b, 0xff, 0x3f, 0xff, 0x9b, 0x38, 0x50, 0xff, 0xb4, 0xff, 0x2a, 0xff, 0x7a, 0xa0, + 0xff, 0x03, 0xff, 0x29, 0xff, 0xf3, 0xff, 0x6f, 0xff, 0xff, 0x7d, 0x50, 0xff, 0x1a, 0xff, 0xb8, 0xff, 0x21, 0xff, 0xd7, + 0xff, 0xd0, 0xff, 0xbf, 0xff, 0x10, 0xff, 0x1e, 0xff, 0x82, 0xff, 0x96, 0xff, 0x9f, 0xff, 0xe3, 0xff, 0xc4, 0xff, 0xcf, + 0xff, 0x19, 0xff, 0x39, 0xa0, 0xff, 0x4b, 0xf8, 0xff, 0xa4, 0xff, 0x7e, 0x70, 0xff, 0x4e, 0xff, 0x3b, 0xff, 0x2c, 0xff, + 0x0c, 0xff, 0x35, 0xff, 0xe1, 0xff, 0xd4, 0xff, 0x45, 0x40, 0xff, 0x28, 0xff, 0x67, 0xff, 0x18, 0xff, 0xdc, 0xff, 0x2d, + 0xff, 0x77, 0xff, 0x68, 0xff, 0xf2, 0x40, 0xff, 0x87, 0xff, 0x52, 0x58, 0xff, 0xd1, 0xff, 0x50, 0xff, 0x04, 0x78, 0xff, + 0xf6, 0xff, 0x1d, 0xff, 0xb8, 0xff, 0x9d, 0xff, 0xfa, 0xff, 0xe8, 0xff, 0xd8, 0xff, 0x94, 0xff, 0xe0, 0xff, 0xae, 0xff, + 0x31, 0xff, 0x66, 0xff, 0xc7, 0xff, 0xee, 0xff, 0xa9, 0xff, 0xa8, 0xff, 0x51, 0xff, 0xe9, 0xff, 0x14, 0x7d, 0xff, 0x67, + 0xff, 0x53, 0xff, 0x4c, 0xff, 0x40, 0x48, 0xa8, 0x20, 0xc8, 0xff, 0x57, 0xff, 0xf4, 0x48, 0xff, 0xd1, 0xff, 0x95, 0xff, + 0x17, 0xff, 0x2c, 0xff, 0x5a, 0xff, 0x72, 0xff, 0x8f, 0xff, 0xdc, 0xff, 0xeb, 0xff, 0x6c, 0xff, 0x9b, 0xff, 0x24, 0xff, + 0xfc, 0x40, 0xff, 0x11, 0xff, 0x07, 0xff, 0x82, 0xff, 0x2a, 0xff, 0xae, 0xff, 0xfb, 0xff, 0xd9, 0xff, 0xfd, 0xff, 0x89, + 0xff, 0x75, 0xff, 0x71, 0xf0, 0xff, 0x74, 0xff, 0x08, 0xff, 0x0d, 0xff, 0xf7, 0xff, 0xba, 0xff, 0x5d, 0xff, 0x56, 0xff, + 0xdf, 0xff, 0x7e, 0xff, 0x52, 0xff, 0x5b, 0xff, 0xce, 0xff, 0xef, 0x08, 0xff, 0xf6, 0xff, 0x32, 0x20, 0xff, 0x93, 0xff, + 0x5f, 0xff, 0xab, 0xff, 0xfe, 0x60, 0xff, 0xec, 0xff, 0x20, 0xff, 0x18, 0xff, 0x0a, 0xff, 0x4e, 0xff, 0xc5, 0xff, 0xb6, + 0xff, 0x42, 0xff, 0xe4, 0x20, 0xff, 0x70, 0xff, 0xbb, 0x18, 0xff, 0x1b, 0x98, 0xff, 0x01, 0xff, 0x9c, 0xff, 0xe5, 0xff, + 0x1c, 0xff, 0xf4, 0xff, 0xd2, 0xff, 0x68, 0xff, 0x0b, 0xff, 0x30, 0xff, 0x2d, 0x40, 0xff, 0xda, 0xff, 0x23, 0xfe, 0xff, + 0x7d, 0xbd, 0xff, 0x95, 0xff, 0x46, 0xff, 0x55, 0xff, 0x59, 0xff, 0xab, 0xff, 0x03, 0xff, 0x0f, 0x20, 0xff, 0xeb, 0xff, + 0x8c, 0xff, 0xca, 0xff, 0xc1, 0xff, 0x13, 0xff, 0x28, 0xff, 0x49, 0xff, 0x12, 0xff, 0x66, 0xff, 0xd7, 0xff, 0x85, 0xff, + 0xcb, 0xff, 0x21, 0xff, 0x8d, 0xff, 0x8a, 0xff, 0x34, 0xff, 0x4c, 0xff, 0x2e, 0x98, 0xff, 0x25, 0xff, 0x79, 0xff, 0xbf, + 0xff, 0x98, 0xff, 0x04, 0xff, 0xcd, 0xa8, 0xff, 0x3e, 0xff, 0xad, 0xff, 0x08, 0xff, 0xd3, 0x70, 0xff, 0x32, 0xff, 0xed, + 0xff, 0x54, 0xff, 0x7e, 0xff, 0x17, 0xff, 0xfe, 0xff, 0x89, 0xff, 0xe9, 0xff, 0x09, 0xff, 0x18, 0xff, 0xac, 0xff, 0x96, + 0xff, 0xda, 0xff, 0x51, 0xff, 0x61, 0xff, 0x85, 0xff, 0x44, 0xff, 0xd2, 0xff, 0xdf, 0xff, 0xd9, 0xd0, 0xff, 0xa2, 0xd0, + 0xff, 0x07, 0xff, 0x29, 0xff, 0xa5, 0xff, 0x31, 0xdc, 0xff, 0x16, 0x70, 0xff, 0x3d, 0xff, 0x6e, 0xff, 0x27, 0xff, 0xb6, + 0xff, 0x5a, 0xff, 0x15, 0xff, 0x87, 0xff, 0x6c, 0xff, 0x48, 0xff, 0x3e, 0xff, 0x34, 0xff, 0xdd, 0xff, 0xec, 0xff, 0xf2, + 0xff, 0x7c, 0xff, 0xc6, 0xb0, 0xff, 0x0f, 0xff, 0xcf, 0x60, 0xff, 0xde, 0xff, 0x42, 0xff, 0x02, 0xff, 0x93, 0xfe, 0xff, + 0x7d, 0x4f, 0xff, 0x10, 0xb0, 0xff, 0x03, 0xff, 0xf3, 0xff, 0x1b, 0xff, 0x1e, 0xff, 0xaf, 0xff, 0x94, 0xff, 0x8e, 0xff, + 0x77, 0x50, 0xff, 0x66, 0xff, 0x65, 0xff, 0xfb, 0xff, 0xd9, 0xff, 0x0d, 0xff, 0xf8, 0xff, 0x36, 0xff, 0x0c, 0x30, 0xff, + 0xdc, 0x98, 0xff, 0xd1, 0x70, 0xff, 0x19, 0xff, 0xa8, 0xff, 0x87, 0xff, 0x97, 0xff, 0x39, 0x60, 0xff, 0x98, 0xff, 0x6c, + 0x68, 0xff, 0x5d, 0xff, 0xc1, 0xff, 0x09, 0xff, 0x7e, 0xe0, 0xff, 0xab, 0xff, 0xde, 0x60, 0xff, 0x1f, 0xff, 0x21, 0xff, + 0xd0, 0xff, 0x7a, 0xff, 0xaa, 0xff, 0xeb, 0xff, 0x96, 0xff, 0x60, 0xff, 0xf9, 0xff, 0x95, 0xff, 0xed, 0xff, 0x13, 0xff, + 0xf4, 0xff, 0x82, 0xff, 0xa9, 0xff, 0x94, 0x58, 0xff, 0xa8, 0xff, 0x5e, 0xff, 0xe2, 0xff, 0xca, 0xff, 0x08, 0xa0, 0xff, + 0xfe, 0xff, 0x9d, 0xb0, 0xff, 0x3f, 0xd0, 0x7d, 0xff, 0xd8, 0xf8, 0xd0, 0xff, 0xb0, 0xff, 0x84, 0xff, 0xd6, 0xff, 0x6a, + 0xff, 0xcb, 0xff, 0xc1, 0xff, 0xd4, 0xff, 0xd0, 0xff, 0xe8, 0xff, 0xe7, 0xff, 0xae, 0xff, 0x44, 0xff, 0x28, 0xff, 0x47, + 0xff, 0x75, 0xff, 0xa6, 0xff, 0x2a, 0xff, 0x40, 0xff, 0x0b, 0xff, 0x82, 0xff, 0x57, 0xff, 0xd5, 0xff, 0x49, 0xd0, 0xff, + 0x85, 0xff, 0x5c, 0xff, 0x92, 0xff, 0x95, 0xff, 0x6b, 0xff, 0x7d, 0xff, 0xbe, 0xff, 0xcc, 0xff, 0xb6, 0xff, 0x2d, 0xff, + 0x2b, 0xff, 0x71, 0xa0, 0xff, 0x63, 0xff, 0x39, 0xff, 0xfa, 0xff, 0xbc, 0xff, 0x19, 0xff, 0x7c, 0xff, 0xe2, 0xff, 0x3a, + 0xff, 0x81, 0xff, 0xf1, 0xff, 0x86, 0xff, 0x9e, 0xff, 0x46, 0xff, 0x3d, 0xff, 0x5f, 0x78, 0xff, 0xa4, 0xff, 0xb7, 0xff, + 0xd4, 0xff, 0x2c, 0xff, 0x98, 0x68, 0xff, 0xb5, 0xff, 0x95, 0xff, 0xac, 0xff, 0x33, 0x7d, 0xff, 0x1a, 0xff, 0x53, 0xff, + 0x9d, 0xff, 0xe3, 0xff, 0x4e, 0xff, 0x5d, 0xff, 0x4f, 0xff, 0x54, 0xff, 0x0d, 0xff, 0xe8, 0x60, 0xff, 0x32, 0xff, 0x25, + 0xff, 0x4d, 0xff, 0x5e, 0xff, 0x4c, 0xff, 0xe1, 0xff, 0xae, 0x00, 0xff, 0x85, 0xff, 0x1e, 0xff, 0xc4, 0xff, 0x20, 0xff, + 0xdf, 0xff, 0x73, 0xd8, 0xff, 0x81, 0xff, 0x40, 0xff, 0xa2, 0x10, 0xff, 0x75, 0xa8, 0xff, 0x1d, 0xf8, 0xff, 0x7c, 0xff, + 0x1f, 0xff, 0x07, 0xff, 0xe5, 0xff, 0x9e, 0xff, 0x76, 0xff, 0x9f, 0xff, 0x42, 0xff, 0xeb, 0x50, 0xff, 0xb4, 0xff, 0xd3, + 0xff, 0xcb, 0xff, 0x55, 0xff, 0xe8, 0xff, 0xbf, 0xff, 0xf7, 0xb8, 0x70, 0xff, 0x2d, 0xff, 0xa5, 0xff, 0xfd, 0xff, 0xda, + 0x98, 0xff, 0x5b, 0x40, 0xff, 0xa8, 0xff, 0xd2, 0x60, 0xff, 0xdf, 0xff, 0xd9, 0xff, 0xf2, 0xff, 0x35, 0xff, 0xc6, 0xff, + 0x0c, 0x7d, 0xff, 0x36, 0xff, 0x66, 0xff, 0x28, 0xff, 0x95, 0xff, 0xe2, 0xff, 0x34, 0xff, 0x64, 0xff, 0xea, 0xff, 0xaf, + 0xff, 0x3a, 0xb0, 0xff, 0x3c, 0xff, 0x38, 0xff, 0x31, 0xff, 0x99, 0xff, 0x8d, 0xff, 0x80, 0xff, 0x78, 0xff, 0x18, 0xff, + 0x48, 0xff, 0x2c, 0xff, 0xe9, 0xff, 0xe5, 0xff, 0xb7, 0xff, 0xe6, 0xff, 0x2e, 0xff, 0x73, 0xff, 0xf1, 0xff, 0x7c, 0xff, + 0x84, 0xff, 0x21, 0xff, 0x04, 0xff, 0x00, 0xff, 0x8e, 0xff, 0x12, 0xff, 0x66, 0xff, 0x6c, 0xff, 0x9b, 0xff, 0x09, 0xff, + 0x88, 0xff, 0xe2, 0xff, 0xd5, 0xff, 0xec, 0xff, 0xb4, 0xff, 0xdd, 0xff, 0x2b, 0xff, 0xda, 0xff, 0x29, 0xff, 0x6f, 0xff, + 0x1b, 0xff, 0x81, 0x58, 0xff, 0xe4, 0xff, 0x5c, 0xff, 0x36, 0x18, 0xff, 0x2d, 0xff, 0x9d, 0x90, 0xff, 0xb6, 0xff, 0x69, + 0x08, 0xff, 0x40, 0xff, 0x4e, 0xff, 0x70, 0xff, 0x27, 0xde, 0xb8, 0xff, 0x0c, 0xff, 0x17, 0xff, 0x1d, 0xff, 0x15, 0x40, + 0xff, 0x5b, 0xff, 0xd0, 0xff, 0x66, 0xff, 0x72, 0xff, 0xb8, 0xff, 0x38, 0xff, 0x80, 0xff, 0xbe, 0xff, 0x9e, 0xff, 0xd7, + 0xff, 0x5e, 0xff, 0xb5, 0xb8, 0xff, 0x22, 0xff, 0xbc +}; + +extern const uint8 rotatedata[] = { + 0x03, 0x00, 0x04, 0x00, 0x00, 0x74, 0xbc, 0x6c, 0xc5, 0x7f, 0x2f, 0xcd, 0x07, 0x89, 0x65, 0x9b, 0x42, 0xaf, 0x43, 0x3e, + 0xa6, 0x97, 0x7d, 0xc3, 0x2d, 0x52, 0x02, 0xf0, 0x40, 0x7e, 0xcf, 0x17, 0xd6, 0x02, 0x9e, 0x2f, 0x9e, 0xd3, 0x3c, 0x15, + 0xca, 0x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0x26, 0xcc, 0x1b, 0x04, 0x0f, + 0x0c, 0x90, 0x61, 0x3d, 0xf2, 0x6f, 0x37, 0xc5, 0xb9, 0xe3, 0xe3, 0x90, 0x90, 0x08, 0x00, 0xd1, 0x09, 0xcc, 0x63, 0x73, + 0x84, 0x11, 0x17, 0xba, 0x76, 0x69, 0xee, 0x65, 0x6d, 0x52, 0x7b, 0x63, 0xc0, 0x42, 0x27, 0x8b, 0x1b, 0xe6, 0x69, 0xb3, + 0xee, 0x6d, 0x4b, 0x24, 0x20, 0x9c, 0x83, 0xdb, 0xce, 0x18, 0xb8, 0xa3, 0x8a, 0x52, 0xda, 0x1a, 0x33, 0xe4, 0xc5, 0x07, + 0x40, 0x7d, 0xf4, 0xfa, 0x2f, 0x6b, 0x93, 0x44, 0x5e +}; From 729934193c389869a776c31ea4f461c9dc9efcfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 29 Nov 2016 23:57:30 +0100 Subject: [PATCH 06/26] Improve tests' CMakeLists.txt --- test/tests/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt index 977522fef2..a16f70fc9d 100644 --- a/test/tests/CMakeLists.txt +++ b/test/tests/CMakeLists.txt @@ -36,12 +36,12 @@ set(GTEST_INCLUDE_DIR ${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest/include) # Library ExternalProject_Get_Property(googletest BINARY_DIR) set(GOOGLETEST_BINARY_DIR "${BINARY_DIR}") -set(GTEST_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a) -set(GTEST_MAIN_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a) +set(GTEST_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GTEST_MAIN_LIBRARY_PATH ${GOOGLETEST_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}) set(GTEST_LIBRARY gtest) set(GTEST_MAIN_LIBRARY gtest_main) -add_library(${GTEST_LIBRARY} UNKNOWN IMPORTED) -add_library(${GTEST_MAIN_LIBRARY} UNKNOWN IMPORTED) +add_library(${GTEST_LIBRARY} STATIC IMPORTED) +add_library(${GTEST_MAIN_LIBRARY} STATIC IMPORTED) set_property(TARGET ${GTEST_LIBRARY} PROPERTY IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}) set_property(TARGET ${GTEST_MAIN_LIBRARY} PROPERTY IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}) add_dependencies(${GTEST_LIBRARY} googletest) From e3a3cf375d39297b4c729078fd8bd1314a30e0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 30 Nov 2016 11:51:55 +0100 Subject: [PATCH 07/26] Add LanguagePackTest --- test/tests/CMakeLists.txt | 29 ++++++++++++++--- test/tests/LanguagePackTest.cpp | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 test/tests/LanguagePackTest.cpp diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt index a16f70fc9d..8d2c6650ff 100644 --- a/test/tests/CMakeLists.txt +++ b/test/tests/CMakeLists.txt @@ -48,13 +48,32 @@ add_dependencies(${GTEST_LIBRARY} googletest) add_dependencies(${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY}) include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) +include_directories("../../src") + +set(GTEST_LIBRARIES gtest gtest_main pthread) # Start of our tests +# sawyercoding test + set(SAWYERCODING_TEST_SOURCES "sawyercoding_test.cpp" "../../src/diagnostic.c" "../../src/util/sawyercoding.c" "../../src/localisation/utf8.c") -set (CMAKE_CXX_STANDARD 11) add_executable(test_sawyercoding ${SAWYERCODING_TEST_SOURCES}) -target_link_libraries(test_sawyercoding gtest gtest_main pthread) -target_include_directories(test_sawyercoding PUBLIC "../../src") -add_test(NAME sawyercoding - COMMAND test_sawyercoding) +target_link_libraries(test_sawyercoding ${GTEST_LIBRARIES}) +add_test(NAME sawyercoding COMMAND test_sawyercoding) + +# LanguagePack test +set(LANGUAGEPACK_TEST_SOURCES + "LanguagePackTest.cpp" + "../../src/localisation/LanguagePack.cpp" + "../../src/core/Console.cpp" + "../../src/core/Diagnostics.cpp" + "../../src/core/Guard.cpp" + "../../src/core/String.cpp" + "../../src/diagnostic.c" + "../../src/localisation/format_codes.c" + "../../src/localisation/utf8.c" + "../../src/util/util.c" + ) +add_executable(test_languagepack ${LANGUAGEPACK_TEST_SOURCES}) +target_link_libraries(test_languagepack ${GTEST_LIBRARIES} dl z SDL2 SDL2_ttf ssl crypto) +add_test(NAME languagepack COMMAND test_languagepack) \ No newline at end of file diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp new file mode 100644 index 0000000000..598a7e3558 --- /dev/null +++ b/test/tests/LanguagePackTest.cpp @@ -0,0 +1,55 @@ +#include "localisation/LanguagePack.h" +#include + +TEST(LanguagePackTest, create_empty) +{ + ILanguagePack * empty = LanguagePackFactory::FromText(0, ""); + ASSERT_EQ(empty->GetId(), 0); + ASSERT_EQ(empty->GetCount(), 0); + delete empty; +} + +TEST(LanguagePackTest, create_mutable_id_1) +{ + ILanguagePack * lang = LanguagePackFactory::FromText(1, "STR_0000:\n"); + ASSERT_EQ(lang->GetId(), 1); + ASSERT_EQ(lang->GetCount(), 1); + ASSERT_STREQ(lang->GetString(0), ""); + lang->SetString(0, "xx"); + ASSERT_EQ(lang->GetCount(), 1); + ASSERT_STREQ(lang->GetString(0), "xx"); + delete lang; +} + +extern const utf8 * LanguageEnGB; + +TEST(LanguagePackTest, language_pack_simple) +{ + ILanguagePack * lang = LanguagePackFactory::FromText(0, LanguageEnGB); + ASSERT_EQ(lang->GetId(), 0); + ASSERT_EQ(lang->GetCount(), 4); + ASSERT_STREQ(lang->GetString(2), "Spiral Roller Coaster"); + ASSERT_EQ(lang->GetScenarioOverrideStringId("Arid Heights", 0), 0x7000); + ASSERT_STREQ(lang->GetString(0x7000), "Arid Heights scenario string"); + ASSERT_EQ(lang->GetObjectOverrideStringId("CONDORRD", 0), 0x6000); + ASSERT_STREQ(lang->GetString(0x6000), "my test ride"); + delete lang; +} + +const utf8 * LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string id number.\n" + "# Everything after the colon and before the new line will be saved as the " + "string.\n" + "# Use # at the beginning of a line to leave a comment.\n" + "STR_0000 :\n" + "STR_0001 :{STRINGID} {COMMA16}\n" + "STR_0002 :Spiral Roller Coaster\n" + "STR_0003 :Stand-up Roller Coaster\n" + "\n" + "STR_SCNR :Arid Heights scenario string\n" + "STR_PARK :Arid Heights park string\n" + "STR_DTLS :Free of any financial limits, your challenge is to develop " + "this desert park while keeping the guests happy\n" + "[CONDORRD]\n" + "STR_NAME :my test ride\n" + "STR_DESC :ride description\n" + "STR_CPTY :ride capacity\n"; From a2d30ac40517008c07cf884bfe0b4885efc365a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 1 Dec 2016 23:21:35 +0100 Subject: [PATCH 08/26] Add multibyte LanguagePack test --- test/tests/LanguagePackTest.cpp | 48 ++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index 598a7e3558..6d6e0263c2 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -21,7 +21,8 @@ TEST(LanguagePackTest, create_mutable_id_1) delete lang; } -extern const utf8 * LanguageEnGB; +extern const utf8 * LanguageEnGB; +extern const unsigned char LanguageZhTW[]; TEST(LanguagePackTest, language_pack_simple) { @@ -36,6 +37,21 @@ TEST(LanguagePackTest, language_pack_simple) delete lang; } +TEST(LanguagePackTest, language_pack_multibyte) +{ + ILanguagePack * lang = LanguagePackFactory::FromText(0, (const utf8 *)LanguageZhTW); + ASSERT_EQ(lang->GetId(), 0); + ASSERT_EQ(lang->GetCount(), 4); + ASSERT_STREQ(lang->GetString(2), u8"懸吊式雲霄飛車"); + ASSERT_EQ(lang->GetScenarioOverrideStringId("Forest Frontiers", 0), 0x7000); + ASSERT_EQ(lang->GetScenarioOverrideStringId("Forest Frontiers", 2), 0x7002); + ASSERT_STREQ(lang->GetString(0x7000), "Forest Frontiers"); + ASSERT_STREQ(lang->GetString(0x7002), u8"在隱藏於森林深處的清空範圍中, 建造一個很受歡迎的樂園"); + ASSERT_EQ(lang->GetObjectOverrideStringId("CONDORRD", 0), 0x6000); + ASSERT_STREQ(lang->GetString(0x6000), u8"神鷹暢遊"); + delete lang; +} + const utf8 * LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string id number.\n" "# Everything after the colon and before the new line will be saved as the " "string.\n" @@ -53,3 +69,33 @@ const utf8 * LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string "STR_NAME :my test ride\n" "STR_DESC :ride description\n" "STR_CPTY :ride capacity\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 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, 0xe9, 0x9a, 0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, 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 +}; \ No newline at end of file From 86a336dd3d71947fe2e3fb544a28dd89f4e0714b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 1 Dec 2016 23:28:01 +0100 Subject: [PATCH 09/26] Extend LanguagePack test with negative tests --- test/tests/LanguagePackTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index 6d6e0263c2..355f881746 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -1,4 +1,5 @@ #include "localisation/LanguagePack.h" +#include "localisation/string_ids.h" #include 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 -}; \ No newline at end of file +}; From a08af1a2537a2b1df386cd138c4a424c50fbc6cc Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 00:34:14 +0000 Subject: [PATCH 10/26] Get tests to build for Windows and VS --- openrct2.sln | 14 +++++ openrct2.vcxproj | 8 ++- src/platform/windows.c | 2 +- test/tests/sawyercoding_test.cpp | 3 + test/tests/tests.cpp | 13 ++++ test/tests/tests.vcxproj | 101 +++++++++++++++++++++++++++++++ 6 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 test/tests/tests.cpp create mode 100644 test/tests/tests.vcxproj diff --git a/openrct2.sln b/openrct2.sln index a9f6803221..37c5ec1170 100644 --- a/openrct2.sln +++ b/openrct2.sln @@ -7,6 +7,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2", "openrct2.vcxpro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpaint", "test\testpaint\testpaint.vcxproj", "{57E60BA1-FB76-4316-909E-C1449C142327}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "test\tests\tests.vcxproj", "{62B020FA-E4FB-4C6E-B32A-DC999470F155}" + ProjectSection(ProjectDependencies) = postProject + {D24D94F6-2A74-480C-B512-629C306CE92F} = {D24D94F6-2A74-480C-B512-629C306CE92F} + EndProjectSection +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2202A816-377D-4FA0-A7AF-7D4105F8A4FB}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{480B577D-4E4A-4757-9A42-28A9AD33E6B0}" @@ -33,6 +38,14 @@ Global {57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.ActiveCfg = Release|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.Build.0 = Release|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Release|x64.ActiveCfg = Release|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = Debug|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.Build.0 = Debug|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = Debug|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.Build.0 = Debug|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = Release|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.Build.0 = Release|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = Release|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -40,5 +53,6 @@ Global GlobalSection(NestedProjects) = preSolution {D24D94F6-2A74-480C-B512-629C306CE92F} = {2202A816-377D-4FA0-A7AF-7D4105F8A4FB} {57E60BA1-FB76-4316-909E-C1449C142327} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0} + {62B020FA-E4FB-4C6E-B32A-DC999470F155} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0} EndGlobalSection EndGlobal diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 2e3bfde9eb..202974fbd1 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -563,6 +563,9 @@ true MultiByte + + StaticLibrary + @@ -600,9 +603,10 @@ $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ $(ProjectName) - + - USE_BREAKPAD;%(PreprocessorDefinitions) + USE_BREAKPAD;%(PreprocessorDefinitions) + __NOENTRYPOINT__;%(PreprocessorDefinitions) diff --git a/src/platform/windows.c b/src/platform/windows.c index bdeb7abd57..8fda6936cd 100644 --- a/src/platform/windows.c +++ b/src/platform/windows.c @@ -52,7 +52,7 @@ utf8 **windows_get_command_line_args(int *outNumArgs); static HMODULE _dllModule = NULL; -#ifdef NO_RCT2 +#if defined(NO_RCT2) && !defined(__NOENTRYPOINT__) /** * Windows entry point to OpenRCT2 without a console window. diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index 2dce17f261..c7105416c5 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -1,3 +1,6 @@ +// Make MSVC shut up about M_PI +#include + extern "C" { #include "util/sawyercoding.h" } diff --git a/test/tests/tests.cpp b/test/tests/tests.cpp new file mode 100644 index 0000000000..bba7cb7be3 --- /dev/null +++ b/test/tests/tests.cpp @@ -0,0 +1,13 @@ +// This serves as the entry point when building for MSVC which compiles gtest +// directly into the test binary. +#ifdef _MSC_VER + +#include + +int main(int argc, char * * argv) +{ + testing::InitGoogleTest(&argc, argv); + RUN_ALL_TESTS(); +} + +#endif diff --git a/test/tests/tests.vcxproj b/test/tests/tests.vcxproj new file mode 100644 index 0000000000..01c1504b55 --- /dev/null +++ b/test/tests/tests.vcxproj @@ -0,0 +1,101 @@ + + + + ..\..\ + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {62B020FA-E4FB-4C6E-B32A-DC999470F155} + tests + + + + + Application + true + MultiByte + + + Application + false + true + MultiByte + + + + + + + + + + + $(SolutionDir)bin\tests\ + $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ + tests + $(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) + $(SolutionDir)bin;$(SolutionDir)lib;$(LibraryPath) + + + + Level3 + Disabled + true + DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + true + true + 4200 + true + false + + + openrct2.lib;openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) + /OPT:NOLBR /ignore:4099 %(AdditionalOptions) + + + + + Level3 + MaxSpeed + true + true + true + DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + true + 4200 + true + + + true + true + openrct2.lib;%(AdditionalDependencies) + + + + + + + + + + + + \ No newline at end of file From 91e19c7d48cc1e2596e43f217a1a62a634fd43a7 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 00:59:52 +0000 Subject: [PATCH 11/26] Move a lot of the common properties to a shared props file --- openrct2.common.props | 87 ++++++++++++++++++++ openrct2.vcxproj | 171 +++------------------------------------ test/tests/tests.vcxproj | 66 +++------------ 3 files changed, 106 insertions(+), 218 deletions(-) diff --git a/openrct2.common.props b/openrct2.common.props index 10103679d6..eaa0b37966 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -1,8 +1,95 @@ + + ..\..\ + + + + $(DefaultPlatformToolset) $(UCRTVersion) + + MultiByte + + $(SolutionDir)bin\ + $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ + $(ProjectName) + + + true + + + + false + true + + + + $(SolutionDir)bin\ + $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ + + $(ProjectName) + + + $(SolutionDir)bin\ + $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ + $(ProjectName) + + + + + 4091;%(DisableSpecificWarnings) + Level3 + OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + true + 4013 + true + + + openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) + /OPT:NOLBR /ignore:4099 %(AdditionalOptions) + + + PerMonitorHighDPIAware + + + + + Disabled + true + DEBUG;%(PreprocessorDefinitions) + false + + + true + UseFastLinkTimeCodeGeneration + + + + + Full + true + true + + + false + %(PreprocessorDefinitions) + Speed + + + true + true + true + + + + + + + $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) + $(SolutionDir)lib;$(LibraryPath) diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 202974fbd1..c1bf2508e9 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -18,6 +18,7 @@ x64 + @@ -540,185 +541,31 @@ openrct2 openrct2 - - - + + Application + + + DynamicLibrary - true - MultiByte - - - Application - false - true - MultiByte - - - Application - true - MultiByte - - - false - true - MultiByte StaticLibrary - - - - - - - - - - - $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) - $(SolutionDir)lib;$(LibraryPath) - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - - - - $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) - $(SolutionDir)lib;$(LibraryPath) - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - - - $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) - $(SolutionDir)lib;$(LibraryPath) - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - - $(ProjectName) - - - $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) - $(SolutionDir)lib;$(LibraryPath) - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - $(ProjectName) - + USE_BREAKPAD;%(PreprocessorDefinitions) __NOENTRYPOINT__;%(PreprocessorDefinitions) - + - 4091;%(DisableSpecificWarnings) - Level3 - Disabled - true - DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreaded - true $(IntDir)\%(RelativeDir) - 4013 - false - true $(OPENRCT2_CL_ADDITIONALOPTIONS) - true - openrct2-libs-vs2015-x86.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) - UseFastLinkTimeCodeGeneration - /OPT:NOLBR /ignore:4099 %(AdditionalOptions) + Console - - - 4091;%(DisableSpecificWarnings) - Level3 - Full - true - true - - MultiThreaded - 4013 - - false - NO_RCT2;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;%(PreprocessorDefinitions) - $(IntDir)\%(RelativeDir) - true - Speed - true - $(OPENRCT2_CL_ADDITIONALOPTIONS) - - - true - true - true - openrct2-libs-vs2015-x86.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) - /ignore:4099 %(AdditionalOptions) - Windows - - - PerMonitorHighDPIAware - - - - - 4091;%(DisableSpecificWarnings) - Level3 - Disabled - true - DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreaded - true - $(IntDir)\%(RelativeDir) - 4013 - false - true - $(OPENRCT2_CL_ADDITIONALOPTIONS) - - - true - openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) - UseFastLinkTimeCodeGeneration - /OPT:NOLBR /ignore:4099 %(AdditionalOptions) - Console - - - PerMonitorHighDPIAware - - - - - 4091;%(DisableSpecificWarnings) - Level3 - Full - true - true - - MultiThreaded - 4013 - - false - OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;%(PreprocessorDefinitions) - $(IntDir)\%(RelativeDir) - true - Speed - true - $(OPENRCT2_CL_ADDITIONALOPTIONS) - - - true - true - true - openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) - /ignore:4099 %(AdditionalOptions) - Windows - - - PerMonitorHighDPIAware - - - \ No newline at end of file diff --git a/test/tests/tests.vcxproj b/test/tests/tests.vcxproj index 01c1504b55..bfc423ffc0 100644 --- a/test/tests/tests.vcxproj +++ b/test/tests/tests.vcxproj @@ -24,71 +24,24 @@ {62B020FA-E4FB-4C6E-B32A-DC999470F155} tests + tests + + + Application - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - - - - - - - $(SolutionDir)bin\tests\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ - tests - $(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) - $(SolutionDir)bin;$(SolutionDir)lib;$(LibraryPath) + $(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(IncludePath) + $(SolutionDir)bin;$(LibraryPath) - - - Level3 - Disabled - true - DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreaded - true - true - 4200 - true - false - + - openrct2.lib;openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) - /OPT:NOLBR /ignore:4099 %(AdditionalOptions) - - - - - Level3 - MaxSpeed - true - true - true - DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - true - 4200 - true - - - true - true openrct2.lib;%(AdditionalDependencies) + + @@ -97,5 +50,6 @@ + \ No newline at end of file From fab8dce9ccaf0c136137f62e7949dfc84d93e344 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 01:00:57 +0000 Subject: [PATCH 12/26] Move file listing to the bottom of openrct2.vcxproj --- openrct2.vcxproj | 64 +++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/openrct2.vcxproj b/openrct2.vcxproj index c1bf2508e9..dcd7a97007 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -18,6 +18,38 @@ x64 + + {D24D94F6-2A74-480C-B512-629C306CE92F} + openrct2 + openrct2 + + + Application + + + + DynamicLibrary + + + StaticLibrary + + + + + USE_BREAKPAD;%(PreprocessorDefinitions) + __NOENTRYPOINT__;%(PreprocessorDefinitions) + + + + + $(IntDir)\%(RelativeDir) + $(OPENRCT2_CL_ADDITIONALOPTIONS) + + + Console + + + @@ -536,36 +568,6 @@ - - {D24D94F6-2A74-480C-B512-629C306CE92F} - openrct2 - openrct2 - - - Application - - - - DynamicLibrary - - - StaticLibrary - - - - - USE_BREAKPAD;%(PreprocessorDefinitions) - __NOENTRYPOINT__;%(PreprocessorDefinitions) - - - - - $(IntDir)\%(RelativeDir) - $(OPENRCT2_CL_ADDITIONALOPTIONS) - - - Console - - + \ No newline at end of file From 4ccb50409b37a56cfd0c04dfaa74bba1676c957f Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 02:49:50 +0000 Subject: [PATCH 13/26] Add test configurations --- openrct2.common.props | 37 ++++++++++++++++++------------------- openrct2.sln | 37 ++++++++++++++++++++++++++++--------- openrct2.vcxproj | 25 ++++++++++++++++++++++--- test/tests/tests.vcxproj | 19 ++++++++++--------- 4 files changed, 78 insertions(+), 40 deletions(-) diff --git a/openrct2.common.props b/openrct2.common.props index eaa0b37966..9f6b6b38de 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -2,6 +2,8 @@ ..\..\ + Debug + Release @@ -14,30 +16,17 @@ MultiByte $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ + $(SolutionDir)obj\$(ProjectName)\$(Config)_$(Platform)\ $(ProjectName) - + true - - + false true - - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - - $(ProjectName) - - - $(SolutionDir)bin\ - $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ - $(ProjectName) - - 4091;%(DisableSpecificWarnings) @@ -49,14 +38,16 @@ true - openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) + imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) + openrct2-libs-vs2015-x86.lib;%(AdditionalDependencies) + openrct2-libs-vs2015-x64.lib;%(AdditionalDependencies) /OPT:NOLBR /ignore:4099 %(AdditionalOptions) PerMonitorHighDPIAware - + Disabled true @@ -68,7 +59,7 @@ UseFastLinkTimeCodeGeneration - + Full true @@ -86,10 +77,18 @@ + + + + NO_RCT2;%(PreprocessorDefinitions) + + + $(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) + diff --git a/openrct2.sln b/openrct2.sln index 37c5ec1170..df162fe6a2 100644 --- a/openrct2.sln +++ b/openrct2.sln @@ -20,32 +20,51 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + DebugTests|Win32 = DebugTests|Win32 + DebugTests|x64 = DebugTests|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 + ReleaseTests|Win32 = ReleaseTests|Win32 + ReleaseTests|x64 = ReleaseTests|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.ActiveCfg = Debug|Win32 {D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.Build.0 = Debug|Win32 {D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.ActiveCfg = Debug|x64 {D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.Build.0 = Debug|x64 + {D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.ActiveCfg = DebugTests|Win32 + {D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.Build.0 = DebugTests|Win32 + {D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.ActiveCfg = DebugTests|x64 + {D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.Build.0 = DebugTests|x64 {D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.ActiveCfg = Release|Win32 {D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.Build.0 = Release|Win32 {D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.ActiveCfg = Release|x64 {D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.Build.0 = Release|x64 + {D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32 + {D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32 + {D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64 + {D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.Build.0 = ReleaseTests|x64 {57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.ActiveCfg = Debug|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.Build.0 = Debug|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Debug|x64.ActiveCfg = Debug|Win32 + {57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|Win32.ActiveCfg = Debug|Win32 + {57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|x64.ActiveCfg = Debug|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.ActiveCfg = Release|Win32 - {57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.Build.0 = Release|Win32 {57E60BA1-FB76-4316-909E-C1449C142327}.Release|x64.ActiveCfg = Release|Win32 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = Debug|Win32 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.Build.0 = Debug|Win32 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = Debug|x64 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.Build.0 = Debug|x64 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = Release|Win32 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.Build.0 = Release|Win32 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = Release|x64 - {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.Build.0 = Release|x64 + {57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|Win32.ActiveCfg = Release|Win32 + {57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|x64.ActiveCfg = Release|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = DebugTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = DebugTests|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.ActiveCfg = DebugTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.Build.0 = DebugTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.ActiveCfg = DebugTests|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.Build.0 = DebugTests|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = ReleaseTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = ReleaseTests|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64 + {62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.Build.0 = ReleaseTests|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/openrct2.vcxproj b/openrct2.vcxproj index dcd7a97007..9384c8ff90 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -1,5 +1,8 @@  + + .\ + Debug @@ -9,6 +12,14 @@ Debug x64 + + DebugTests + Win32 + + + DebugTests + x64 + Release Win32 @@ -17,6 +28,14 @@ Release x64 + + ReleaseTests + Win32 + + + ReleaseTests + x64 + {D24D94F6-2A74-480C-B512-629C306CE92F} @@ -30,14 +49,14 @@ DynamicLibrary - + StaticLibrary - + USE_BREAKPAD;%(PreprocessorDefinitions) - __NOENTRYPOINT__;%(PreprocessorDefinitions) + __NOENTRYPOINT__;%(PreprocessorDefinitions) diff --git a/test/tests/tests.vcxproj b/test/tests/tests.vcxproj index bfc423ffc0..683615e359 100644 --- a/test/tests/tests.vcxproj +++ b/test/tests/tests.vcxproj @@ -4,20 +4,20 @@ ..\..\ - - Debug + + DebugTests Win32 - - Release + + ReleaseTests Win32 - - Debug + + DebugTests x64 - - Release + + ReleaseTests x64 @@ -29,7 +29,7 @@ Application - + $(SolutionDir)bin\tests\ $(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(IncludePath) @@ -38,6 +38,7 @@ openrct2.lib;%(AdditionalDependencies) + Console From 872976bff4e5851e816f222c217b34a950993da2 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 10:49:58 +0000 Subject: [PATCH 14/26] Force UTF-8 compile and fix manifest DPI --- openrct2.common.props | 10 +++++++--- openrct2.vcxproj | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openrct2.common.props b/openrct2.common.props index 9f6b6b38de..72eb374c7c 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -36,6 +36,7 @@ true 4013 true + /utf-8 imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies) @@ -43,9 +44,6 @@ openrct2-libs-vs2015-x64.lib;%(AdditionalDependencies) /OPT:NOLBR /ignore:4099 %(AdditionalOptions) - - PerMonitorHighDPIAware - @@ -91,4 +89,10 @@ $(SolutionDir)lib;$(LibraryPath) + + + + PerMonitorHighDPIAware + + diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 9384c8ff90..098d5abc10 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -62,7 +62,7 @@ $(IntDir)\%(RelativeDir) - $(OPENRCT2_CL_ADDITIONALOPTIONS) + $(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions) Console From d26e1df21e75becdd7a3d9c51bfd7f563c154512 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 13:36:03 +0000 Subject: [PATCH 15/26] Automatically download googletest --- openrct2.proj | 11 +++++++++++ test/tests/tests.vcxproj | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/openrct2.proj b/openrct2.proj index 8917009a18..a10de00194 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -65,6 +65,8 @@ https://github.com/OpenRCT2/Dependencies/releases/download/v$(TargetLibsVersion)/openrct2-libs-vs2015.zip $(RootDir)lib\ $(LibsPath)libversion + 1.8.0 + https://github.com/google/googletest/archive/release-$(GtestVersion).zip @@ -122,6 +124,7 @@ $(LibsPath)openrct2-libs-vs2015.zip + $(LibsPath)gtest.zip @@ -129,10 +132,18 @@ + + + + + + + + diff --git a/test/tests/tests.vcxproj b/test/tests/tests.vcxproj index 683615e359..3e42ab8e4a 100644 --- a/test/tests/tests.vcxproj +++ b/test/tests/tests.vcxproj @@ -2,6 +2,7 @@ ..\..\ + $(SolutionDir)lib\googletest\googletest @@ -32,7 +33,7 @@ $(SolutionDir)bin\tests\ - $(GTestDir)\googletest;$(GTestDir)\googletest\include;$(SolutionDir)src;$(IncludePath) + $(GtestDir);$(GtestDir)\include;$(SolutionDir)src;$(IncludePath) $(SolutionDir)bin;$(LibraryPath) @@ -48,7 +49,7 @@ - + From 05737fdd74aea2a397288675e93c80ed76e9aa03 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 14:42:40 +0000 Subject: [PATCH 16/26] Add test target --- openrct2.proj | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/openrct2.proj b/openrct2.proj index a10de00194..ee68eea4b4 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -55,7 +55,6 @@ OpenRCT2-$(Version)$(VersionExtra)-windows-$(Platform.ToLower()) - Configuration=$(Configuration) $(SlnProperties);Platform=$(Platform) $(SlnProperties);OPENRCT2_CL_ADDITIONALOPTIONS=$(OPENRCT2_CL_ADDITIONALOPTIONS) @@ -149,6 +148,9 @@ + + $(SlnProperties);Configuration=$(Configuration) + @@ -180,15 +182,33 @@ + + $(SlnProperties);Configuration=$(Configuration) + + + $(SlnProperties);Configuration=$(Configuration) + + + + DebugTests + ReleaseTests + $(SlnProperties);Configuration=$(Configuration) + + + + - + + + + From 9c973e20cdf45747d53e82981deee70ce7f0dba8 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 14:54:07 +0000 Subject: [PATCH 17/26] Run tests on AppVeyor --- appveyor.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5e8110ac26..b8ebe79a07 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,9 +19,16 @@ install: platform: - Win32 - x64 -configuration: Release +configuration: + - Release + - ReleaseTests build: project: openrct2.proj +test_script: +- ps: >- + if ($env:configuration -eq "ReleaseTests") { + msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + } artifacts: - path: .\artifacts\openrct2-portable*.zip name: OpenRCT2-portable From 756e26ad452479f9740f1112891cbbba23476c13 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 17:16:12 +0000 Subject: [PATCH 18/26] Fix main function --- test/tests/sawyercoding_test.cpp | 2 +- test/tests/tests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index c7105416c5..5e9120a29a 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -1,5 +1,5 @@ // Make MSVC shut up about M_PI -#include +#include extern "C" { #include "util/sawyercoding.h" diff --git a/test/tests/tests.cpp b/test/tests/tests.cpp index bba7cb7be3..4190c4fa39 100644 --- a/test/tests/tests.cpp +++ b/test/tests/tests.cpp @@ -6,8 +6,8 @@ int main(int argc, char * * argv) { - testing::InitGoogleTest(&argc, argv); - RUN_ALL_TESTS(); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } #endif From 433207dc81cd5738d41673b1c3384c1c409276ed Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 17:16:26 +0000 Subject: [PATCH 19/26] Do not assert when testing --- openrct2.common.props | 10 ++++++++++ src/core/Guard.cpp | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/openrct2.common.props b/openrct2.common.props index 72eb374c7c..64d144e987 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -74,6 +74,16 @@ true + + + __TEST__;%(PreprocessorDefinitions) + + + + + NDEBUG;__TEST__;%(PreprocessorDefinitions) + + diff --git a/src/core/Guard.cpp b/src/core/Guard.cpp index 2b6518aa39..479f976104 100644 --- a/src/core/Guard.cpp +++ b/src/core/Guard.cpp @@ -78,7 +78,9 @@ namespace Guard char *bufend = (char *)strchr(buffer, 0); vsnprintf(bufend, sizeof(buffer) - (bufend - buffer), message, args); } - int result = MessageBox(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); + // Only show message box if we are not building for testing +#ifndef __TEST__ + int result = MessageBoxA(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); if (result == IDABORT) { #ifdef USE_BREAKPAD @@ -88,6 +90,7 @@ namespace Guard assert(false); #endif } +#endif #else assert(false); #endif From 28098776b2b90e91629a89879314c3246bdd9f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 2 Dec 2016 21:58:46 +0100 Subject: [PATCH 20/26] Convert tests to class + fixtures This makes test data not require `extern` --- test/tests/LanguagePackTest.cpp | 54 ++++++++-------- test/tests/sawyercoding_test.cpp | 103 ++++++++++++++++--------------- 2 files changed, 82 insertions(+), 75 deletions(-) diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index 355f881746..80bce82760 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -2,7 +2,14 @@ #include "localisation/string_ids.h" #include -TEST(LanguagePackTest, create_empty) +class LanguagePackTest : public testing::Test +{ +protected: + static const utf8 * LanguageEnGB; + static const unsigned char LanguageZhTW[]; +}; + +TEST_F(LanguagePackTest, create_empty) { ILanguagePack * empty = LanguagePackFactory::FromText(0, ""); ASSERT_EQ(empty->GetId(), 0); @@ -10,7 +17,7 @@ TEST(LanguagePackTest, create_empty) delete empty; } -TEST(LanguagePackTest, create_mutable_id_1) +TEST_F(LanguagePackTest, create_mutable_id_1) { ILanguagePack * lang = LanguagePackFactory::FromText(1, "STR_0000:\n"); ASSERT_EQ(lang->GetId(), 1); @@ -22,10 +29,7 @@ TEST(LanguagePackTest, create_mutable_id_1) delete lang; } -extern const utf8 * LanguageEnGB; -extern const unsigned char LanguageZhTW[]; - -TEST(LanguagePackTest, language_pack_simple) +TEST_F(LanguagePackTest, language_pack_simple) { ILanguagePack * lang = LanguagePackFactory::FromText(0, LanguageEnGB); ASSERT_EQ(lang->GetId(), 0); @@ -42,7 +46,7 @@ TEST(LanguagePackTest, language_pack_simple) delete lang; } -TEST(LanguagePackTest, language_pack_multibyte) +TEST_F(LanguagePackTest, language_pack_multibyte) { ILanguagePack * lang = LanguagePackFactory::FromText(0, (const utf8 *)LanguageZhTW); ASSERT_EQ(lang->GetId(), 0); @@ -57,27 +61,27 @@ TEST(LanguagePackTest, language_pack_multibyte) delete lang; } -const utf8 * LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string id number.\n" - "# Everything after the colon and before the new line will be saved as the " - "string.\n" - "# Use # at the beginning of a line to leave a comment.\n" - "STR_0000 :\n" - "STR_0001 :{STRINGID} {COMMA16}\n" - "STR_0002 :Spiral Roller Coaster\n" - "STR_0003 :Stand-up Roller Coaster\n" - "\n" - "STR_SCNR :Arid Heights scenario string\n" - "STR_PARK :Arid Heights park string\n" - "STR_DTLS :Free of any financial limits, your challenge is to develop " - "this desert park while keeping the guests happy\n" - "[CONDORRD]\n" - "STR_NAME :my test ride\n" - "STR_DESC :ride description\n" - "STR_CPTY :ride capacity\n"; +const utf8 * LanguagePackTest::LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string id number.\n" + "# Everything after the colon and before the new line will be saved as the " + "string.\n" + "# Use # at the beginning of a line to leave a comment.\n" + "STR_0000 :\n" + "STR_0001 :{STRINGID} {COMMA16}\n" + "STR_0002 :Spiral Roller Coaster\n" + "STR_0003 :Stand-up Roller Coaster\n" + "\n" + "STR_SCNR :Arid Heights scenario string\n" + "STR_PARK :Arid Heights park string\n" + "STR_DTLS :Free of any financial limits, your challenge is to develop " + "this desert park while keeping the guests happy\n" + "[CONDORRD]\n" + "STR_NAME :my test ride\n" + "STR_DESC :ride description\n" + "STR_CPTY :ride capacity\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 LanguageZhTW[] = { +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, diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index 2dce17f261..ab9deb18ee 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -4,64 +4,67 @@ extern "C" { #include -// These are populated further down in this file, but to do so, they need to be marked `extern`. -extern const uint8 randomdata[1024]; -extern const uint8 nonedata[1029]; -extern const uint8 rledata[1038]; -extern const uint8 rlecompresseddata[1949]; -extern const uint8 rotatedata[1038]; - #define BUFFER_SIZE 0x600000 -static void test_encode_decode(uint8 encoding_type) +class SawyerCodingTest : public testing::Test { - sawyercoding_chunk_header chdr_in, chdr_out; - chdr_in.encoding = encoding_type; - chdr_in.length = sizeof(randomdata); - uint8 * encodedDataBuffer = new uint8[BUFFER_SIZE]; - size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8 *)randomdata, chdr_in); - ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); - memcpy(&chdr_out, encodedDataBuffer, sizeof(sawyercoding_chunk_header)); - ASSERT_EQ(chdr_out.encoding, encoding_type); - uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; - size_t decodedDataSize = sawyercoding_read_chunk_buffer(decodeBuffer, encodedDataBuffer + sizeof(sawyercoding_chunk_header), - chdr_out, BUFFER_SIZE); - ASSERT_EQ(decodedDataSize, sizeof(randomdata)); - int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); - ASSERT_EQ(result, 0); - delete[] decodeBuffer; - delete[] encodedDataBuffer; -} +protected: + static const uint8 randomdata[1024]; + static const uint8 nonedata[1029]; + static const uint8 rledata[1038]; + static const uint8 rlecompresseddata[1949]; + static const uint8 rotatedata[1038]; -static void test_decode(const uint8 * data) -{ - sawyercoding_chunk_header chdr_in; - memcpy(&chdr_in, data, sizeof(sawyercoding_chunk_header)); - uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; - size_t decodedDataSize = - sawyercoding_read_chunk_buffer(decodeBuffer, data + sizeof(sawyercoding_chunk_header), chdr_in, BUFFER_SIZE); - ASSERT_EQ(decodedDataSize, sizeof(randomdata)); - int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); - ASSERT_EQ(result, 0); - delete[] decodeBuffer; -} + void test_encode_decode(uint8 encoding_type) + { + sawyercoding_chunk_header chdr_in, chdr_out; + chdr_in.encoding = encoding_type; + chdr_in.length = sizeof(randomdata); + uint8 * encodedDataBuffer = new uint8[BUFFER_SIZE]; + size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8 *)randomdata, chdr_in); + ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); + memcpy(&chdr_out, encodedDataBuffer, sizeof(sawyercoding_chunk_header)); + ASSERT_EQ(chdr_out.encoding, encoding_type); + uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; + size_t decodedDataSize = sawyercoding_read_chunk_buffer( + decodeBuffer, encodedDataBuffer + sizeof(sawyercoding_chunk_header), chdr_out, BUFFER_SIZE); + ASSERT_EQ(decodedDataSize, sizeof(randomdata)); + int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); + ASSERT_EQ(result, 0); + delete[] decodeBuffer; + delete[] encodedDataBuffer; + } -TEST(sawyercoding, write_read_chunk_none) + void test_decode(const uint8 * data) + { + sawyercoding_chunk_header chdr_in; + memcpy(&chdr_in, data, sizeof(sawyercoding_chunk_header)); + uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; + size_t decodedDataSize = + sawyercoding_read_chunk_buffer(decodeBuffer, data + sizeof(sawyercoding_chunk_header), chdr_in, BUFFER_SIZE); + ASSERT_EQ(decodedDataSize, sizeof(randomdata)); + int result = memcmp(decodeBuffer, randomdata, sizeof(randomdata)); + ASSERT_EQ(result, 0); + delete[] decodeBuffer; + } +}; + +TEST_F(SawyerCodingTest, write_read_chunk_none) { test_encode_decode(CHUNK_ENCODING_NONE); } -TEST(sawyercoding, write_read_chunk_rle) +TEST_F(SawyerCodingTest, write_read_chunk_rle) { test_encode_decode(CHUNK_ENCODING_RLE); } -TEST(sawyercoding, write_read_chunk_rle_compressed) +TEST_F(SawyerCodingTest, write_read_chunk_rle_compressed) { test_encode_decode(CHUNK_ENCODING_RLECOMPRESSED); } -TEST(sawyercoding, write_read_chunk_rotate) +TEST_F(SawyerCodingTest, write_read_chunk_rotate) { test_encode_decode(CHUNK_ENCODING_ROTATE); } @@ -70,29 +73,29 @@ TEST(sawyercoding, write_read_chunk_rotate) // The reason for that is we may improve encoding at some point, but the test won't be affected, // as we already do a decode test and rountrip (encode + decode), which validates all uses. -TEST(sawyercoding, decode_chunk_none) +TEST_F(SawyerCodingTest, decode_chunk_none) { test_decode(nonedata); } -TEST(sawyercoding, decode_chunk_rle) +TEST_F(SawyerCodingTest, decode_chunk_rle) { test_decode(rledata); } -TEST(sawyercoding, decode_chunk_rlecompressed) +TEST_F(SawyerCodingTest, decode_chunk_rlecompressed) { test_decode(rlecompresseddata); } -TEST(sawyercoding, decode_chunk_rotate) +TEST_F(SawyerCodingTest, decode_chunk_rotate) { test_decode(rotatedata); } // 1024 bytes of random data // use `dd if=/dev/urandom bs=1024 count=1 | xxd -i` to get your own -extern const uint8 randomdata[] = { +const uint8 SawyerCodingTest::randomdata[] = { 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0x0e, 0xc4, 0xac, 0xdc, 0x84, 0xd7, 0x68, 0xf1, 0x4d, 0xcb, 0xaf, 0x1e, 0x5a, 0x29, 0x40, 0x87, 0x80, 0x3f, 0xf9, 0xb8, 0xad, 0x01, 0xd3, 0x79, 0x3d, 0xe9, 0x87, 0xa8, 0x95, 0x68, 0xc0, 0xc2, 0x3d, 0x15, 0x87, 0xdb, 0xa6, 0x90, 0x8c, 0x26, 0x98, 0x2a, 0x3f, 0x2e, 0x0c, 0x82, 0x43, 0x00, 0x10, 0x6d, 0x60, 0xb9, 0xd4, @@ -149,7 +152,7 @@ extern const uint8 randomdata[] = { // Following are compressed versions of the data above. -extern const uint8 nonedata[] = { +const uint8 SawyerCodingTest::nonedata[] = { 0x00, 0x00, 0x04, 0x00, 0x00, 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0x0e, 0xc4, 0xac, 0xdc, 0x84, 0xd7, 0x68, 0xf1, 0x4d, 0xcb, 0xaf, 0x1e, 0x5a, 0x29, 0x40, 0x87, 0x80, 0x3f, 0xf9, 0xb8, 0xad, 0x01, 0xd3, 0x79, 0x3d, 0xe9, 0x87, 0xa8, 0x95, 0x68, 0xc0, 0xc2, 0x3d, 0x15, 0x87, 0xdb, 0xa6, 0x90, 0x8c, 0x26, 0x98, 0x2a, 0x3f, 0x2e, 0x0c, 0x82, 0x43, 0x00, @@ -204,7 +207,7 @@ extern const uint8 nonedata[] = { 0x80, 0xbe, 0x9e, 0xd7, 0x5e, 0xb5, 0x72, 0x22, 0xbc }; -extern const uint8 rledata[] = { +const uint8 SawyerCodingTest::rledata[] = { 0x01, 0x09, 0x04, 0x00, 0x00, 0x7d, 0x3a, 0x97, 0x63, 0x8b, 0xbf, 0xe5, 0x6e, 0x0e, 0xc4, 0xac, 0xdc, 0x84, 0xd7, 0x68, 0xf1, 0x4d, 0xcb, 0xaf, 0x1e, 0x5a, 0x29, 0x40, 0x87, 0x80, 0x3f, 0xf9, 0xb8, 0xad, 0x01, 0xd3, 0x79, 0x3d, 0xe9, 0x87, 0xa8, 0x95, 0x68, 0xc0, 0xc2, 0x3d, 0x15, 0x87, 0xdb, 0xa6, 0x90, 0x8c, 0x26, 0x98, 0x2a, 0x3f, 0x2e, 0x0c, 0x82, 0x43, @@ -259,7 +262,7 @@ extern const uint8 rledata[] = { 0x1d, 0x15, 0x29, 0x5b, 0xd0, 0x66, 0x72, 0xb8, 0x38, 0x80, 0xbe, 0x9e, 0xd7, 0x5e, 0xb5, 0x72, 0x22, 0xbc }; -extern const uint8 rlecompresseddata[] = { +const uint8 SawyerCodingTest::rlecompresseddata[] = { 0x02, 0x98, 0x07, 0x00, 0x00, 0x7d, 0xff, 0x3a, 0xff, 0x97, 0xff, 0x63, 0xff, 0x8b, 0xff, 0xbf, 0xff, 0xe5, 0xff, 0x6e, 0xff, 0x0e, 0xff, 0xc4, 0xff, 0xac, 0xff, 0xdc, 0xff, 0x84, 0xff, 0xd7, 0xff, 0x68, 0xff, 0xf1, 0xff, 0x4d, 0xff, 0xcb, 0xff, 0xaf, 0xff, 0x1e, 0xff, 0x5a, 0xff, 0x29, 0xff, 0x40, 0xff, 0x87, 0xff, 0x80, 0xff, 0x3f, 0xff, 0xf9, 0xff, 0xb8, @@ -360,7 +363,7 @@ extern const uint8 rlecompresseddata[] = { 0xff, 0x5e, 0xff, 0xb5, 0xb8, 0xff, 0x22, 0xff, 0xbc }; -extern const uint8 rotatedata[] = { +const uint8 SawyerCodingTest::rotatedata[] = { 0x03, 0x00, 0x04, 0x00, 0x00, 0x74, 0xbc, 0x6c, 0xc5, 0x7f, 0x2f, 0xcd, 0x07, 0x89, 0x65, 0x9b, 0x42, 0xaf, 0x43, 0x3e, 0xa6, 0x97, 0x7d, 0xc3, 0x2d, 0x52, 0x02, 0xf0, 0x40, 0x7e, 0xcf, 0x17, 0xd6, 0x02, 0x9e, 0x2f, 0x9e, 0xd3, 0x3c, 0x15, 0xca, 0xd0, 0x06, 0x58, 0x9e, 0x2a, 0x3c, 0x7b, 0x53, 0x21, 0x64, 0xc4, 0x4c, 0x54, 0xf9, 0xc5, 0x06, 0x05, 0x1a, 0x00, From 3253ef7cae3b37cdc931089bee78bac298b33645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 2 Dec 2016 22:12:55 +0100 Subject: [PATCH 21/26] Verify decoded chunk length --- test/tests/sawyercoding_test.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index ab9deb18ee..107e2dca4c 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -13,7 +13,7 @@ protected: static const uint8 nonedata[1029]; static const uint8 rledata[1038]; static const uint8 rlecompresseddata[1949]; - static const uint8 rotatedata[1038]; + static const uint8 rotatedata[1029]; void test_encode_decode(uint8 encoding_type) { @@ -35,10 +35,11 @@ protected: delete[] encodedDataBuffer; } - void test_decode(const uint8 * data) + void test_decode(const uint8 * data, size_t size) { sawyercoding_chunk_header chdr_in; memcpy(&chdr_in, data, sizeof(sawyercoding_chunk_header)); + ASSERT_EQ(chdr_in.length, size - sizeof(sawyercoding_chunk_header)); uint8 * decodeBuffer = new uint8[BUFFER_SIZE]; size_t decodedDataSize = sawyercoding_read_chunk_buffer(decodeBuffer, data + sizeof(sawyercoding_chunk_header), chdr_in, BUFFER_SIZE); @@ -75,22 +76,23 @@ TEST_F(SawyerCodingTest, write_read_chunk_rotate) TEST_F(SawyerCodingTest, decode_chunk_none) { - test_decode(nonedata); + test_decode(nonedata, sizeof(nonedata)); } TEST_F(SawyerCodingTest, decode_chunk_rle) { - test_decode(rledata); + test_decode(rledata, sizeof(rledata)); } TEST_F(SawyerCodingTest, decode_chunk_rlecompressed) { - test_decode(rlecompresseddata); + test_decode(rlecompresseddata, sizeof(rlecompresseddata)); } TEST_F(SawyerCodingTest, decode_chunk_rotate) { - test_decode(rotatedata); + // Rotate + test_decode(rotatedata, sizeof(rotatedata)); } // 1024 bytes of random data From 7557d9ca0743627415a8880a0d2a6be93c6db0c6 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 21:49:44 +0000 Subject: [PATCH 22/26] Abort if assert is hit in tests --- src/core/Guard.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Guard.cpp b/src/core/Guard.cpp index 479f976104..031e8841d5 100644 --- a/src/core/Guard.cpp +++ b/src/core/Guard.cpp @@ -78,8 +78,11 @@ namespace Guard char *bufend = (char *)strchr(buffer, 0); vsnprintf(bufend, sizeof(buffer) - (bufend - buffer), message, args); } - // Only show message box if we are not building for testing -#ifndef __TEST__ +#ifdef __TEST__ + // Abort if we are building for testing + abort(); +#else + // Show message box if we are not building for testing int result = MessageBoxA(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); if (result == IDABORT) { From 3a3e3c76d15d1c03ce818b3988b8aef400e21539 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 22:09:52 +0000 Subject: [PATCH 23/26] Rollback AppVeyor platform update --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b8ebe79a07..ffc1f5e0cc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 0.0.5.{build} -os: Visual Studio 2015 +os: Previous Visual Studio 2015 cache: - C:\ProgramData\chocolatey\bin -> scripts\ps\appveyor_install.ps1 - C:\ProgramData\chocolatey\lib -> scripts\ps\appveyor_install.ps1 From 8892a5e17cf559063c38b09134a1fd92f226f907 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 23:07:07 +0000 Subject: [PATCH 24/26] Fix AppVeyor for testing --- appveyor.yml | 9 ++------- openrct2.proj | 18 ++++++++++++------ scripts/ps/appveyor_deploy.ps1 | 24 ++++++++++++++---------- scripts/ps/appveyor_install.ps1 | 6 ++++-- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ffc1f5e0cc..7ff10f3cdc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,16 +19,11 @@ install: platform: - Win32 - x64 -configuration: - - Release - - ReleaseTests +configuration: Release build: project: openrct2.proj test_script: -- ps: >- - if ($env:configuration -eq "ReleaseTests") { - msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - } +- ps: msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" artifacts: - path: .\artifacts\openrct2-portable*.zip name: OpenRCT2-portable diff --git a/openrct2.proj b/openrct2.proj index ee68eea4b4..7c9c7259b3 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -16,6 +16,7 @@ Debug x64 + true $(GIT_COMMIT_SHA1.Substring(0, 7)) 0.0.5.0 @@ -213,7 +214,8 @@ - + @@ -221,7 +223,8 @@ - + @@ -234,14 +237,16 @@ - + <_7z Output="$(PublishZip)" Inputs="@(PublishItems)" /> - + <_7z Output="$(PublishSymbolsZip)" Inputs="@(SymbolItems)" /> @@ -252,7 +257,7 @@ DependsOnTargets="Build;g2" Inputs="@(PublishItems);$(NsisScript)" Outputs="$(PublishInstallerExe)" - Condition="'$(NO_NSIS)'!='true'"> + Condition="'$(NO_NSIS)'!='true' AND '$(TestConfig)'!='true'"> $([System.IO.Path]::GetFilename($(PublishInstallerExe))) @@ -280,7 +285,8 @@ DependsOnTargets="PublishSymbols;PublishPortable;PublishInstaller" /> - + https://openrct2.org/altapi/?command=push-build %(UploadArtifacts.Filename)%(UploadArtifacts.Extension) diff --git a/scripts/ps/appveyor_deploy.ps1 b/scripts/ps/appveyor_deploy.ps1 index bf63ce8592..55a5363f9f 100644 --- a/scripts/ps/appveyor_deploy.ps1 +++ b/scripts/ps/appveyor_deploy.ps1 @@ -2,20 +2,24 @@ # Script to deploy OpenRCT2 from AppVeyor # ########################################### -# Check if OpenRCT2.org API security token is available -if (${env:OPENRCT2_ORG_TOKEN}) +$testing = (${env:Configuration} -like "*tests") +if (-not $testing) { - # Only upload tagged builds, develop branch or push/ branches - if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/") + # Check if OpenRCT2.org API security token is available + if (${env:OPENRCT2_ORG_TOKEN}) { - msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + # Only upload tagged builds, develop branch or push/ branches + if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/") + { + msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + } + else + { + Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow + } } else { - Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow + Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow } } -else -{ - Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow -} diff --git a/scripts/ps/appveyor_install.ps1 b/scripts/ps/appveyor_install.ps1 index 5dccee05bf..dadc11a679 100644 --- a/scripts/ps/appveyor_install.ps1 +++ b/scripts/ps/appveyor_install.ps1 @@ -2,6 +2,8 @@ # Script to setup OpenRCT2 for building on AppVeyor ######################################################### +$testing = (${env:Configuration} -like "*tests") + function Check-ExitCode { if ($LASTEXITCODE -ne 0) @@ -10,7 +12,7 @@ function Check-ExitCode } } -if ($env:ENCKEY) +if ($env:ENCKEY -and -not $testing) { if (-not (Test-Path "secure-file")) { @@ -24,7 +26,7 @@ if ($env:ENCKEY) } # Check if OpenRCT2.org API security token is available -if (${env:OPENRCT2_ORG_TOKEN}) +if (${env:OPENRCT2_ORG_TOKEN} -and -not $testing) { if (-not (Test-Path "C:\ProgramData\chocolatey\lib\nsis.portable")) { From f13056755405a1f618bc896bbf80112508df88e5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 4 Dec 2016 14:32:05 +0000 Subject: [PATCH 25/26] Define subsystem for release configuration --- openrct2.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 098d5abc10..b0ba61022c 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -65,7 +65,8 @@ $(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions) - Console + Console + Windows @@ -587,6 +588,5 @@ - \ No newline at end of file From db39e66c5b3e1a1c9cf0e8e0896c2f9de685e168 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 4 Dec 2016 15:24:48 +0000 Subject: [PATCH 26/26] Fix machine not specified warning --- openrct2.vcxproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openrct2.vcxproj b/openrct2.vcxproj index b0ba61022c..0f0b64b570 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -68,8 +68,11 @@ Console Windows + + MachineX86 + MachineX64 + -