aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/keccak.cpp2
-rw-r--r--tests/unit_tests/serialization.cpp13
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/unit_tests/keccak.cpp b/tests/unit_tests/keccak.cpp
index 4276b0e1d..37da65d76 100644
--- a/tests/unit_tests/keccak.cpp
+++ b/tests/unit_tests/keccak.cpp
@@ -37,7 +37,7 @@ extern "C" {
#define TEST_KECCAK(sz, chunks) \
std::string data; \
data.resize(sz); \
- for (size_t i = 0; i < sz; ++i) \
+ for (size_t i = 0; i < data.size(); ++i) \
data[i] = i * 17; \
uint8_t md0[32], md1[32]; \
keccak((const uint8_t*)data.data(), data.size(), md0, 32); \
diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp
index 2f7b5aac7..b4517af2f 100644
--- a/tests/unit_tests/serialization.cpp
+++ b/tests/unit_tests/serialization.cpp
@@ -908,6 +908,17 @@ TEST(Serialization, portability_outputs)
ASSERT_TRUE(td2.m_pk_index == 0);
}
+struct unsigned_tx_set
+{
+ std::vector<tools::wallet2::tx_construction_data> txes;
+ tools::wallet2::transfer_container transfers;
+};
+template <class Archive>
+inline void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
+{
+ a & x.txes;
+ a & x.transfers;
+}
#define UNSIGNED_TX_PREFIX "Monero unsigned tx set\003"
TEST(Serialization, portability_unsigned_tx)
{
@@ -918,7 +929,7 @@ TEST(Serialization, portability_unsigned_tx)
ASSERT_TRUE(r);
const size_t magiclen = strlen(UNSIGNED_TX_PREFIX);
ASSERT_FALSE(strncmp(s.c_str(), UNSIGNED_TX_PREFIX, magiclen));
- tools::wallet2::unsigned_tx_set exported_txs;
+ unsigned_tx_set exported_txs;
s = s.substr(magiclen);
r = false;
try