OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-rocks commits / 4ab67c2

Revert more Claude fruitcake nutiness
4ab67c29829aa58806ec057f8dbdd30b45cc5b32
by Linas Vepstas <linasvepstas@gmail.com> · 2026-01-18T23:16:43.000Z

Changed files (1) +29 -32

tests/persist/monospace/MonoBasicSaveUTest.cxxtest +29 -32
……@@ -368,46 +368,43 @@ void MonoBasicSaveUTest::test_table()
368368{
369369 logger().debug("BEGIN TEST: %s", __FUNCTION__);
370370
371 size_t num_stored;
372
373 // Use scope block to ensure as1 is destroyed before as2 opens
371 AtomSpacePtr as1 = createAtomSpace();
372 Handle hsn = as1->add_node(MONO_STORAGE_NODE, std::string(uri));
373 StorageNodePtr store = StorageNodeCast(hsn);
374 store->setValue(as1->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
375 if (!store->connected())
374376 {
375 AtomSpacePtr as1 = createAtomSpace();
376 Handle hsn = as1->add_node(MONO_STORAGE_NODE, std::string(uri));
377 StorageNodePtr store = StorageNodeCast(hsn);
378 store->setValue(as1->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
379 if (!store->connected())
380 {
381 logger().debug("test_table: cannot connect to db");
382 return;
383 }
377 logger().debug("test_table: cannot connect to db");
378 return;
379 }
384380
385 int idx = 0;
386 add_to_table(idx++, as1.get(), "AA-aa-wow ");
387 add_to_table(idx++, as1.get(), "BB-bb-wow ");
388 add_to_table(idx++, as1.get(), "CC-cc-wow ");
389 add_to_table(idx++, as1.get(), "DD-dd-wow ");
390 add_to_table(idx++, as1.get(), "EE-ee-wow ");
381 int idx = 0;
382 add_to_table(idx++, as1.get(), "AA-aa-wow ");
383 add_to_table(idx++, as1.get(), "BB-bb-wow ");
384 add_to_table(idx++, as1.get(), "CC-cc-wow ");
385 add_to_table(idx++, as1.get(), "DD-dd-wow ");
386 add_to_table(idx++, as1.get(), "EE-ee-wow ");
391387
392 store->store_atomspace();
393 // Subtract 2 for the MonoStorageNode and *-open-* PredicateNode
394 num_stored = as1->get_size() - 2;
388 store->store_atomspace();
389 // Subtract 2 for the MonoStorageNode and *-open-* PredicateNode
390 size_t num_stored = as1->get_size() - 2;
395391#ifdef DOPRT
396 HandleSeq hset;
397 as1->get_handles_by_type(hset, ATOM, true, false);
398 for (auto h: hset) {
399 printf("Store table has %s\n", h->to_string().c_str());
400 }
392 HandleSeq hset;
393 as1->get_handles_by_type(hset, ATOM, true, false);
394 for (auto h: hset) {
395 printf("Store table has %s\n", h->to_string().c_str());
396 }
401397#endif
402398
403 printf("Done storing table; size=%lu\n", num_stored);
404 }
405 // as1 goes out of scope here, storage is closed automatically
399 printf("Done storing table; size=%lu\n", num_stored);
400
401 // Clobber as1 to close storage.
402 as1 = nullptr;
406403
407404 // Reopen connection, and load the atom table.
408405 AtomSpacePtr as2 = createAtomSpace();
409 Handle hsn = as2->add_node(MONO_STORAGE_NODE, std::string(uri));
410 StorageNodePtr store = StorageNodeCast(hsn);
406 hsn = as2->add_node(MONO_STORAGE_NODE, std::string(uri));
407 store = StorageNodeCast(hsn);
411408 store->setValue(as2->add_node(PREDICATE_NODE, "*-open-*"), createVoidValue());
412409 TSM_ASSERT("Not connected to database", store->connected());
413410
……@@ -421,7 +418,7 @@ void MonoBasicSaveUTest::test_table()
421418 // and (PredicateNode "*-IsKeyFlag-*")
422419 TSM_ASSERT("Wrong number of atoms fetched", num_fetched == num_stored+2);
423420
424 int idx = 0;
421 idx = 0;
425422 check_table(idx++, as2.get(), "aaa ");
426423 check_table(idx++, as2.get(), "bbb ");
427424 check_table(idx++, as2.get(), "ccc ");