Fixed compiler warnings in tests

This commit is contained in:
SChernykh 2022-05-24 15:18:09 +02:00
parent bfa8334aeb
commit 6d121122f8
2 changed files with 9 additions and 9 deletions

View file

@ -470,14 +470,6 @@ namespace {
#define CONCAT(a, b) CONCAT2(a, b) #define CONCAT(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a##b #define CONCAT2(a, b) a##b
#ifdef P2POOL_LOG_DISABLE
#define LOGINFO(level, ...)
#define LOGWARN(level, ...)
#define LOGERR(level, ...)
#else
// This is to check that LOG() call doesn't modify variables in scope, making program behavior dependent on the log level: // This is to check that LOG() call doesn't modify variables in scope, making program behavior dependent on the log level:
// //
// int some_func(int& n) { return ++n; } // int some_func(int& n) { return ++n; }
@ -508,6 +500,14 @@ struct DummyStream
} \ } \
} while (0) } while (0)
#ifdef P2POOL_LOG_DISABLE
#define LOGINFO(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__)
#define LOGWARN(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__)
#define LOGERR(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__)
#else
#define LOG(level, severity, ...) \ #define LOG(level, severity, ...) \
do { \ do { \
SIDE_EFFECT_CHECK(level, __VA_ARGS__); \ SIDE_EFFECT_CHECK(level, __VA_ARGS__); \

View file

@ -55,7 +55,7 @@ TEST(hash, empty)
hash h; hash h;
ASSERT_EQ(h.empty(), true); ASSERT_EQ(h.empty(), true);
for (int i = 0; i < HASH_SIZE; ++i) { for (size_t i = 0; i < HASH_SIZE; ++i) {
hash h2; hash h2;
h2.h[i] = 1; h2.h[i] = 1;
ASSERT_EQ(h2.empty(), false); ASSERT_EQ(h2.empty(), false);