// EVMC: Ethereum Client-VM Connector API. // Copyright 2019 The EVMC Authors. // Licensed under the Apache License, Version 2.0. #include #include #include #include TEST(helpers, maps) { std::map addresses; addresses[{}] = true; ASSERT_EQ(addresses.size(), 1); std::unordered_map unordered_addresses; unordered_addresses.emplace(*addresses.begin()); EXPECT_EQ(unordered_addresses.size(), 1); std::map storage; storage[{}] = true; ASSERT_EQ(storage.size(), 1); std::unordered_map unordered_storage; unordered_storage.emplace(*storage.begin()); EXPECT_EQ(unordered_storage.size(), 1); } TEST(helpers, is_zero) { auto a = evmc_address{}; EXPECT_TRUE(is_zero(a)); a.bytes[0] = 1; EXPECT_FALSE(is_zero(a)); auto b = evmc_bytes32{}; EXPECT_TRUE(is_zero(b)); b.bytes[0] = 1; EXPECT_FALSE(is_zero(b)); }