test: Add a unit test for MockedAccount

This commit is contained in:
Paweł Bylica 2019-11-28 15:21:00 +01:00
parent dbe1c3e73b
commit d4e61aa84a
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
1 changed files with 15 additions and 1 deletions

View File

@ -634,3 +634,17 @@ TEST(cpp, result_create)
EXPECT_TRUE(std::memcmp(c.output_data, r.output_data, c.output_size) == 0);
c.release(&c);
}
TEST(cpp, mocked_account)
{
using namespace evmc::literals;
evmc::MockedAccount account;
EXPECT_EQ(account.nonce, 0);
--account.nonce;
account.set_balance(0x0102030405060708);
EXPECT_EQ(account.balance,
0x0000000000000000000000000000000000000000000000000102030405060708_bytes32);
EXPECT_EQ(account.nonce, -1);
}