Skip to content

Commit 78ec55e

Browse files
committed
fix windows build
1 parent de5d2d5 commit 78ec55e

File tree

11 files changed

+53
-28
lines changed

11 files changed

+53
-28
lines changed

silkworm/db/kv/state_reader_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ using testing::_;
1818
using testing::Invoke;
1919
using testing::Unused;
2020

21-
#ifndef SILKWORM_SANITIZE
21+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
22+
// See also https://github.com/google/googletest/issues/4357
23+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
2224
static const evmc::address kZeroAddress{};
2325
static const Bytes kEncodedAccount{*from_hex(
2426
"01020203e820f1885eda54b7a053318cd41e2093220dab15d65381b1157a3633a83bfd5c92390105")};
@@ -178,6 +180,6 @@ TEST_CASE_METHOD(StateReaderTest, "StateReader::read_code") {
178180
}
179181
}
180182
}
181-
#endif // SILKWORM_SANITIZE
183+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
182184

183185
} // namespace silkworm::db::kv

silkworm/execution/domain_state_test.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
namespace silkworm::execution {
1919

20+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
21+
// See also https://github.com/google/googletest/issues/4357
22+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
2023
using testing::Unused;
2124

2225
TEST_CASE("DomainState data access", "[execution][domain][state]") {
@@ -276,7 +279,7 @@ TEST_CASE("DomainState data access", "[execution][domain][state]") {
276279
}
277280
}
278281

279-
TEST_CASE("DomainState empty overriden methods do nothing", "[execution][domain][state]") {
282+
TEST_CASE("DomainState empty overridden methods do nothing", "[execution][domain][state]") {
280283
TemporaryDirectory tmp_dir;
281284
silkworm::db::test_util::TestDataStore ds_context{tmp_dir};
282285

@@ -295,5 +298,6 @@ TEST_CASE("DomainState empty overriden methods do nothing", "[execution][domain]
295298
auto state_root_hash = sut.state_root_hash();
296299
CHECK(state_root_hash == evmc::bytes32{});
297300
}
301+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
298302

299303
} // namespace silkworm::execution

silkworm/rpc/commands/debug_api_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ TEST_CASE("DebugRpcApi") {
4949
}
5050
}
5151

52-
#if !defined(__clang__)
52+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
53+
// See also https://github.com/google/googletest/issues/4357
54+
#if !defined(__clang__) && !defined(_WIN32)
5355
using testing::_;
5456
using testing::Invoke;
5557
using testing::InvokeWithoutArgs;
@@ -279,7 +281,7 @@ TEST_CASE("get_modified_accounts") {
279281
}
280282
#endif
281283
}
282-
#endif // !defined(__clang__)
284+
#endif // !defined(__clang__) && !defined(_WIN32)
283285

284286
#endif // SILKWORM_SANITIZE
285287

silkworm/rpc/commands/engine_api_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ struct EngineRpcApiTest : public test_util::JsonApiTestBase<EngineRpcApiForTest>
5959
std::shared_ptr<db::test_util::MockCursorDupSort> mock_cursor_dup_sort{std::make_shared<db::test_util::MockCursorDupSort>()};
6060
};
6161

62-
#ifndef SILKWORM_SANITIZE
62+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
63+
// See also https://github.com/google/googletest/issues/4357
64+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
6365
static const evmc::bytes32 kZeroHeaderHash{0x0000000000000000000000000000000000000000000000000000000000000000_bytes32};
6466
static const silkworm::Bytes kBlockHash(32, '\0');
6567

@@ -769,6 +771,6 @@ TEST_CASE_METHOD(EngineRpcApiTest, "engine_transitionConfigurationV1 KO: incorre
769771
"jsonrpc":"2.0"
770772
})"_json);
771773
}
772-
#endif // SILKWORM_SANITIZE
774+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
773775

774776
} // namespace silkworm::rpc::commands

