| … | … | @@ -209,12 +209,17 @@ void MultiDeleteUTest::test_add_delete(void) |
| 209 | 209 | |
| 210 | 210 | // Size should be 19: the 18 from before plus that annoying |
| 211 | 211 | // (Predicate "*-TruthValueKey-*") |
| 212 | | size_t expected_size = 3 + 6 + n_threads; |
| 213 | | if (as->get_size() != expected_size) |
| 212 | // Well, actually, there is no guarantee that the removes will |
| 213 | // happen after the stores. Best we can do is check lower and |
| 214 | // upper bounds of 18 and 34: |
| 215 | size_t min_size = 3 + n_threads + 6; |
| 216 | size_t max_size = 3 + 2*(n_threads + 6); |
| 217 | if (as->get_size() < min_size or max_size < as->get_size()) |
| 214 | 218 | printf("Error: Bad size! AtomSpace contents =\n%s\n", |
| 215 | 219 | as->to_string().c_str()); |
| 216 | 220 | |
| 217 | | TS_ASSERT_EQUALS(as->get_size(), expected_size); |
| 221 | TS_ASSERT(as->get_size() >= min_size); |
| 222 | TS_ASSERT(as->get_size() <= max_size); |
| 218 | 223 | |
| 219 | 224 | store->erase(); |
| 220 | 225 | store->close(); |