mirror of
https://github.com/vtnerd/monero-lws.git
synced 2025-01-03 17:29:25 +00:00
Downgrade CXX17 features to CXX14 (#113)
This commit is contained in:
parent
8f0f0813e1
commit
4f33de5138
3 changed files with 6 additions and 6 deletions
|
@ -30,7 +30,7 @@ cmake_minimum_required(VERSION 3.1.0)
|
||||||
project(monero-lws)
|
project(monero-lws)
|
||||||
|
|
||||||
enable_language(CXX)
|
enable_language(CXX)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
option(BUILD_TESTS "Build Tests" OFF)
|
option(BUILD_TESTS "Build Tests" OFF)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "framework.test.h"
|
#include "framework.test.h"
|
||||||
|
|
||||||
#include <optional>
|
#include <boost/optional/optional.hpp>
|
||||||
#include "db/data.h"
|
#include "db/data.h"
|
||||||
#include "db/storage.test.h"
|
#include "db/storage.test.h"
|
||||||
#include "db/string.h"
|
#include "db/string.h"
|
||||||
|
@ -111,7 +111,7 @@ LWS_CASE("rest_server")
|
||||||
|
|
||||||
SETUP("Database and login")
|
SETUP("Database and login")
|
||||||
{
|
{
|
||||||
std::optional<lws::rest_server> server;
|
boost::optional<lws::rest_server> server;
|
||||||
lws::db::test::cleanup_db on_scope_exit{};
|
lws::db::test::cleanup_db on_scope_exit{};
|
||||||
lws::db::storage db = lws::db::test::get_fresh_db();
|
lws::db::storage db = lws::db::test::get_fresh_db();
|
||||||
auto context =
|
auto context =
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace
|
||||||
{
|
{
|
||||||
EXPECT(Target(0) == wire::integer::cast_unsigned<Target>(std::uintmax_t(0)));
|
EXPECT(Target(0) == wire::integer::cast_unsigned<Target>(std::uintmax_t(0)));
|
||||||
EXPECT(limit::max() == wire::integer::cast_unsigned<Target>(std::uintmax_t(limit::max())));
|
EXPECT(limit::max() == wire::integer::cast_unsigned<Target>(std::uintmax_t(limit::max())));
|
||||||
if constexpr (limit::max() < max)
|
if (limit::max() < max)
|
||||||
{
|
{
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_unsigned<Target>(std::uintmax_t(limit::max()) + 1), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_unsigned<Target>(std::uintmax_t(limit::max()) + 1), wire::exception);
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_unsigned<Target>(max), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_unsigned<Target>(max), wire::exception);
|
||||||
|
@ -68,7 +68,7 @@ namespace
|
||||||
|
|
||||||
SETUP("intmax_t to " + boost::core::demangle(typeid(Target).name()))
|
SETUP("intmax_t to " + boost::core::demangle(typeid(Target).name()))
|
||||||
{
|
{
|
||||||
if constexpr (min < limit::min())
|
if (min < limit::min())
|
||||||
{
|
{
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(std::intmax_t(limit::min()) - 1), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(std::intmax_t(limit::min()) - 1), wire::exception);
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(min), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(min), wire::exception);
|
||||||
|
@ -76,7 +76,7 @@ namespace
|
||||||
EXPECT(limit::min() == wire::integer::cast_signed<Target>(std::intmax_t(limit::min())));
|
EXPECT(limit::min() == wire::integer::cast_signed<Target>(std::intmax_t(limit::min())));
|
||||||
EXPECT(Target(0) == wire::integer::cast_signed<Target>(std::intmax_t(0)));
|
EXPECT(Target(0) == wire::integer::cast_signed<Target>(std::intmax_t(0)));
|
||||||
EXPECT(limit::max() == wire::integer::cast_signed<Target>(std::intmax_t(limit::max())));
|
EXPECT(limit::max() == wire::integer::cast_signed<Target>(std::intmax_t(limit::max())));
|
||||||
if constexpr (limit::max() < max)
|
if (limit::max() < max)
|
||||||
{
|
{
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(std::intmax_t(limit::max()) + 1), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(std::intmax_t(limit::max()) + 1), wire::exception);
|
||||||
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(max), wire::exception);
|
EXPECT_THROWS_AS(wire::integer::cast_signed<Target>(max), wire::exception);
|
||||||
|
|
Loading…
Reference in a new issue