summaryrefslogtreecommitdiffhomepage
path: root/tests/test-flowgraph.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-10-24 16:32:18 +0200
committerRoland Reichwein <mail@reichwein.it>2020-10-24 16:32:18 +0200
commit1011655d2ef76a0c0aa29dbbff091dab139198e3 (patch)
tree63763828f259846f56285691805c187583ecb6bb /tests/test-flowgraph.cpp
parent1349c00b782eca3ea841bfa388301cb6fc908cc7 (diff)
Add FlowGraph
Diffstat (limited to 'tests/test-flowgraph.cpp')
-rw-r--r--tests/test-flowgraph.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/test-flowgraph.cpp b/tests/test-flowgraph.cpp
new file mode 100644
index 0000000..132af4b
--- /dev/null
+++ b/tests/test-flowgraph.cpp
@@ -0,0 +1,50 @@
+#include "flowgraph/data.h"
+#include "flowgraph/graph.h"
+#include "flowgraph/node.h"
+#include "flowgraph/storage.h"
+
+#include <boost/algorithm/string.hpp>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include <algorithm>
+#include <cctype>
+#include <deque>
+#include <map>
+#include <memory>
+#include <string>
+#include <system_error>
+#include <utility>
+#include <vector>
+
+using namespace std::string_literals;
+namespace fs = std::filesystem;
+
+using namespace FlowGraph;
+
+class FlowGraphTest: public ::testing::Test
+{
+protected:
+ FlowGraphTest() {
+ //debug = true;
+ }
+ ~FlowGraphTest() {
+ }
+ void SetUp(){
+ }
+ void TearDown(){
+ }
+};
+
+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) };
+
+ graph.push_back(malloc1);
+ graph.push_back(free1);
+}