| … | … | @@ -19,7 +19,7 @@ TARGET_LINK_LIBRARIES(SimpleFetchUTest execution) |
| 19 | 19 | ADD_CXXTEST(SimpleAlphaEquivUTest) |
| 20 | 20 | ADD_CXXTEST(SimpleMultiPersistUTest) |
| 21 | 21 | ADD_CXXTEST(SimpleMultiUserUTest) |
| 22 | # ADD_CXXTEST(SimpleMultiDeleteUTest) | |
| 22 | ADD_CXXTEST(SimpleMultiDeleteUTest) | |
| 23 | 23 | ADD_CXXTEST(SimpleQueryPersistUTest) |
| 24 | 24 | # |
| 25 | 25 | # At this time, the multi-space tests are guaranteed to fail, |
| … | … | @@ -184,10 +184,10 @@ void SimpleMultiDeleteUTest::test_add_delete(void) |
| 184 | 184 | printf("Post-update AtomSpace size=%lu\n", as->get_size()); |
| 185 | 185 | // printf("AtomSpace contents =\n%s\n", as->to_string().c_str()); |
| 186 | 186 | |
| 187 | // Verify the local AtomSpace size. Should be 18: | |
| 188 | // The CogStrageNode itself, the (Concept "aaaa") and | |
| 189 | // 16 from thread-id modulo 17 | |
| 190 | TS_ASSERT_EQUALS(as->get_size(), 8 + n_threads); | |
| 187 | // Verify the local AtomSpace size. Should be 34: | |
| 188 | // The CogStorageNode itself, the (Concept "aaaa") and | |
| 189 | // 16 from thread-id modulo 16 plus 16 ListLinks. | |
| 190 | TS_ASSERT_EQUALS(as->get_size(), 2 + 2*(n_threads+6)); | |
| 191 | 191 | |
| 192 | 192 | // Verify the remote AtomSpace: pull everything from the |
| 193 | 193 | // cogserver, back to here. Do this "independently", by |
| … | … | @@ -198,7 +198,7 @@ void SimpleMultiDeleteUTest::test_add_delete(void) |
| 198 | 198 | HandleSeq hs; |
| 199 | 199 | as->get_handles_by_type(hs, CONCEPT_NODE); |
| 200 | 200 | for (const Handle& h : hs) |
| 201 | as->extract_atom(h); | |
| 201 | as->extract_atom(h, true); | |
| 202 | 202 | hs.clear(); |
| 203 | 203 | printf("AtomSpace contents =\n%s\n", as->to_string().c_str()); |
| 204 | 204 | TS_ASSERT_EQUALS(as->get_size(), 1); |
| … | … | @@ -209,22 +209,14 @@ void SimpleMultiDeleteUTest::test_add_delete(void) |
| 209 | 209 | store->load_atomspace(); |
| 210 | 210 | printf("Final AtomSpace size=%lu\n", as->get_size()); |
| 211 | 211 | |
| 212 | #if THIS_IS_NOT_TRUE | |
| 213 | 212 | // Size should be 19: the 18 from before plus that annoying |
| 214 | 213 | // (Predicate "*-TruthValueKey-*") |
| 215 | // | |
| 216 | // Well, but this will not hold true, because the insert and | |
| 217 | // remove ran in different threads, asynchronously, and so | |
| 218 | // there may have been inserts after the "matching" remove. | |
| 219 | // This is rare for this test (about one out of 30 runs) | |
| 220 | // but happens a lot for the regular MultiDeleteUTest. | |
| 221 | size_t expected_size = 9 + n_threads; | |
| 214 | size_t expected_size = 3 + 6 + n_threads; | |
| 222 | 215 | if (as->get_size() != expected_size) |
| 223 | 216 | printf("Error: Bad size! AtomSpace contents =\n%s\n", |
| 224 | 217 | as->to_string().c_str()); |
| 225 | 218 | |
| 226 | 219 | TS_ASSERT_EQUALS(as->get_size(), expected_size); |
| 227 | #endif | |
| 228 | 220 | |
| 229 | 221 | store->erase(); |
| 230 | 222 | store->close(); |
| … | … | @@ -19,7 +19,7 @@ ADD_CXXTEST(AlphaEquivUTest) |
| 19 | 19 | ADD_CXXTEST(QueryPersistUTest) |
| 20 | 20 | ADD_CXXTEST(MultiPersistUTest) |
| 21 | 21 | ADD_CXXTEST(MultiUserUTest) |
| 22 | # ADD_CXXTEST(MultiDeleteUTest) | |
| 22 | ADD_CXXTEST(MultiDeleteUTest) | |
| 23 | 23 | |
| 24 | 24 | ADD_CXXTEST(LargeFlatUTest) |
| 25 | 25 | ADD_CXXTEST(LargeZipfUTest) |
| … | … | @@ -182,10 +182,10 @@ void MultiDeleteUTest::test_add_delete(void) |
| 182 | 182 | printf("Post-update AtomSpace size=%lu\n", as->get_size()); |
| 183 | 183 | // printf("AtomSpace contents =\n%s\n", as->to_string().c_str()); |
| 184 | 184 | |
| 185 | // Verify the local AtomSpace size. Should be 18: | |
| 185 | // Verify the local AtomSpace size. Should be 34: | |
| 186 | 186 | // The CogStrageNode itself, the (Concept "aaaa") and |
| 187 | // 16 from thread-id modulo 17 | |
| 188 | TS_ASSERT_EQUALS(as->get_size(), 8 + n_threads); | |
| 187 | // 16 from thread-id modulo 16 | |
| 188 | TS_ASSERT_EQUALS(as->get_size(), 2 + 2*(n_threads+6)); | |
| 189 | 189 | |
| 190 | 190 | // Verify the remote AtomSpace: pull everything from the |
| 191 | 191 | // cogserver, back to here. Do this "independently", by |
| … | … | @@ -196,7 +196,7 @@ void MultiDeleteUTest::test_add_delete(void) |
| 196 | 196 | HandleSeq hs; |
| 197 | 197 | as->get_handles_by_type(hs, CONCEPT_NODE); |
| 198 | 198 | for (const Handle& h : hs) |
| 199 | as->extract_atom(h); | |
| 199 | as->extract_atom(h, true); | |
| 200 | 200 | hs.clear(); |
| 201 | 201 | printf("AtomSpace contents =\n%s\n", as->to_string().c_str()); |
| 202 | 202 | TS_ASSERT_EQUALS(as->get_size(), 1); |
| … | … | @@ -207,20 +207,14 @@ void MultiDeleteUTest::test_add_delete(void) |
| 207 | 207 | store->load_atomspace(); |
| 208 | 208 | printf("Final AtomSpace size=%lu\n", as->get_size()); |
| 209 | 209 | |
| 210 | #if THIS_IS_NOT_TRUE | |
| 211 | 210 | // Size should be 19: the 18 from before plus that annoying |
| 212 | 211 | // (Predicate "*-TruthValueKey-*") |
| 213 | // | |
| 214 | // Well, but this will not hold true, because the insert and | |
| 215 | // remove ran in different threads, asynchronously, and so | |
| 216 | // there may have been inserts after the "matching" remove. | |
| 217 | size_t expected_size = 9 + n_threads; | |
| 212 | size_t expected_size = 3 + 6 + n_threads; | |
| 218 | 213 | if (as->get_size() != expected_size) |
| 219 | 214 | printf("Error: Bad size! AtomSpace contents =\n%s\n", |
| 220 | 215 | as->to_string().c_str()); |
| 221 | 216 | |
| 222 | 217 | TS_ASSERT_EQUALS(as->get_size(), expected_size); |
| 223 | #endif | |
| 224 | 218 | |
| 225 | 219 | store->erase(); |
| 226 | 220 | store->close(); |