mirror of https://github.com/status-im/evmc.git
commit
ef5a2c1ffc
|
@ -16,11 +16,12 @@ target_compile_definitions(loader-mocked PRIVATE EVMC_LOADER_MOCK=1)
|
|||
|
||||
add_executable(
|
||||
evmc-unittests
|
||||
cpp_test.cpp
|
||||
helpers_test.cpp
|
||||
instructions_test.cpp
|
||||
loader_mock.h
|
||||
test_cpp.cpp
|
||||
test_helpers.cpp
|
||||
test_instructions.cpp
|
||||
test_loader.cpp
|
||||
loader_test.cpp
|
||||
mocked_host_test.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
|
|
|
@ -634,17 +634,3 @@ 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);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// EVMC: Ethereum Client-VM Connector API.
|
||||
// Copyright 2019 The EVMC Authors.
|
||||
// Licensed under the Apache License, Version 2.0.
|
||||
|
||||
#include <evmc/mocked_host.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(mocked_host, 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);
|
||||
}
|
Loading…
Reference in New Issue