mirror of https://github.com/status-im/evmc.git
cpp: Add unit test for evmc::vm move to itself
This commit is contained in:
parent
1f3243a55e
commit
e1ff8cb007
|
@ -118,6 +118,17 @@ TEST(cpp, vm_move)
|
|||
EXPECT_FALSE(vm1);
|
||||
}
|
||||
EXPECT_EQ(destroy_counter, 4);
|
||||
{
|
||||
// Moving to itself will destroy the VM and reset the evmc::vm.
|
||||
auto v1 = template_instance;
|
||||
|
||||
auto vm1 = evmc::vm{&v1};
|
||||
auto& vm1_ref = vm1;
|
||||
vm1 = std::move(vm1_ref);
|
||||
EXPECT_EQ(destroy_counter, 5); // Already destroyed.
|
||||
EXPECT_FALSE(vm1); // Null.
|
||||
}
|
||||
EXPECT_EQ(destroy_counter, 5);
|
||||
}
|
||||
|
||||
TEST(cpp, host)
|
||||
|
|
Loading…
Reference in New Issue