@@ -21,7 +21,8 @@ std::list<CoinsCachePair> CreatePairs(CoinsCachePair& sentinel)
2121 auto node{std::prev (nodes.end ())};
2222 CCoinsCacheEntry::SetDirty (*node, sentinel);
2323
24- BOOST_CHECK (node->second .IsDirty () && !node->second .IsFresh ());
24+ BOOST_CHECK (node->second .IsDirty ());
25+ BOOST_CHECK (!node->second .IsFresh ());
2526 BOOST_CHECK_EQUAL (node->second .Next (), &sentinel);
2627 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &(*node));
2728
@@ -63,7 +64,8 @@ BOOST_AUTO_TEST_CASE(linked_list_iteration)
6364
6465 // Delete the nodes from the list to make sure there are no dangling pointers
6566 for (auto it{nodes.begin ()}; it != nodes.end (); it = nodes.erase (it)) {
66- BOOST_CHECK (!it->second .IsDirty () && !it->second .IsFresh ());
67+ BOOST_CHECK (!it->second .IsDirty ());
68+ BOOST_CHECK (!it->second .IsFresh ());
6769 }
6870}
6971
@@ -105,9 +107,11 @@ BOOST_AUTO_TEST_CASE(linked_list_random_deletion)
105107 nodes.erase (n2);
106108 // Check that n1 now points to n3, and n3 still points to n4
107109 // Also check that state was not altered
108- BOOST_CHECK (n1->second .IsDirty () && !n1->second .IsFresh ());
110+ BOOST_CHECK (n1->second .IsDirty ());
111+ BOOST_CHECK (!n1->second .IsFresh ());
109112 BOOST_CHECK_EQUAL (n1->second .Next (), &(*n3));
110- BOOST_CHECK (n3->second .IsDirty () && !n3->second .IsFresh ());
113+ BOOST_CHECK (n3->second .IsDirty ());
114+ BOOST_CHECK (!n3->second .IsFresh ());
111115 BOOST_CHECK_EQUAL (n3->second .Next (), &(*n4));
112116 BOOST_CHECK_EQUAL (n3->second .Prev (), &(*n1));
113117
@@ -116,7 +120,8 @@ BOOST_AUTO_TEST_CASE(linked_list_random_deletion)
116120 nodes.erase (n1);
117121 // Check that sentinel now points to n3, and n3 still points to n4
118122 // Also check that state was not altered
119- BOOST_CHECK (n3->second .IsDirty () && !n3->second .IsFresh ());
123+ BOOST_CHECK (n3->second .IsDirty ());
124+ BOOST_CHECK (!n3->second .IsFresh ());
120125 BOOST_CHECK_EQUAL (sentinel.second .Next (), &(*n3));
121126 BOOST_CHECK_EQUAL (n3->second .Next (), &(*n4));
122127 BOOST_CHECK_EQUAL (n3->second .Prev (), &sentinel);
@@ -126,7 +131,8 @@ BOOST_AUTO_TEST_CASE(linked_list_random_deletion)
126131 nodes.erase (n4);
127132 // Check that sentinel still points to n3, and n3 points to sentinel
128133 // Also check that state was not altered
129- BOOST_CHECK (n3->second .IsDirty () && !n3->second .IsFresh ());
134+ BOOST_CHECK (n3->second .IsDirty ());
135+ BOOST_CHECK (!n3->second .IsFresh ());
130136 BOOST_CHECK_EQUAL (sentinel.second .Next (), &(*n3));
131137 BOOST_CHECK_EQUAL (n3->second .Next (), &sentinel);
132138 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &(*n3));
@@ -148,47 +154,53 @@ BOOST_AUTO_TEST_CASE(linked_list_set_state)
148154
149155 // Check that setting DIRTY inserts it into linked list and sets state
150156 CCoinsCacheEntry::SetDirty (n1, sentinel);
151- BOOST_CHECK (n1.second .IsDirty () && !n1.second .IsFresh ());
157+ BOOST_CHECK (n1.second .IsDirty ());
158+ BOOST_CHECK (!n1.second .IsFresh ());
152159 BOOST_CHECK_EQUAL (n1.second .Next (), &sentinel);
153160 BOOST_CHECK_EQUAL (n1.second .Prev (), &sentinel);
154161 BOOST_CHECK_EQUAL (sentinel.second .Next (), &n1);
155162 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &n1);
156163
157164 // Check that setting FRESH on new node inserts it after n1
158165 CCoinsCacheEntry::SetFresh (n2, sentinel);
159- BOOST_CHECK (n2.second .IsFresh () && !n2.second .IsDirty ());
166+ BOOST_CHECK (n2.second .IsFresh ());
167+ BOOST_CHECK (!n2.second .IsDirty ());
160168 BOOST_CHECK_EQUAL (n2.second .Next (), &sentinel);
161169 BOOST_CHECK_EQUAL (n2.second .Prev (), &n1);
162170 BOOST_CHECK_EQUAL (n1.second .Next (), &n2);
163171 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &n2);
164172
165173 // Check that we can set extra state, but they don't change our position
166174 CCoinsCacheEntry::SetFresh (n1, sentinel);
167- BOOST_CHECK (n1.second .IsDirty () && n1.second .IsFresh ());
175+ BOOST_CHECK (n1.second .IsDirty ());
176+ BOOST_CHECK (n1.second .IsFresh ());
168177 BOOST_CHECK_EQUAL (n1.second .Next (), &n2);
169178 BOOST_CHECK_EQUAL (n1.second .Prev (), &sentinel);
170179 BOOST_CHECK_EQUAL (sentinel.second .Next (), &n1);
171180 BOOST_CHECK_EQUAL (n2.second .Prev (), &n1);
172181
173182 // Check that we can clear state then re-set it
174183 n1.second .SetClean ();
175- BOOST_CHECK (!n1.second .IsDirty () && !n1.second .IsFresh ());
184+ BOOST_CHECK (!n1.second .IsDirty ());
185+ BOOST_CHECK (!n1.second .IsFresh ());
176186 BOOST_CHECK_EQUAL (sentinel.second .Next (), &n2);
177187 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &n2);
178188 BOOST_CHECK_EQUAL (n2.second .Next (), &sentinel);
179189 BOOST_CHECK_EQUAL (n2.second .Prev (), &sentinel);
180190
181191 // Calling `SetClean` a second time has no effect
182192 n1.second .SetClean ();
183- BOOST_CHECK (!n1.second .IsDirty () && !n1.second .IsFresh ());
193+ BOOST_CHECK (!n1.second .IsDirty ());
194+ BOOST_CHECK (!n1.second .IsFresh ());
184195 BOOST_CHECK_EQUAL (sentinel.second .Next (), &n2);
185196 BOOST_CHECK_EQUAL (sentinel.second .Prev (), &n2);
186197 BOOST_CHECK_EQUAL (n2.second .Next (), &sentinel);
187198 BOOST_CHECK_EQUAL (n2.second .Prev (), &sentinel);
188199
189200 // Adding DIRTY re-inserts it after n2
190201 CCoinsCacheEntry::SetDirty (n1, sentinel);
191- BOOST_CHECK (n1.second .IsDirty () && !n1.second .IsFresh ());
202+ BOOST_CHECK (n1.second .IsDirty ());
203+ BOOST_CHECK (!n1.second .IsFresh ());
192204 BOOST_CHECK_EQUAL (n2.second .Next (), &n1);
193205 BOOST_CHECK_EQUAL (n1.second .Prev (), &n2);
194206 BOOST_CHECK_EQUAL (n1.second .Next (), &sentinel);
0 commit comments