1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Add test case for DecryptSea

This commit is contained in:
Ted John
2020-07-10 19:02:51 +01:00
parent d2bd9afe76
commit 06f1b58004
2 changed files with 12 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
@@ -18,6 +18,7 @@
#include <openrct2/ParkImporter.h>
#include <openrct2/audio/AudioContext.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/Crypt.h>
#include <openrct2/core/File.h>
#include <openrct2/core/MemoryStream.h>
#include <openrct2/core/Path.hpp>
@@ -566,3 +567,13 @@ TEST(S6ImportExportAdvanceTicks, all)
SUCCEED();
}
TEST(SeaDecrypt, DecryptSea)
{
auto path = TestData::GetParkPath("volcania.sea");
auto decrypted = DecryptSea(path);
auto sha1 = Crypt::SHA1(decrypted.data(), decrypted.size());
std::array<uint8_t, 20> expected = { 0x1B, 0x85, 0xFC, 0xC0, 0xE8, 0x9B, 0xBE, 0x72, 0xD9, 0x1F,
0x6E, 0xC8, 0xB1, 0xFF, 0xEC, 0x70, 0x2A, 0x72, 0x05, 0xBB };
ASSERT_EQ(sha1, expected);
}

BIN
test/tests/testdata/parks/volcania.sea vendored Normal file

Binary file not shown.