Skip to content

Commit

Permalink
qtils outcome (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <[email protected]>
  • Loading branch information
turuslan authored May 29, 2024
1 parent bd457d4 commit 961e7ac
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 136 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake)

HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.23.257-qdrvm10.tar.gz
SHA1 72b446a4424ba28ea90f9a68a9134b0f8e44b5b2
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm12.zip
SHA1 9d4b9844b84d3dfbf4a90923eedb3875718abf54
)

project(Scale LANGUAGES CXX VERSION 1.1.0)
Expand All @@ -30,6 +30,9 @@ option(BUILD_TESTS "Whether to include the test suite in build" OFF)
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)

hunter_add_package(qtils)
find_package(qtils CONFIG REQUIRED)

add_subdirectory(src)

if (BUILD_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion include/scale/encode_append.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#include <scale/outcome/outcome.hpp>
#include <qtils/outcome.hpp>
#include <scale/types.hpp>

namespace scale {
Expand Down
1 change: 1 addition & 0 deletions include/scale/enum_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <algorithm>
#include <type_traits>

#include <scale/outcome/outcome_throw.hpp>
Expand Down
91 changes: 0 additions & 91 deletions include/scale/outcome/outcome-register.hpp

This file was deleted.

37 changes: 0 additions & 37 deletions include/scale/outcome/outcome.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/scale/scale.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <boost/throw_exception.hpp>

#include <scale/enum_traits.hpp>
#include <scale/outcome/outcome.hpp>
#include <qtils/outcome.hpp>
#include <scale/scale_decoder_stream.hpp>
#include <scale/scale_encoder_stream.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/scale/scale_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#include <scale/outcome/outcome-register.hpp>
#include <qtils/enum_error_code.hpp>

namespace scale {

Expand Down
5 changes: 2 additions & 3 deletions test/util/outcome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
* EXPECT_OUTCOME_TRUE(val, getResult());
*/
#define EXPECT_OUTCOME_TRUE(val, expr) \
EXPECT_OUTCOME_TRUE_name(BOOST_OUTCOME_TRY_UNIQUE_NAME, val, expr)
EXPECT_OUTCOME_TRUE_name(OUTCOME_UNIQUE, val, expr)

#define _EXPECT_EC(tmp, expr, expected) \
auto &&tmp = expr; \
EXPECT_TRUE(tmp.has_error()); \
EXPECT_EQ(tmp.error(), expected);
#define EXPECT_EC(expr, expected) \
_EXPECT_EC(BOOST_OUTCOME_TRY_UNIQUE_NAME, expr, expected)
#define EXPECT_EC(expr, expected) _EXPECT_EC(OUTCOME_UNIQUE, expr, expected)

0 comments on commit 961e7ac

Please sign in to comment.