OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-cog commits / 43987e3

Bring the last two unit tests back to life
43987e3fdbc1912c8f2baf5d3891451583bc428c
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-08T19:40:27.000Z

Changed files (4) +11 -3

tests/persist/cog-simple/CMakeLists.txt +1 -1
……@@ -15,7 +15,7 @@ ADD_CXXTEST(SimplePersistUTest)
1515ADD_CXXTEST(SimpleFetchUTest)
1616TARGET_LINK_LIBRARIES(SimpleFetchUTest execution)
1717ADD_CXXTEST(SimpleBasicDeleteUTest)
18# ADD_CXXTEST(SimpleDeleteUTest)
18ADD_CXXTEST(SimpleDeleteUTest)
1919ADD_CXXTEST(SimpleAlphaEquivUTest)
2020ADD_CXXTEST(SimpleMultiPersistUTest)
2121ADD_CXXTEST(SimpleMultiUserUTest)
tests/persist/cog-simple/SimpleDeleteUTest.cxxtest +4 -0
……@@ -399,6 +399,9 @@ void DeleteUTest::delete_links(int idx, StorageNodePtr store)
399399 store->remove_atom(_as, hl3[idx]);
400400 store->remove_atom(_as, hl2[idx]);
401401 store->remove_atom(_as, hl[idx]);
402 _as->extract_atom(hl3[idx]);
403 _as->extract_atom(hl2[idx]);
404 _as->extract_atom(hl[idx]);
402405}
403406
404407// This removes all the links, and one node, from atomspace,
……@@ -412,6 +415,7 @@ void DeleteUTest::extract_nodes(int idx, AtomSpacePtr as)
412415void DeleteUTest::delete_nodes(int idx, StorageNodePtr store)
413416{
414417 store->remove_atom(_as, h3[idx], true);
418 _as->extract_atom(h3[idx], true);
415419}
416420
417421// ============================================================
tests/persist/cog-storage/CMakeLists.txt +1 -1
……@@ -14,7 +14,7 @@ ADD_CXXTEST(PersistUTest)
1414ADD_CXXTEST(FetchUTest)
1515TARGET_LINK_LIBRARIES(FetchUTest execution)
1616ADD_CXXTEST(BasicDeleteUTest)
17# ADD_CXXTEST(DeleteUTest)
17ADD_CXXTEST(DeleteUTest)
1818ADD_CXXTEST(AlphaEquivUTest)
1919ADD_CXXTEST(QueryPersistUTest)
2020ADD_CXXTEST(MultiPersistUTest)
tests/persist/cog-storage/DeleteUTest.cxxtest +5 -1
……@@ -131,7 +131,7 @@ void DeleteUTest::tearDown(void)
131131
132132void DeleteUTest::atomCompare(Handle a, AtomPtr b, std::string where)
133133{
134 printf("Check %s expect %s\n", where.c_str(), a->to_string().c_str());
134 logger().debug("Check %s expect %s", where.c_str(), a->to_string().c_str());
135135 TSM_ASSERT("No atom found", b != nullptr);
136136
137137 if (nullptr == b) return;
……@@ -397,10 +397,13 @@ void DeleteUTest::extract_links(int idx, AtomSpacePtr as)
397397void DeleteUTest::delete_links(int idx, StorageNodePtr store)
398398{
399399 store->remove_atom(_as, hl3[idx]);
400 _as->extract_atom(hl3[idx]);
400401 store->barrier();
401402 store->remove_atom(_as, hl2[idx]);
403 _as->extract_atom(hl2[idx]);
402404 store->barrier();
403405 store->remove_atom(_as, hl[idx]);
406 _as->extract_atom(hl[idx]);
404407 store->barrier();
405408}
406409
……@@ -415,6 +418,7 @@ void DeleteUTest::extract_nodes(int idx, AtomSpacePtr as)
415418void DeleteUTest::delete_nodes(int idx, StorageNodePtr store)
416419{
417420 store->remove_atom(_as, h3[idx], true);
421 _as->extract_atom(h3[idx], true);
418422 store->barrier();
419423}
420424