OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-rocks commits / c82f3f6

More test conversions
c82f3f6436a2bb6b0235e134d766f665643d1dc0
by Linas Vepstas <linasvepstas@gmail.com> · 2026-01-19T00:05:04.000Z

Changed files (4) +102 -90

tests/persist/monospace/MonoAlphaEquivUTest.cxxtest +16 -16
……@@ -31,7 +31,7 @@
3131#include <opencog/atoms/base/Link.h>
3232#include <opencog/atoms/base/Node.h>
3333#include <opencog/atoms/value/FloatValue.h>
34#include <opencog/atoms/value/FloatValue.h>
34#include <opencog/atoms/value/VoidValue.h>
3535#include <opencog/atomspace/AtomSpace.h>
3636#include <opencog/persist/rocks-types/atom_types.h>
3737#include <opencog/persist/monospace/MonoStorage.h>
……@@ -43,7 +43,7 @@ using namespace opencog;
4343class AlphaEquivUTest : public CxxTest::TestSuite
4444{
4545 private:
46 AtomSpace* _as;
46 AtomSpacePtr _as;
4747 std::string uri;
4848
4949 public:
……@@ -123,11 +123,11 @@ void AlphaEquivUTest::setup_data(void)
123123{
124124 kill_data();
125125
126 _as = new AtomSpace();
126 _as = createAtomSpace();
127127
128128 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
129129 StorageNodePtr store = StorageNodeCast(hsn);
130 store->open();
130 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
131131 TS_ASSERT(store->connected())
132132
133133 /* Populate the Storage with stuff that we will later query. */
……@@ -140,7 +140,7 @@ void AlphaEquivUTest::setup_data(void)
140140 store->store_atomspace();
141141 store->barrier();
142142
143 delete _as;
143 _as = nullptr;
144144}
145145
146146// ============================================================
……@@ -152,10 +152,10 @@ void AlphaEquivUTest::test_fetch(void)
152152
153153 setup_data();
154154
155 _as = new AtomSpace();
155 _as = createAtomSpace();
156156 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
157157 StorageNodePtr store = StorageNodeCast(hsn);
158 store->open();
158 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
159159 TS_ASSERT(store->connected())
160160
161161 // Fetch an alpha-equivalent lambda link.
……@@ -183,7 +183,7 @@ void AlphaEquivUTest::test_fetch(void)
183183 FloatValuePtr fvp = FloatValueCast(fu);
184184 TSM_ASSERT_EQUALS("Expecting three floats", fvp->size(), 3);
185185
186 delete _as;
186 _as = nullptr;
187187
188188 logger().info("END TEST: %s", __FUNCTION__);
189189}
……@@ -197,15 +197,15 @@ void AlphaEquivUTest::test_remove(void)
197197
198198 setup_data();
199199
200 _as = new AtomSpace();
200 _as = createAtomSpace();
201201 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
202202 StorageNodePtr store = StorageNodeCast(hsn);
203 store->open();
203 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
204204 TS_ASSERT(store->connected())
205205
206206 // Remove the alpha-equivalent lambda link.
207207 Handle ly = al(LAMBDA_LINK, an(VARIABLE, "Y"), an(CONCEPT, "A"));
208 store->remove_atom(_as, ly);
208 store->remove_atom(_as.get(), ly);
209209 store->barrier();
210210 ly = Handle::UNDEFINED;
211211
……@@ -221,7 +221,7 @@ void AlphaEquivUTest::test_remove(void)
221221 ValuePtr fu = lx->getValue(an(PREDICATE, "foo"));
222222 TSM_ASSERT("Expecting null value", nullptr == fu);
223223
224 delete _as;
224 _as = nullptr;
225225
226226 logger().info("END TEST: %s", __FUNCTION__);
227227}
……@@ -235,15 +235,15 @@ void AlphaEquivUTest::test_recursive_remove(void)
235235
236236 setup_data();
237237
238 _as = new AtomSpace();
238 _as = createAtomSpace();
239239 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
240240 StorageNodePtr store = StorageNodeCast(hsn);
241 store->open();
241 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
242242 TS_ASSERT(store->connected())
243243
244244 // Recursive remove Concept "A".
245245 Handle ca = an(CONCEPT, "A");
246 store->remove_atom(_as, ca, true);
246 store->remove_atom(_as.get(), ca, true);
247247 store->barrier();
248248
249249 // What happens if we look for the original?
……@@ -258,7 +258,7 @@ void AlphaEquivUTest::test_recursive_remove(void)
258258 ValuePtr fu = lx->getValue(an(PREDICATE, "foo"));
259259 TSM_ASSERT("Expecting null value", nullptr == fu);
260260
261 delete _as;
261 _as = nullptr;
262262
263263 logger().info("END TEST: %s", __FUNCTION__);
264264}
tests/persist/monospace/MonoDeleteUTest.cxxtest +54 -47
……@@ -33,6 +33,7 @@
3333#include <opencog/atoms/base/Link.h>
3434#include <opencog/atoms/base/Node.h>
3535#include <opencog/atoms/value/FloatValue.h>
36#include <opencog/atoms/value/VoidValue.h>
3637#include <opencog/atomspace/AtomSpace.h>
3738#include <opencog/persist/rocks-types/atom_types.h>
3839#include <opencog/persist/monospace/MonoStorage.h>
……@@ -44,7 +45,7 @@ using namespace opencog;
4445class DeleteUTest : public CxxTest::TestSuite
4546{
4647 private:
47 AtomSpace* _as;
48 AtomSpacePtr _as;
4849 std::string uri;
4950
5051 NodePtr n1[10];
……@@ -113,12 +114,12 @@ DeleteUTest:: DeleteUTest(void)
113114 */
114115void DeleteUTest::setUp(void)
115116{
116 _as = new AtomSpace();
117 _as = createAtomSpace();
117118}
118119
119120void DeleteUTest::tearDown(void)
120121{
121 delete _as;
122 _as = nullptr;
122123}
123124
124125// ============================================================
……@@ -390,11 +391,11 @@ void DeleteUTest::extract_links(int idx, AtomSpace *as)
390391// the AtomSpace)
391392void DeleteUTest::delete_links(int idx, StorageNodePtr store)
392393{
393 store->remove_atom(_as, hl3[idx]);
394 store->remove_atom(_as.get(), hl3[idx]);
394395 store->barrier();
395 store->remove_atom(_as, hl2[idx]);
396 store->remove_atom(_as.get(), hl2[idx]);
396397 store->barrier();
397 store->remove_atom(_as, hl[idx]);
398 store->remove_atom(_as.get(), hl[idx]);
398399 store->barrier();
399400
400401 _as->extract_atom(hl3[idx]);
……@@ -412,7 +413,7 @@ void DeleteUTest::extract_nodes(int idx, AtomSpace *as)
412413// This should delete all the links and one node from storage.
413414void DeleteUTest::delete_nodes(int idx, StorageNodePtr store)
414415{
415 store->remove_atom(_as, h3[idx], true);
416 store->remove_atom(_as.get(), h3[idx], true);
416417 store->barrier();
417418 _as->extract_atom(h3[idx], true);
418419}
……@@ -425,33 +426,34 @@ void DeleteUTest::test_remove(void)
425426
426427 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
427428 StorageNodePtr store = StorageNodeCast(hsn);
428 store->open();
429 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
429430 TS_ASSERT(store->connected())
430431
431432 int idx = 0;
432 add_to_space(idx++, _as, "AA-aa-wow ");
433 add_to_space(idx++, _as, "BB-bb-wow ");
434 add_to_space(idx++, _as, "CC-cc-wow ");
435 add_to_space(idx++, _as, "DD-dd-wow ");
436 add_to_space(idx++, _as, "EE-ee-wow ");
433 add_to_space(idx++, _as.get(), "AA-aa-wow ");
434 add_to_space(idx++, _as.get(), "BB-bb-wow ");
435 add_to_space(idx++, _as.get(), "CC-cc-wow ");
436 add_to_space(idx++, _as.get(), "DD-dd-wow ");
437 add_to_space(idx++, _as.get(), "EE-ee-wow ");
437438
438439 /* Make sure UTF-8 works fine. */
439 add_to_space(idx++, _as, "Попытка выбраться вызвала слабый стон ");
440 add_to_space(idx++, _as, "はにがうりだそうであってるのかはち ");
441 add_to_space(idx++, _as, "係拉丁字母");
440 add_to_space(idx++, _as.get(), "Попытка выбраться вызвала слабый стон ");
441 add_to_space(idx++, _as.get(), "はにがうりだそうであってるのかはち ");
442 add_to_space(idx++, _as.get(), "係拉丁字母");
442443
443444 /* Verify that the atoms were added */
444445 int i;
445446 for (i=0; i<idx; i++)
446 check_space(i, _as, "verify-add");
447 check_space(i, _as.get(), "verify-add");
447448
448449 /* Push all atoms out to storage */
449450 store->store_atomspace();
450451
451452 // *-IsKeyFlag-* is not added until after store_atomspace
452 printf("Initial Atomspace size=%lu expect=%d\n", _as->get_size(), 7*idx+1);
453 // +1 for (Predicate "*-open-*")
454 printf("Initial Atomspace size=%lu expect=%d\n", _as->get_size(), 7*idx+2);
453455 TSM_ASSERT("Initial unexpected atomspace size",
454 ((unsigned)(7*idx+1)) == _as->get_size());
456 ((unsigned)(7*idx+2)) == _as->get_size());
455457 /* Delete some atoms with non-empty incoming sets.
456458 * This should result in their being removed from the atomspace,
457459 * but NOT fom the backend!
……@@ -459,16 +461,17 @@ void DeleteUTest::test_remove(void)
459461 store->barrier();
460462
461463 for (i=0; i<idx; i++)
462 extract_links(i, _as);
464 extract_links(i, _as.get());
463465
464466 // *-IsKeyFlag-* is not added until after fetch
465 printf("Atomspace size=%lu expect=%d\n", _as->get_size(), 4*idx+1);
466 TSM_ASSERT("Post-extract unexpected atomspace size", ((unsigned)(4*idx+1)) == _as->get_size());
467 // +1 for (Predicate "*-open-*")
468 printf("Atomspace size=%lu expect=%d\n", _as->get_size(), 4*idx+2);
469 TSM_ASSERT("Post-extract unexpected atomspace size", ((unsigned)(4*idx+2)) == _as->get_size());
467470
468471 /* Verify that the atoms can still be fetched from storage. */
469472 for (i=0; i<idx; i++) {
470473 fetch_space(i, store);
471 check_space(i, _as, "verify-fetch");
474 check_space(i, _as.get(), "verify-fetch");
472475 }
473476
474477 /* This time, kill them in the backend too. */
……@@ -476,20 +479,22 @@ void DeleteUTest::test_remove(void)
476479 delete_links(i, store);
477480
478481 // +2 for *-TruthValueKey-* and *-IsKeyFlag-*
479 printf("Post-remove size=%lu expect=%d\n", _as->get_size(), 4*idx+3);
482 // +1 for (Predicate "*-open-*")
483 printf("Post-remove size=%lu expect=%d\n", _as->get_size(), 4*idx+4);
480484 TSM_ASSERT("Post-remove unexpected atomspace size",
481 ((unsigned)(4*idx+3)) == _as->get_size());
485 ((unsigned)(4*idx+4)) == _as->get_size());
482486
483487 /* Verify that the atoms are really gone from storage. */
484488 for (i=0; i<idx; i++) {
485489 fetch_space(i, store);
486 check_remove(i, _as, "verify-gone");
490 check_remove(i, _as.get(), "verify-gone");
487491 }
488492
489493 // +2 for *-TruthValueKey-* and *-IsKeyFlag-*
490 printf("Post-referesh size=%lu expect=%d\n", _as->get_size(), 7*idx+3);
494 // +1 for (Predicate "*-open-*")
495 printf("Post-referesh size=%lu expect=%d\n", _as->get_size(), 7*idx+4);
491496 TSM_ASSERT("Post-refetch unexpected atomspace size",
492 ((unsigned)(7*idx+3)) == _as->get_size());
497 ((unsigned)(7*idx+4)) == _as->get_size());
493498
494499 /* Kill data for good */
495500 _as->clear();
……@@ -497,7 +502,7 @@ void DeleteUTest::test_remove(void)
497502
498503 /* Verify that the atoms are no longer being found. */
499504 for (i=0; i<idx; i++)
500 check_empty(i, _as);
505 check_empty(i, _as.get());
501506
502507 logger().debug("END TEST: %s", __FUNCTION__);
503508}
……@@ -510,26 +515,26 @@ void DeleteUTest::test_recurse(void)
510515
511516 Handle hsn = _as->add_node(MONO_STORAGE_NODE, std::string(uri));
512517 StorageNodePtr store = StorageNodeCast(hsn);
513 store->open();
518 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
514519
515520 TS_ASSERT(store->connected())
516521
517522 int idx = 0;
518 add_to_space(idx++, _as, "AA-aa-wow ");
519 add_to_space(idx++, _as, "BB-bb-wow ");
520 add_to_space(idx++, _as, "CC-cc-wow ");
521 add_to_space(idx++, _as, "DD-dd-wow ");
522 add_to_space(idx++, _as, "EE-ee-wow ");
523 add_to_space(idx++, _as.get(), "AA-aa-wow ");
524 add_to_space(idx++, _as.get(), "BB-bb-wow ");
525 add_to_space(idx++, _as.get(), "CC-cc-wow ");
526 add_to_space(idx++, _as.get(), "DD-dd-wow ");
527 add_to_space(idx++, _as.get(), "EE-ee-wow ");
523528
524529 /* Make sure UTF-8 works fine. */
525 add_to_space(idx++, _as, "Попытка выбраться вызвала слабый стон ");
526 add_to_space(idx++, _as, "はにがうりだそうであってるのかはち ");
527 add_to_space(idx++, _as, "係拉丁字母");
530 add_to_space(idx++, _as.get(), "Попытка выбраться вызвала слабый стон ");
531 add_to_space(idx++, _as.get(), "はにがうりだそうであってるのかはち ");
532 add_to_space(idx++, _as.get(), "係拉丁字母");
528533
529534 /* Verify that the atoms were added */
530535 int i;
531536 for (i=0; i<idx; i++)
532 check_space(i, _as, "verify-add");
537 check_space(i, _as.get(), "verify-add");
533538
534539 /* Push all atoms out to the SQL DB */
535540 store->store_atomspace();
……@@ -542,10 +547,11 @@ void DeleteUTest::test_recurse(void)
542547
543548 int zap = 4;
544549 for (i=0; i<zap; i++)
545 extract_nodes(i, _as);
550 extract_nodes(i, _as.get());
546551
547552 // *-IsKeyFlag-* is not added until after fetch
548 size_t expsz = 7*(idx-zap) + 3*zap + 1;
553 // +1 for (Predicate "*-open-*")
554 size_t expsz = 7*(idx-zap) + 3*zap + 2;
549555 printf("Atomspace size=%lu expect=%lu\n",
550556 _as->get_size(), expsz);
551557 TSM_ASSERT("Unexpected atomspace size", expsz == _as->get_size());
……@@ -553,7 +559,7 @@ void DeleteUTest::test_recurse(void)
553559 /* Verify that the atoms can still be fetched from storage. */
554560 for (i=0; i<idx; i++) {
555561 fetch_space(i, store);
556 check_space(i, _as, "verify-fetch");
562 check_space(i, _as.get(), "verify-fetch");
557563 }
558564
559565 /* This time, kill them in the backend too. */
……@@ -573,19 +579,20 @@ void DeleteUTest::test_recurse(void)
573579 }
574580
575581 // +2 for *-TruthValueKey-* and *-IsKeyFlag-*
582 // +1 for (Predicate "*-open-*")
576583 printf("Post-refetch size=%lu expect=%d\n",
577 _as->get_size(), 7*idx+3);
584 _as->get_size(), 7*idx+4);
578585 TSM_ASSERT("Unexpected atomspace size",
579 ((unsigned) 7*idx+3) == _as->get_size());
586 ((unsigned) 7*idx+4) == _as->get_size());
580587
581588 /* Check that the removed atoms really got zapped. */
582589 for (i=0; i<zap; i++) {
583 check_remove(i, _as, "verify-zapped");
590 check_remove(i, _as.get(), "verify-zapped");
584591 }
585592
586593 /* However, others should still be there. */
587594 for (i=zap; i<idx; i++) {
588 check_space(i, _as, "verify-zap");
595 check_space(i, _as.get(), "verify-zap");
589596 }
590597
591598 /* Kill data for good */
……@@ -594,7 +601,7 @@ void DeleteUTest::test_recurse(void)
594601
595602 /* Verify that the atoms are no longer being found. */
596603 for (i=0; i<idx; i++)
597 check_empty(i, _as);
604 check_empty(i, _as.get());
598605
599606 logger().debug("END TEST: %s", __FUNCTION__);
600607}
tests/persist/monospace/MonoMultiDeleteUTest.cxxtest +12 -8
……@@ -34,6 +34,7 @@
3434#include <opencog/atoms/atom_types/atom_types.h>
3535#include <opencog/atoms/value/FloatValue.h>
3636#include <opencog/atoms/value/LinkValue.h>
37#include <opencog/atoms/value/VoidValue.h>
3738#include <opencog/atomspace/AtomSpace.h>
3839#include <opencog/persist/rocks-types/atom_types.h>
3940
……@@ -127,7 +128,7 @@ void MultiDeleteUTest::worker(int thread_id)
127128 if (nullptr == li) continue;
128129
129130 // Remove the link.
130 store->remove_atom(as, li);
131 store->remove_atom(as.get(), li);
131132 }
132133 }
133134
……@@ -151,7 +152,7 @@ void MultiDeleteUTest::test_add_delete(void)
151152 Handle hsn = as->add_node(MONO_STORAGE_NODE, std::string(uri));
152153 store = StorageNodeCast(hsn);
153154
154 store->open();
155 store->setValue(as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
155156 TS_ASSERT(store->connected())
156157
157158 // Clear out left-over junk, just in case.
……@@ -174,13 +175,14 @@ void MultiDeleteUTest::test_add_delete(void)
174175 // Verify the local AtomSpace size. Should be 34:
175176 // The StorageNode itself, the (Concept "aaaa") and
176177 // 16 Concept and Lists from thread-id modulo 16
177 TS_ASSERT_EQUALS(as->get_size(), 2 + 2*(n_threads+6));
178 // +1 for (Predicate "*-open-*")
179 TS_ASSERT_EQUALS(as->get_size(), 3 + 2*(n_threads+6));
178180
179181 // Verify the DB contents: pull everything from the DB,
180182 // back to here. Do this "independently", by closing and
181183 // reopening; this forces the Storagenode through assorted
182184 // flush and close code, potentially exposing bugs.
183 store->close();
185 store->setValue(as->add_node(PREDICATE_NODE, "*-close-*"), createVoidValue());
184186
185187 HandleSeq hs;
186188 as->get_handles_by_type(hs, CONCEPT_NODE);
……@@ -188,9 +190,10 @@ void MultiDeleteUTest::test_add_delete(void)
188190 as->extract_atom(h, true);
189191 hs.clear();
190192 printf("AtomSpace contents =\n%s\n", as->to_string().c_str());
191 TS_ASSERT_EQUALS(as->get_size(), 1);
193 // +1 for (Predicate "*-open-*"), +1 for (Predicate "*-close-*")
194 TS_ASSERT_EQUALS(as->get_size(), 3);
192195
193 store->open();
196 store->setValue(as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
194197 TS_ASSERT(store->connected())
195198
196199 store->load_atomspace();
……@@ -198,7 +201,8 @@ void MultiDeleteUTest::test_add_delete(void)
198201
199202 // Size should be 19: the 18 from before plus that annoying
200203 // (Predicate "*-TruthValueKey-*")
201 size_t expected_size = 3 + n_threads + 6;
204 // +1 for (Predicate "*-open-*"), +1 for (Predicate "*-close-*")
205 size_t expected_size = 5 + n_threads + 6;
202206 if (as->get_size() != expected_size)
203207 printf("Error: Bad size! AtomSpace contents =\n%s\n",
204208 as->to_string().c_str());
……@@ -206,8 +210,8 @@ void MultiDeleteUTest::test_add_delete(void)
206210 TS_ASSERT_EQUALS(as->get_size(), expected_size);
207211
208212 store->erase();
209 store->close();
210213 store = nullptr;
214 as = nullptr;
211215
212216 logger().debug("END TEST: %s", __FUNCTION__);
213217}
tests/persist/monospace/MonoMultiPersistUTest.cxxtest +20 -19
……@@ -38,6 +38,7 @@
3838#include <opencog/persist/monospace/MonoStorage.h>
3939
4040#include <opencog/atoms/value/FloatValue.h>
41#include <opencog/atoms/value/VoidValue.h>
4142
4243#include <opencog/util/Logger.h>
4344
……@@ -46,7 +47,7 @@ using namespace opencog;
4647class MultiPersistUTest : public CxxTest::TestSuite
4748{
4849 private:
49 AtomSpace *_as;
50 AtomSpacePtr _as;
5051 StorageNodePtr store;
5152
5253#define NTHREADS 6
……@@ -127,18 +128,18 @@ MultiPersistUTest:: MultiPersistUTest(void)
127128 */
128129void MultiPersistUTest::setUp(void)
129130{
130 _as = new AtomSpace();
131 _as = createAtomSpace();
131132
132133 Handle hsn = _as->add_node(MONO_STORAGE_NODE, "monospace:///tmp/cog-mono-multi-persist-utest");
133134 store = StorageNodeCast(hsn);
134 store->open();
135 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
135136 TS_ASSERT(store->connected())
136137}
137138
138139void MultiPersistUTest::tearDown(void)
139140{
140 store->close();
141 delete _as;
141 store.reset();
142 _as = nullptr;
142143}
143144
144145// ============================================================
……@@ -384,20 +385,20 @@ void MultiPersistUTest::threaded_add(int thread_id)
384385 int idx = 0;
385386 int off = NHACK*thread_id;
386387
387 add_to_space(off + idx++, _as, store, "AA-aa-wow ");
388 add_to_space(off + idx++, _as, store, "BB-bb-wow ");
389 add_to_space(off + idx++, _as, store, "CC-cc-wow ");
390 add_to_space(off + idx++, _as, store, "DD-dd-wow ");
391 add_to_space(off + idx++, _as, store, "EE-ee-wow ");
388 add_to_space(off + idx++, _as.get(), store, "AA-aa-wow ");
389 add_to_space(off + idx++, _as.get(), store, "BB-bb-wow ");
390 add_to_space(off + idx++, _as.get(), store, "CC-cc-wow ");
391 add_to_space(off + idx++, _as.get(), store, "DD-dd-wow ");
392 add_to_space(off + idx++, _as.get(), store, "EE-ee-wow ");
392393
393394 /* Make sure UTF-8 works fine. */
394 add_to_space(off + idx++, _as, store, "Попытка выбраться вызвала слабый стон ");
395 add_to_space(off + idx++, _as, store, "はにがうりだそうであってるのかはち ");
396 add_to_space(off + idx++, _as, store, "係拉丁字母");
395 add_to_space(off + idx++, _as.get(), store, "Попытка выбраться вызвала слабый стон ");
396 add_to_space(off + idx++, _as.get(), store, "はにがうりだそうであってるのかはち ");
397 add_to_space(off + idx++, _as.get(), store, "係拉丁字母");
397398
398399 /* Verify that the atoms were added */
399400 for (int i=0; i<idx; i++)
400 check_space(off+i, _as, "verify-add");
401 check_space(off+i, _as.get(), "verify-add");
401402}
402403
403404// ============================================================
……@@ -431,7 +432,7 @@ void MultiPersistUTest::test_atomspace(void)
431432 /* The clear above nuked the storage, so restart */
432433 Handle hsn = _as->add_node(MONO_STORAGE_NODE, "monospace:///tmp/cog-mono-multi-persist-utest");
433434 store = StorageNodeCast(hsn);
434 store->open();
435 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
435436 TS_ASSERT(store->connected())
436437
437438 int i, off;
……@@ -440,7 +441,7 @@ void MultiPersistUTest::test_atomspace(void)
440441 for (off=0; off<n_threads; off++)
441442 for (i=0; i<NATS; i++) {
442443 fetch_space(NHACK*off+i, store);
443 check_space(NHACK*off+i, _as, "verify-fetch-idx=" + std::to_string(i));
444 check_space(NHACK*off+i, _as.get(), "verify-fetch-idx=" + std::to_string(i));
444445 }
445446
446447 /* Do it again, for good luck. */
……@@ -450,14 +451,14 @@ void MultiPersistUTest::test_atomspace(void)
450451 /* The clear above nuked the storage, so restart */
451452 hsn = _as->add_node(MONO_STORAGE_NODE, "monospace:///tmp/cog-mono-multi-persist-utest");
452453 store = StorageNodeCast(hsn);
453 store->open();
454 store->setValue(_as->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
454455 TS_ASSERT(store->connected())
455456
456457 /* Verify that the atoms can still be fetched from storage. */
457458 for (off=0; off<n_threads; off++)
458459 for (i=0; i<NATS; i++) {
459460 fetch_space(NHACK*off+i, store);
460 check_space(NHACK*off+i, _as, "verify-again");
461 check_space(NHACK*off+i, _as.get(), "verify-again");
461462 }
462463
463464 /* Kill data for good */
……@@ -467,7 +468,7 @@ void MultiPersistUTest::test_atomspace(void)
467468 /* Verify that the atoms are no longer being found. */
468469 for (off=0; off<n_threads; off++)
469470 for (i=0; i<NATS; i++)
470 check_empty(NHACK*off+i, _as);
471 check_empty(NHACK*off+i, _as.get());
471472
472473 logger().debug("END TEST: %s", __FUNCTION__);
473474}