From df6c9c61074b1e3ad3e49db2b4a70f79340a805b Mon Sep 17 00:00:00 2001 From: x-mass <36629999+x-mass@users.noreply.github.com> Date: Wed, 6 Dec 2023 03:30:18 +0000 Subject: [PATCH] Fix test --- include/nil/crypto3/detail/type_traits.hpp | 6 +++++- test/pack.cpp | 19 +++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/nil/crypto3/detail/type_traits.hpp b/include/nil/crypto3/detail/type_traits.hpp index 67912ee..56bd973 100644 --- a/include/nil/crypto3/detail/type_traits.hpp +++ b/include/nil/crypto3/detail/type_traits.hpp @@ -25,6 +25,10 @@ #ifndef CRYPTO3_TYPE_TRAITS_HPP #define CRYPTO3_TYPE_TRAITS_HPP +#include +#include + + #define GENERATE_HAS_MEMBER_TYPE(Type) \ template \ class HasMemberType_##Type { \ @@ -325,4 +329,4 @@ namespace nil { } // namespace crypto3 } // namespace nil -#endif // CRYPTO3_TYPE_TRAITS_HPP \ No newline at end of file +#endif // CRYPTO3_TYPE_TRAITS_HPP diff --git a/test/pack.cpp b/test/pack.cpp index 7d05af4..092e5ea 100644 --- a/test/pack.cpp +++ b/test/pack.cpp @@ -25,15 +25,14 @@ #define BOOST_TEST_MODULE block_pack_test -#include -#include - #include #include #include #include +#include +#include #include using namespace nil::crypto3; @@ -66,7 +65,7 @@ BOOST_AUTO_TEST_CASE(bubb_to_bubb_2) { BOOST_AUTO_TEST_CASE(bubb_to_bulb_1) { std::array in = {{0x12, 0x34, 0x56, 0x78}}; std::array out {}; - std::array res = {{0x482c6a1e}}; + std::array res = {{0x482c6a1e}}; pack(in.begin(), in.end(), out.begin()); @@ -90,7 +89,7 @@ BOOST_AUTO_TEST_CASE(bubb_to_lubb_1) { pack(in.begin(), in.end(), out.begin()); - BOOST_CHECK(out == res); + BOOST_CHECK(out == res); } BOOST_AUTO_TEST_CASE(bubb_to_lubb_2) { @@ -204,7 +203,7 @@ BOOST_AUTO_TEST_CASE(lubb_to_lulb_2) { } BOOST_AUTO_TEST_CASE(bulb_to_bubb_1) { - std::array in = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, + std::array in = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x48, 0x2c, 0x6a, 0x1e, 0x09, 0xd5, 0xb3, 0xf7}}; std::array out {}; std::array res = {{0x482c6a1e09d5b3f7, 0x1234567890abcdef}}; @@ -392,7 +391,7 @@ BOOST_AUTO_TEST_CASE(bubb_to_bubb_2) { BOOST_AUTO_TEST_CASE(bubb_to_bulb_1) { std::array in = {{0x482c6a1e}}; std::array out {}; - std::array res = {{0x12, 0x34, 0x56, 0x78}}; + std::array res = {{0x12, 0x34, 0x56, 0x78}}; pack(in.begin(), in.end(), out.begin()); @@ -416,7 +415,7 @@ BOOST_AUTO_TEST_CASE(bubb_to_lubb_1) { pack(in.begin(), in.end(), out.begin()); - BOOST_CHECK(out == res); + BOOST_CHECK(out == res); } BOOST_AUTO_TEST_CASE(bubb_to_lubb_2) { @@ -530,9 +529,9 @@ BOOST_AUTO_TEST_CASE(lubb_to_lulb_2) { } BOOST_AUTO_TEST_CASE(bulb_to_bubb_1) { - std::array in = {{0x482c6a1e09d5b3f7, 0x1234567890abcdef}}; + std::array in = {{0x482c6a1e09d5b3f7, 0x1234567890abcdef}}; std::array out {}; - std::array res = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, + std::array res = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x48, 0x2c, 0x6a, 0x1e, 0x09, 0xd5, 0xb3, 0xf7}}; pack(in.begin(), in.end(), out.begin());