E5E0 Suppress a useless warning by goedderz · Pull Request #14624 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions tests/Replication2/ConcurrencyTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,24 @@ struct ReplicatedLogConcurrentTest : ReplicatedLogTest {

// Used to generate payloads that are unique across threads.
constexpr static auto genPayload = [](ThreadIdx thread, IterIdx i) {
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
// up to 5 digits for thread
static_assert(std::numeric_limits<ThreadIdx>::max() <= 99'999);
// up to 10 digits for i
static_assert(std::numeric_limits<IterIdx>::max() <= 99'999'999'999);
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

// This should fit into short string optimization
auto str = std::string(16, ' ');

auto p = str.begin() + 5;
// up to 5 digits for thread
static_assert(std::numeric_limits<ThreadIdx>::max() <= 99'999);
// 1 digit for ':'
*p = ':';
// up to 10 digits for i
static_assert(std::numeric_limits<IterIdx>::max() <= 99'999'999'999);

do {
--p;
Expand Down
0