diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-07-30 11:32:26 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-07-30 11:32:26 +0900 |
commit | 05e0ec30a632339a8533082476f27bda31ccde16 (patch) | |
tree | 5f220ac83084fe133ffb08a6a17e99f9bb36ec1c /compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp | |
parent | e2ef8438a24f7c56a0744eb579a6e293ee2fbf8e (diff) | |
download | nnfw-05e0ec30a632339a8533082476f27bda31ccde16.tar.gz nnfw-05e0ec30a632339a8533082476f27bda31ccde16.tar.bz2 nnfw-05e0ec30a632339a8533082476f27bda31ccde16.zip |
Imported Upstream version 1.7.0upstream/1.7.0
Diffstat (limited to 'compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp')
-rw-r--r-- | compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp b/compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp new file mode 100644 index 000000000..18efd869d --- /dev/null +++ b/compiler/luci/lang/src/Nodes/CircleLogistic.test.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "luci/IR/Nodes/CircleLogistic.h" + +#include "luci/IR/CircleDialect.h" +#include "luci/IR/CircleNodeVisitor.h" + +#include <gtest/gtest.h> + +TEST(CircleLogisticTest, constructor) +{ + luci::CircleLogistic logistic_node; + + ASSERT_EQ(luci::CircleDialect::get(), logistic_node.dialect()); + ASSERT_EQ(luci::CircleOpcode::LOGISTIC, logistic_node.opcode()); + + ASSERT_EQ(nullptr, logistic_node.x()); +} + +TEST(CircleLogisticTest, input_NEG) +{ + luci::CircleLogistic logistic_node; + luci::CircleLogistic node; + + logistic_node.x(&node); + ASSERT_NE(nullptr, logistic_node.x()); + + logistic_node.x(nullptr); + ASSERT_EQ(nullptr, logistic_node.x()); +} + +TEST(CircleLogisticTest, arity_NEG) +{ + luci::CircleLogistic logistic_node; + + ASSERT_NO_THROW(logistic_node.arg(0)); + ASSERT_THROW(logistic_node.arg(1), std::out_of_range); +} + +TEST(CircleLogisticTest, visit_mutable_NEG) +{ + struct TestVisitor final : public luci::CircleNodeMutableVisitor<void> + { + }; + + luci::CircleLogistic logistic_node; + + TestVisitor tv; + ASSERT_THROW(logistic_node.accept(&tv), std::exception); +} + +TEST(CircleLogisticTest, visit_NEG) +{ + struct TestVisitor final : public luci::CircleNodeVisitor<void> + { + }; + + luci::CircleLogistic logistic_node; + + TestVisitor tv; + ASSERT_THROW(logistic_node.accept(&tv), std::exception); +} |