tests: fix warnings exposed by -Werror and a non-recursive Storage copy
This commit is contained in:
1 parent
2c8d853af0
commit
92d60231e5
5 files changed
+10
-18
No files matched your search
@@ -67,7 +67,7 @@ Void::Testing::Test lru_get_promotes_entry()
|
||||
c.put(1, "a");
|
||||
c.put(2, "b");
|
||||
c.put(3, "c");
|
||||
c.get(1); // promote 1 to MRU
|
||||
(void)c.get(1); // promote 1 to MRU
|
||||
c.put(4, "d"); // evicts 2 (now LRU)
|
||||
Void::Testing::expect(c.contains(1));
|
||||
Void::Testing::expect(!c.contains(2));
|
||||
@@ -106,7 +106,7 @@ Void::Testing::Test lru_peek_does_not_promote()
|
||||
c.put(1, "a");
|
||||
c.put(2, "b");
|
||||
c.put(3, "c");
|
||||
c.peek(1); // peek 1 but do NOT promote
|
||||
(void)c.peek(1); // peek 1 but do NOT promote
|
||||
c.put(4, "d"); // evicts 1 (still LRU despite peek)
|
||||
Void::Testing::expect(!c.contains(1));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ Void::Testing::Test spsc_full_push_returns_false()
|
||||
Void::Testing::Test spsc_fifo_order()
|
||||
{
|
||||
Void::Ring::SpscRing<int, 8> ring;
|
||||
for (int i = 0; i < 5; ++i) ring.push(i);
|
||||
for (int i = 0; i < 5; ++i) (void)ring.push(i);
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
const auto v = ring.pop();
|
||||
Void::Testing::expect(v.has_value());
|
||||
@@ -61,14 +61,14 @@ Void::Testing::Test spsc_capacity_is_n_minus_one()
|
||||
Void::Testing::Test spsc_full_flag()
|
||||
{
|
||||
Void::Ring::SpscRing<int, 4> ring;
|
||||
ring.push(1); ring.push(2); ring.push(3);
|
||||
(void)ring.push(1); (void)ring.push(2); (void)ring.push(3);
|
||||
Void::Testing::expect(ring.full());
|
||||
}
|
||||
|
||||
Void::Testing::Test spsc_string_values()
|
||||
{
|
||||
Void::Ring::SpscRing<std::string, 4> ring;
|
||||
ring.push(std::string{"hello"});
|
||||
(void)ring.push(std::string{"hello"});
|
||||
const auto v = ring.pop();
|
||||
Void::Testing::expect(v.has_value());
|
||||
Void::Testing::expect_eq(*v, std::string{"hello"});
|
||||
|
||||
Reference in new issue
Block a user