silkworm/rpc/core/block_reader_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ static constexpr std::string_view kPending = kPendingBlockId;
5555
static constexpr std::string_view kFinalized = kFinalizedBlockId;
5656
static constexpr std::string_view kSafe = kSafeBlockId;
5757

58+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
59+
// See also https://github.com/google/googletest/issues/4357
60+
#ifndef _WIN32
5861
TEST_CASE("get_block_num latest_required", "[rpc][core][blocks]") {
5962
MockTransaction transaction;
6063
MockChainStorage chain_storage;
@@ -407,5 +410,6 @@ TEST_CASE("is_latest_block_num", "[rpc][core][blocks]") {
407410
CHECK(!result.get());
408411
}
409412
}
413+
#endif // _WIN32
410414

411415
} // namespace silkworm::rpc::core

silkworm/rpc/core/evm_debug_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TestDebugExecutor : DebugExecutor {
5353
}
5454
};
5555

56-
#ifndef SILKWORM_SANITIZE
56+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
5757
using testing::_;
5858
using testing::Invoke;
5959
using testing::InvokeWithoutArgs;
@@ -1170,6 +1170,6 @@ TEST_CASE("uint256_to_hex", "evmone::uint256") {
11701170
}
11711171
}
11721172

1173-
#endif // SILKWORM_SANITIZE
1173+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
11741174

11751175
} // namespace silkworm::rpc::debug

silkworm/rpc/core/evm_executor_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct EVMExecutorTest : public test_util::ServiceContextTestBase {
4646
std::shared_ptr<State> state{std::make_shared<execution::RemoteState>(io_executor, transaction, storage, block_num)};
4747
};
4848

49-
#ifndef SILKWORM_SANITIZE
49+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
5050
using testing::_;
5151
using testing::Invoke;
5252
using testing::Unused;
@@ -304,6 +304,6 @@ TEST_CASE_METHOD(EVMExecutorTest, "EVMExecutor") {
304304
CHECK(error_message == "wasm trap");
305305
}
306306
}
307-
#endif // SILKWORM_SANITIZE
307+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
308308

309309
} // namespace silkworm::rpc

silkworm/rpc/core/evm_trace_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ struct TraceCallExecutorTest : public test_util::ServiceContextTestBase {
3838
RemoteChainStorage chain_storage{transaction, ethdb::kv::make_backend_providers(&backend)};
3939
};
4040

41-
#ifndef SILKWORM_SANITIZE
41+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
42+
// See also https://github.com/google/googletest/issues/4357
43+
#if !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
4244
using testing::_;
4345
using testing::Invoke;
4446
using testing::InvokeWithoutArgs;
@@ -3888,6 +3890,6 @@ TEST_CASE("TraceManyCallResult: json serialization") {
38883890
])"_json);
38893891
}
38903892
}
3891-
#endif // SILKWORM_SANITIZE
3893+
#endif // !defined(SILKWORM_SANITIZE) && !defined(_WIN32)
38923894

38933895
} // namespace silkworm::rpc::trace

silkworm/rpc/core/receipts_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ static silkworm::Bytes kHeader{*silkworm::from_hex(
5050
"00000000000000000000000000000000000000000000880000000000000000")};
5151
static silkworm::Bytes kBody{*silkworm::from_hex("c68369e45a03c0")};
5252

53+
// Exclude on MSVC due to error LNK2001: unresolved external symbol testing::Matcher<class std::basic_string_view...
54+
// See also https://github.com/google/googletest/issues/4357
55+
#ifndef _WIN32
5356
TEST_CASE("read_receipts") {
5457
WorkerPool pool{1};
5558
db::test_util::MockTransaction transaction;
@@ -210,6 +213,7 @@ TEST_CASE("read_receipts") {
210213
CHECK((*receipts)[0]->logs.empty());
211214
}
212215
}
216+
#endif // _WIN32
213217

