diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake new file mode 100644 index 0000000..f6a06db --- /dev/null +++ b/cmake/Hunter/config.cmake @@ -0,0 +1,13 @@ +# EVMC: Ethereum Client-VM Connector API. +# Copyright 2018-2019 The EVMC Authors. +# Licensed under the Apache License, Version 2.0. + +# Local Hunter configuration. + +hunter_config( + GTest + VERSION 1.8.1 + URL https://github.com/google/googletest/archive/release-1.8.1.tar.gz + SHA1 152b849610d91a9dfa1401293f43230c2e0c33f8 + CMAKE_ARGS BUILD_GMOCK=OFF gtest_force_shared_crt=ON +) diff --git a/cmake/Hunter/init.cmake b/cmake/Hunter/init.cmake index 243064e..8ad3fc2 100644 --- a/cmake/Hunter/init.cmake +++ b/cmake/Hunter/init.cmake @@ -8,4 +8,5 @@ HunterGate( URL "https://github.com/ruslo/hunter/archive/v0.23.165.tar.gz" SHA1 "5a73f91df5f6109c0bb1104d0c0ee423f7bece79" -) \ No newline at end of file + LOCAL +) diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 957ad0d..168a4ad 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable( test_loader.cpp ) -target_link_libraries(evmc-unittests PRIVATE loader-mocked evmc-example-vm-static evmc-example-host instructions GTest::gtest GTest::main) +target_link_libraries(evmc-unittests PRIVATE loader-mocked evmc-example-vm-static evmc-example-host instructions GTest::gtest_main) set_target_properties(evmc-unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) gtest_add_tests(TARGET evmc-unittests TEST_PREFIX ${PROJECT_NAME}/unittests/) diff --git a/test/unittests/test_cpp.cpp b/test/unittests/test_cpp.cpp index e65aa13..f19e24a 100644 --- a/test/unittests/test_cpp.cpp +++ b/test/unittests/test_cpp.cpp @@ -21,7 +21,8 @@ TEST(cpp, address) { evmc::address a; - EXPECT_EQ(std::count(std::begin(a.bytes), std::end(a.bytes), 0), sizeof(a)); + EXPECT_EQ(std::count(std::begin(a.bytes), std::end(a.bytes), 0), int{sizeof(a)}); + EXPECT_EQ(a, evmc::address{}); EXPECT_TRUE(is_zero(a)); EXPECT_FALSE(a); EXPECT_TRUE(!a); @@ -42,7 +43,8 @@ TEST(cpp, address) TEST(cpp, bytes32) { evmc::bytes32 b; - EXPECT_EQ(std::count(std::begin(b.bytes), std::end(b.bytes), 0), sizeof(b)); + EXPECT_EQ(std::count(std::begin(b.bytes), std::end(b.bytes), 0), int{sizeof(b)}); + EXPECT_EQ(b, evmc::bytes32{}); EXPECT_TRUE(is_zero(b)); EXPECT_FALSE(b); EXPECT_TRUE(!b);