This commit makes the verifier TC uses `MockNode.h`.
Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
* limitations under the License.
*/
-#ifndef __NEURUN_TEST_GRAPH_OPERATION_MOCK_NODE_H__
-#define __NEURUN_TEST_GRAPH_OPERATION_MOCK_NODE_H__
+#ifndef __NEURUN_TEST_GRAPH_MOCK_NODE_H__
+#define __NEURUN_TEST_GRAPH_MOCK_NODE_H__
#include "graph/operation/Node.h"
#include "graph/operand/IndexSet.h"
{
namespace graph
{
-namespace operation
-{
class SimpleMockNode : public neurun::graph::operation::Node
{
virtual void accept(neurun::graph::operation::NodeVisitor &&) const override {}
};
-} // namespace operation
} // namespace graph
} // namespace neurun_test
-#endif // __NEURUN_TEST_GRAPH_OPERATION_MOCK_NODE_H__
+#endif // __NEURUN_TEST_GRAPH_MOCK_NODE_H__
#include "graph/Graph.h"
#include "graph/verifier/IVerifier.h"
#include "nnfw/std/memory.h"
-#include "../operation/MockNode.h"
+#include "../MockNode.h"
#include <typeindex>
{
using IndexSet = neurun::graph::operand::IndexSet;
-using MockNode = neurun_test::graph::operation::SimpleMockNode;
+using MockNode = neurun_test::graph::SimpleMockNode;
} // namespace anonymous
#include "graph/verifier/IVerifier.h"
#include "nnfw/std/memory.h"
#include "graph/operand/Index.h"
-#include "MockNode.h"
+#include "../MockNode.h"
#include <typeindex>
using IOIndex = neurun::graph::operand::IO::Index;
using Index = neurun::graph::operand::Index;
using IndexSet = neurun::graph::operand::IndexSet;
-using MockNode = neurun_test::graph::operation::SimpleMockNode;
+using MockNode = neurun_test::graph::SimpleMockNode;
TEST(graph_operation_manipulation, operation_insertion)
{
#include <gtest/gtest.h>
-#include "MockNode.h"
+#include "../MockNode.h"
#include "graph/operation/Set.h"
using neurun::graph::operation::Set;
TEST(graph_operation_Set, operation_test)
{
Set set;
- set.append(std::unique_ptr<Node>(
- new neurun_test::graph::operation::SimpleMockNode({1, 2, 3, 4}, {5, 6, 7})));
+ set.append(
+ std::unique_ptr<Node>(new neurun_test::graph::SimpleMockNode({1, 2, 3, 4}, {5, 6, 7})));
Index idx{0u};
ASSERT_EQ(set.at(idx).getInputs().size(), 4);
ASSERT_EQ(set.at(idx).getOutputs().size(), 3);
#include "graph/verifier/IVerifier.h"
#include "nnfw/std/memory.h"
#include "graph/operand/Object.h"
+#include "../MockNode.h"
-class MockNode : public neurun::graph::operation::Node
-{
-public:
- MockNode(const neurun::graph::operand::Index &input, const neurun::graph::operand::Index &output)
- {
- setInputs({input});
- setOutputs({output});
- }
-
-public:
- virtual void accept(neurun::graph::operation::NodeVisitor &&) const override {}
-};
+using IndexSet = neurun::graph::operand::IndexSet;
+using MockNode = neurun_test::graph::SimpleMockNode;
TEST(Verifier, dag_checker)
{
graph.addOutput(operand2);
graph.operands().at(operand2).setAsOperationOutput();
- graph.addOperation(nnfw::make_unique<MockNode>(operand1, operand2));
+ graph.addOperation(nnfw::make_unique<MockNode>(IndexSet{operand1}, IndexSet{operand2}));
ASSERT_EQ(verifier.verify(graph), true);
// Create cycle
graph.operands().at(operand1).setAsOperationOutput();
- graph.addOperation(nnfw::make_unique<MockNode>(operand2, operand1));
+ graph.addOperation(nnfw::make_unique<MockNode>(IndexSet{operand2}, IndexSet{operand1}));
ASSERT_EQ(verifier.verify(graph), false);
}