1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix Linux

This commit is contained in:
Ted John
2018-06-01 21:08:40 +01:00
parent 9e14b838de
commit ae81af7965
3 changed files with 6 additions and 5 deletions

View File

@@ -16,8 +16,8 @@
#pragma once
#include <istream>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <vector>
#include "../common.h"

View File

@@ -115,7 +115,7 @@ bool NetworkKey::SavePrivate(IStream * stream)
{
if (_key == nullptr)
{
throw std::exception("No key loaded");
throw std::runtime_error("No key loaded");
}
auto pem = _key->GetPrivate();
stream->Write(pem.data(), pem.size());
@@ -134,7 +134,7 @@ bool NetworkKey::SavePublic(IStream * stream)
{
if (_key == nullptr)
{
throw std::exception("No key loaded");
throw std::runtime_error("No key loaded");
}
auto pem = _key->GetPrivate();
stream->Write(pem.data(), pem.size());
@@ -151,7 +151,7 @@ std::string NetworkKey::PublicKeyString()
{
if (_key == nullptr)
{
throw std::exception("No key loaded");
throw std::runtime_error("No key loaded");
}
return _key->GetPublic();
}

View File

@@ -154,7 +154,8 @@ target_link_libraries(test_localisation ${GTEST_LIBRARIES} test-common ${LDL} z)
add_test(NAME localisation COMMAND test_localisation)
# Crypt tests
add_executable(test_crypt "${CMAKE_CURRENT_LIST_DIR}/CryptTests.cpp")
add_executable(test_crypt "${CMAKE_CURRENT_LIST_DIR}/CryptTests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/TestData.cpp")
target_link_libraries(test_crypt ${GTEST_LIBRARIES} libopenrct2)
add_test(NAME Crypt COMMAND test_crypt)