OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-generate commits / fdf2841

Port to the new AtomSpace API
fdf2841fe061528fcba210550970c2e16b229f01
by Linas Vepstas <linasvepstas@gmail.com> · 2021-12-01T04:13:10.000Z

Changed files (3) +12 -9

tests/generate/AggregationUTest.cxxtest +4 -3
……@@ -27,6 +27,7 @@ using namespace opencog;
2727class AggregationUTest: public CxxTest::TestSuite
2828{
2929private:
30 AtomSpacePtr asp;
3031 AtomSpace* as;
3132 SchemeEval* eval;
3233 Aggregate* ag;
……@@ -75,7 +76,8 @@ AggregationUTest::~AggregationUTest()
7576
7677void AggregationUTest::setUp()
7778{
78 as = new AtomSpace();
79 asp = createAtomSpace();
80 as = asp.get();
7981 eval = new SchemeEval(as);
8082 eval->eval("(add-to-load-path \"" PROJECT_SOURCE_DIR "\")");
8183 ag = new Aggregate(as);
……@@ -85,7 +87,6 @@ void AggregationUTest::tearDown()
8587{
8688 delete ag;
8789 delete eval;
88 delete as;
8990}
9091
9192void AggregationUTest::setup_dict()
……@@ -100,7 +101,7 @@ void AggregationUTest::setup_dict()
100101
101102 // The lexis to use
102103 HandleSet lex;
103 as->get_handleset_by_type(lex, SECTION);
104 as->get_handleset_by_type(std::inserter(lex, lex.end()), SECTION);
104105 dict->add_to_lexis(lex);
105106}
106107
tests/generate/BasicNetworkUTest.cxxtest +4 -3
……@@ -27,6 +27,7 @@ using namespace opencog;
2727class BasicNetworkUTest: public CxxTest::TestSuite
2828{
2929private:
30 AtomSpacePtr asp;
3031 AtomSpace* as;
3132 SchemeEval* eval;
3233 Aggregate* ag;
……@@ -68,7 +69,8 @@ BasicNetworkUTest::~BasicNetworkUTest()
6869
6970void BasicNetworkUTest::setUp()
7071{
71 as = new AtomSpace();
72 asp = createAtomSpace();
73 as = asp.get();
7274 eval = new SchemeEval(as);
7375 eval->eval("(add-to-load-path \"" PROJECT_SOURCE_DIR "\")");
7476 ag = new Aggregate(as);
……@@ -78,7 +80,6 @@ void BasicNetworkUTest::tearDown()
7880{
7981 delete ag;
8082 delete eval;
81 delete as;
8283}
8384
8485void BasicNetworkUTest::setup_dict()
……@@ -91,7 +92,7 @@ void BasicNetworkUTest::setup_dict()
9192
9293 // The lexis to use XXX we should generate not read from file.
9394 HandleSet lex;
94 as->get_handleset_by_type(lex, SECTION);
95 as->get_handleset_by_type(std::inserter(lex, lex.end()), SECTION);
9596 dict->add_to_lexis(lex);
9697}
9798
tests/generate/GraphUTest.cxxtest +4 -3
……@@ -24,6 +24,7 @@ using namespace opencog;
2424class GraphUTest: public CxxTest::TestSuite
2525{
2626private:
27 AtomSpacePtr asp;
2728 AtomSpace* as;
2829 SchemeEval* eval;
2930 Aggregate* ag;
……@@ -65,7 +66,8 @@ GraphUTest::~GraphUTest()
6566
6667void GraphUTest::setUp()
6768{
68 as = new AtomSpace();
69 asp = createAtomSpace();
70 as = asp.get();
6971 eval = new SchemeEval(as);
7072 eval->eval("(add-to-load-path \"" PROJECT_SOURCE_DIR "\")");
7173 ag = new Aggregate(as);
……@@ -75,7 +77,6 @@ void GraphUTest::tearDown()
7577{
7678 delete ag;
7779 delete eval;
78 delete as;
7980}
8081
8182void GraphUTest::setup_dict()
……@@ -88,7 +89,7 @@ void GraphUTest::setup_dict()
8889
8990 // The lexis to use XXX we should generate not read from file.
9091 HandleSet lex;
91 as->get_handleset_by_type(lex, SECTION);
92 as->get_handleset_by_type(std::inserter(lex, lex.end()), SECTION);
9293 dict->add_to_lexis(lex);
9394}
9495