214218
TEST_CASE("get_receipts") {
215219
WorkerPool pool{1};

silkworm/rpc/ethdb/split_cursor_test.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TEST_CASE("split cursor dup sort") {
3434
WorkerPool pool{1};
3535
db::test_util::MockCursorDupSort csdp;
3636

37-
SECTION("0 maching bits: seek_both, key not exists") {
37+
SECTION("0 matching bits: seek_both, key not exists") {
3838
SplitCursorDupSort sc(csdp, kKey, kLocation, 0, silkworm::kAddressLength, 0);
3939

4040
EXPECT_CALL(csdp, seek_both(_, _))
@@ -50,7 +50,7 @@ TEST_CASE("split cursor dup sort") {
5050
CHECK(silkworm::to_hex(skv.value).empty());
5151
}
5252

53-
SECTION("evmc:.address maching bits: seek_both, key not exists") {
53+
SECTION("evmc:.address matching bits: seek_both, key not exists") {
5454
SplitCursorDupSort sc(csdp, kKey, kLocation, 8 * silkworm::kAddressLength, silkworm::kAddressLength,
5555
silkworm::kHashLength);
5656

@@ -67,7 +67,7 @@ TEST_CASE("split cursor dup sort") {
6767
CHECK(silkworm::to_hex(skv.value).empty());
6868
}
6969

70-
SECTION("evmc:.address odd maching bits: seek_both, key not exists") {
70+
SECTION("evmc:.address odd matching bits: seek_both, key not exists") {
7171
SplitCursorDupSort sc(csdp, kKey, kLocation, 153, silkworm::kAddressLength,
7272
silkworm::kHashLength);
7373

@@ -84,7 +84,7 @@ TEST_CASE("split cursor dup sort") {
8484
CHECK(silkworm::to_hex(skv.value).empty());
8585
}
8686

87-
SECTION("evmc:.address maching bits: seek_both, key exists") {
87+
SECTION("evmc:.address matching bits: seek_both, key exists") {
8888
SplitCursorDupSort sc(csdp, kKey, kLocation, 8 * silkworm::kAddressLength, silkworm::kAddressLength,
8989
silkworm::kHashLength);
9090

@@ -118,7 +118,7 @@ TEST_CASE("split cursor dup sort") {
118118
CHECK(silkworm::to_hex(skv.value).empty());
119119
}
120120

121-
SECTION("evmc:.address maching bits: next_dup, key exists empty key") {
121+
SECTION("evmc:.address matching bits: next_dup, key exists empty key") {
122122
SplitCursorDupSort sc(csdp, kKey, kLocation, 8 * silkworm::kAddressLength, silkworm::kAddressLength,
123123
silkworm::kHashLength);
124124

@@ -135,7 +135,7 @@ TEST_CASE("split cursor dup sort") {
135135
CHECK(silkworm::to_hex(skv.value).empty());
136136
}
137137

138-
SECTION("evmc:.address maching bits: next_dup, key exists wrong key last byte") {
138+
SECTION("evmc:.address matching bits: next_dup, key exists wrong key last byte") {
139139
SplitCursorDupSort sc(csdp, kKey, kLocation, 8 * silkworm::kAddressLength, silkworm::kAddressLength,
140140
silkworm::kHashLength);
141141

@@ -152,7 +152,7 @@ TEST_CASE("split cursor dup sort") {
152152
CHECK(silkworm::to_hex(skv.value).empty());
153153
}
154154

155-
SECTION("evmc:.address maching bits: next_dup, key exists wrong key first byte") {
155+
SECTION("evmc:.address matching bits: next_dup, key exists wrong key first byte") {
156156
SplitCursorDupSort sc(csdp, kKey, kLocation, 8 * silkworm::kAddressLength, silkworm::kAddressLength,
157157
silkworm::kHashLength);
158158

@@ -174,7 +174,7 @@ TEST_CASE("split cursor") {
174174
WorkerPool pool{1};
175175
db::test_util::MockCursor csdp;
176176

177-
SECTION("0 maching bits: seek, key not exists") {
177+
SECTION("0 matching bits: seek, key not exists") {
178178
SplitCursor sc(csdp, kKey, 0, silkworm::kAddressLength, 0, silkworm::kAddressLength);
179179

180180
EXPECT_CALL(csdp, seek(_))
@@ -190,7 +190,7 @@ TEST_CASE("split cursor") {
190190
CHECK(silkworm::to_hex(skv.value).empty());
191191
}
192192

193-
SECTION("evmc:.address maching bits: seek, key not exists") {
193+
SECTION("evmc:.address matching bits: seek, key not exists") {
194194
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
195195

196196
EXPECT_CALL(csdp, seek(_))
@@ -206,7 +206,7 @@ TEST_CASE("split cursor") {
206206
CHECK(silkworm::to_hex(skv.value).empty());
207207
}
208208

209-
SECTION("evmc:.address odd maching bits: seek, key not exists") {
209+
SECTION("evmc:.address odd matching bits: seek, key not exists") {
210210
SplitCursor sc(csdp, kKey, 131, silkworm::kAddressLength, 0, silkworm::kAddressLength);
211211

212212
EXPECT_CALL(csdp, seek(_))
@@ -222,7 +222,7 @@ TEST_CASE("split cursor") {
222222
CHECK(silkworm::to_hex(skv.value).empty());
223223
}
224224

225-
SECTION("evmc:.address maching bits: seek, key exists") {
225+
SECTION("evmc:.address matching bits: seek, key exists") {
226226
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
227227

228228
EXPECT_CALL(csdp, seek(_))
@@ -238,7 +238,7 @@ TEST_CASE("split cursor") {
238238
CHECK(silkworm::to_hex(skv.value) == "0000000000000000000000000000000000000000000000000000000000000001134567");
239239
}
240240

241-
SECTION("evmc:.address maching bits: next_dup, key exists short key") {
241+
SECTION("evmc:.address matching bits: next_dup, key exists short key") {
242242
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
243243

244244
EXPECT_CALL(csdp, next())
@@ -254,7 +254,7 @@ TEST_CASE("split cursor") {
254254
CHECK(silkworm::to_hex(skv.value).empty());
255255
}
256256

257-
SECTION("evmc:.address maching bits: next, empty key") {
257+
SECTION("evmc:.address matching bits: next, empty key") {
258258
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
259259

260260
EXPECT_CALL(csdp, next())
@@ -270,7 +270,7 @@ TEST_CASE("split cursor") {
270270
CHECK(silkworm::to_hex(skv.value).empty());
271271
}
272272

273-
SECTION("evmc:.address maching bits: next, key exists wrong key last byte") {
273+
SECTION("evmc:.address matching bits: next, key exists wrong key last byte") {
274274
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
275275
EXPECT_CALL(csdp, next())
276276
.WillOnce(InvokeWithoutArgs([]() -> Task<KeyValue> {
@@ -285,7 +285,7 @@ TEST_CASE("split cursor") {
285285
CHECK(silkworm::to_hex(skv.value).empty());
286286
}
287287

288-
SECTION("evmc:.address maching bits: next, key exists wrong key first byte") {
288+
SECTION("evmc:.address matching bits: next, key exists wrong key first byte") {
289289
SplitCursor sc(csdp, kKey, 8 * silkworm::kAddressLength, silkworm::kAddressLength, 0, silkworm::kAddressLength);
290290

291291
EXPECT_CALL(csdp, next())
@@ -301,4 +301,5 @@ TEST_CASE("split cursor") {
301301
CHECK(silkworm::to_hex(skv.value).empty());
302302
}
303303
}
304+
304305
} // namespace silkworm::rpc::ethdb

0 commit comments

Comments
 (0)