Skip to content

Commit 199a264

Browse files
committed
fix
1 parent b541dcb commit 199a264

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

libraries/multi_index_lru/tests/tests/lru_basic_tests.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <iostream>
44
#include <string>
5+
#include <cassert>
56

67
#include "../lru_container_concept.h"
78

@@ -52,22 +53,22 @@ void test_lru_users() {
5253

5354
// find by id
5455
auto by_id = cache.template get<id_tag>().find(1);
55-
assert(by_id != cache.template get<id_tag>().end());
56-
assert(by_id->get().name == "Alice");
56+
assert((by_id != cache.template get<id_tag>().end()));
57+
assert((by_id->get().name == "Alice"));
5758

5859
// find by email
5960
auto by_email = cache.template get<email_tag>().find("[email protected]");
60-
assert(by_email != cache.template get<email_tag>().end());
61-
assert(by_email->get().id == 2);
61+
assert((by_email != cache.template get<email_tag>().end()));
62+
assert((by_email->get().id == 2));
6263

6364
//find by name
6465
auto by_name = cache.template get<name_tag>().find("Charlie");
65-
assert(by_name != cache.template get<name_tag>().end());
66-
assert(by_name->get().email == "[email protected]");
66+
assert((by_name != cache.template get<name_tag>().end()));
67+
assert((by_name->get().email == "[email protected]"));
6768

6869
//find by email
6970
auto it = cache.template find<email_tag, std::string>("[email protected]");
70-
assert(it != cache.template get<email_tag>().end());
71+
assert((it != cache.template get<email_tag>().end()));
7172

7273
//find by id
7374
cache.template find<id_tag, int>(1);
@@ -113,7 +114,7 @@ void test_lru_products() {
113114
cache.emplace(Product{"A2", "Mouse", 29.99});
114115

115116
auto laptop = cache.template find<sku_tag, std::string>("A1");
116-
assert(laptop != cache.template get<sku_tag>().end());
117+
assert((laptop != cache.template get<sku_tag>().end()));
117118

118119
// A1 was used, so A2 should be ousted
119120
cache.emplace(Product{"A3", "Keyboard", 79.99});

0 commit comments

Comments
 (0)