| … | … | @@ -197,12 +197,17 @@ void MultiDeleteUTest::test_add_delete(void) |
| 197 | 197 | |
| 198 | 198 | // Size should be 19: the 18 from before plus that annoying |
| 199 | 199 | // (Predicate "*-TruthValueKey-*") |
| 200 | | size_t expected_size = 3 + n_threads + 6; |
| 201 | | if (as->get_size() != expected_size) |
| 200 | // Well, actually, there is no guarantee that the removes will |
| 201 | // happen after the stores. Best we can do is check lower and |
| 202 | // upper bounds of 18 and 34: |
| 203 | size_t min_size = 3 + n_threads + 6; |
| 204 | size_t max_size = 3 + 2*(n_threads + 6); |
| 205 | if (as->get_size() < min_size or max_size < as->get_size()) |
| 202 | 206 | printf("Error: Bad size! AtomSpace contents =\n%s\n", |
| 203 | 207 | as->to_string().c_str()); |
| 204 | 208 | |
| 205 | | TS_ASSERT_EQUALS(as->get_size(), expected_size); |
| 209 | TS_ASSERT(as->get_size() >= min_size); |
| 210 | TS_ASSERT(as->get_size() <= max_size); |
| 206 | 211 | |
| 207 | 212 | store->erase(); |
| 208 | 213 | store->close(); |