hidl_test: move duplicated code to shared lib

Test: hidl_test

Change-Id: Ia68b78d44d68a6b254c686afe64faf7cc89510d7
diff --git a/tests/pointer/1.0/default/Graph.cpp b/tests/pointer/1.0/default/Graph.cpp
index a43df81..5aa2243 100644
--- a/tests/pointer/1.0/default/Graph.cpp
+++ b/tests/pointer/1.0/default/Graph.cpp
@@ -1,5 +1,6 @@
 #include "Graph.h"
 #include <android-base/logging.h>
+#include <hidl-test/PointerHelper.h>
 
 #define PUSH_ERROR_IF(__cond__) if(__cond__) { errors.push_back(std::to_string(__LINE__) + ": " + #__cond__); }
 
@@ -10,38 +11,6 @@
 namespace V1_0 {
 namespace implementation {
 
-static void simpleGraph(IGraph::Graph& g) {
-    g.nodes.resize(2);
-    g.edges.resize(1);
-    g.nodes[0].data = 10;
-    g.nodes[1].data = 20;
-    g.edges[0].left = &g.nodes[0];
-    g.edges[0].right = &g.nodes[1];
-}
-
-static bool isSimpleGraph(const IGraph::Graph &g) {
-    if(g.nodes.size() != 2) return false;
-    if(g.edges.size() != 1) return false;
-    if(g.nodes[0].data != 10) return false;
-    if(g.nodes[1].data != 20) return false;
-    if(g.edges[0].left != &g.nodes[0]) return false;
-    if(g.edges[0].right != &g.nodes[1]) return false;
-    return true;
-}
-
-static void logSimpleGraph(const char *prefix, const IGraph::Graph& g) {
-    ALOGI("%s Graph %p, %d nodes, %d edges", prefix, &g, (int)g.nodes.size(), (int)g.edges.size());
-    std::ostringstream os;
-    for(size_t i = 0; i < g.nodes.size(); i++)
-      os << &g.nodes[i] << " = " << g.nodes[i].data << ", ";
-    ALOGI("%s Nodes: [%s]", prefix, os.str().c_str());
-    os.str("");
-    os.clear();
-    for(size_t i = 0; i < g.edges.size(); i++)
-      os << g.edges[i].left << " -> " << g.edges[i].right << ", ";
-    ALOGI("%s Edges: [%s]", prefix, os.str().c_str());
-}
-
 // Methods from ::android::hardware::tests::pointer::V1_0::IGraph follow.
 Return<void> Graph::passAGraph(const IGraph::Graph& g) {
     ALOGI("SERVER(Graph) passAGraph start.");