summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-cpp.cpp6
-rw-r--r--tests/test-flowgraph.cpp14
2 files changed, 16 insertions, 4 deletions
diff --git a/tests/test-cpp.cpp b/tests/test-cpp.cpp
index 39e1513..5755516 100644
--- a/tests/test-cpp.cpp
+++ b/tests/test-cpp.cpp
@@ -86,6 +86,12 @@ TEST_F(CppTest, compile) {
cpp.compile("int main() { return 1 + 2; }");
}
+TEST_F(CppTest, compile_1) {
+ CPP cpp;
+
+ cpp.compile("int main() { return 1; }");
+}
+
TEST_F(CppTest, compile_2_times) {
CPP cpp;
diff --git a/tests/test-flowgraph.cpp b/tests/test-flowgraph.cpp
index f0cc204..021d6dd 100644
--- a/tests/test-flowgraph.cpp
+++ b/tests/test-flowgraph.cpp
@@ -40,12 +40,18 @@ protected:
TEST_F(FlowGraphTest, build_graph) {
Graph graph;
- Data pointer{ MakeLocalPointer("malloc1") };
- Data size{ MakeLocalSize("size1") };
- std::shared_ptr<Node> malloc1 {std::make_shared<AllocateDynamic>(pointer, size) };
- std::shared_ptr<Node> free1{ std::make_shared<DeallocateDynamic>(pointer) };
+ std::shared_ptr<CreateScopeOp> createScope{std::make_shared<CreateScopeOp>()};
+ graph.push_back(createScope);
+ Data pointer{ MakeLocalPointer(createScope->scope(), "malloc1") };
+ Data size{ MakeLocalSize(createScope->scope(), "size1") };
+ std::shared_ptr<Node> malloc1 {std::make_shared<AllocateDynamic>(pointer, size) };
graph.push_back(malloc1);
+
+ std::shared_ptr<Node> free1{ std::make_shared<DeallocateDynamic>(pointer) };
graph.push_back(free1);
+
+ std::shared_ptr<Node> destroyScope{std::make_shared<DestroyScopeOp>()};
+ graph.push_back(destroyScope);
}