--- /dev/null
+/*
+ * Copyright (c) 2019 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 "locomotiv/Session.h"
+#include "locomotiv/NodeData.h"
+
+// This flie is internal test because it includes this local header
+#include "NodeDataImpl.h"
+
+#include <loco.h>
+#include <nncc/core/ADT/tensor/Shape.h>
+#include <nncc/core/ADT/tensor/Buffer.h>
+#include <nncc/core/ADT/tensor/LexicalLayout.h>
+
+#include <gtest/gtest.h>
+
+using nncc::core::ADT::tensor::Shape;
+using nncc::core::ADT::tensor::LexicalLayout;
+using nncc::core::ADT::tensor::make_buffer;
+
+TEST(Session, dtor)
+{
+ auto g = loco::make_graph();
+
+ // Pull node
+ auto pull = g->nodes()->create<loco::Pull>();
+ pull->dtype(loco::DataType::FLOAT32);
+ pull->rank(1);
+ pull->dim(0) = loco::make_dimension(1);
+
+ // Input
+ auto input = g->inputs()->create();
+ input->node(pull);
+
+ {
+ locomotiv::Session s(g.get());
+
+ auto buf = make_buffer<float, LexicalLayout>(Shape{1});
+ auto data = locomotiv::make_data(buf);
+
+ s.set_input(0, std::move(data));
+
+ auto data_annotated = locomotiv::annot_data(input->node());
+ ASSERT_NE(data_annotated, nullptr);
+ }
+
+ auto data_annotated = locomotiv::annot_data(input->node());
+ ASSERT_EQ(data_annotated, nullptr);
+}