|
2 | 2 |
|
3 | 3 | #include <iostream> |
4 | 4 | #include <string> |
| 5 | +#include <cassert> |
5 | 6 |
|
6 | 7 | #include "../lru_container_concept.h" |
7 | 8 |
|
@@ -52,22 +53,22 @@ void test_lru_users() { |
52 | 53 |
|
53 | 54 | // find by id |
54 | 55 | 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")); |
57 | 58 |
|
58 | 59 | // find by email |
59 | 60 | 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)); |
62 | 63 |
|
63 | 64 | //find by name |
64 | 65 | 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]")); |
67 | 68 |
|
68 | 69 | //find by email |
69 | 70 | 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())); |
71 | 72 |
|
72 | 73 | //find by id |
73 | 74 | cache.template find<id_tag, int>(1); |
@@ -113,7 +114,7 @@ void test_lru_products() { |
113 | 114 | cache.emplace(Product{"A2", "Mouse", 29.99}); |
114 | 115 |
|
115 | 116 | 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())); |
117 | 118 |
|
118 | 119 | // A1 was used, so A2 should be ousted |
119 | 120 | cache.emplace(Product{"A3", "Keyboard", 79.99}); |
|
0 commit comments