2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "loco/IR/FeatureShape.h"
19 #include <gtest/gtest.h>
21 TEST(FeatureShapeTest, default_constructor)
23 loco::FeatureShape shape;
25 ASSERT_FALSE(shape.count().known());
26 ASSERT_FALSE(shape.depth().known());
27 ASSERT_FALSE(shape.height().known());
28 ASSERT_FALSE(shape.width().known());
31 TEST(FeatureShapeTest, settet_and_getter)
33 loco::FeatureShape shape;
38 ASSERT_TRUE(shape.count().known());
39 ASSERT_FALSE(shape.depth().known());
40 ASSERT_FALSE(shape.height().known());
41 ASSERT_FALSE(shape.width().known());
43 ASSERT_EQ(2, shape.count());
48 ASSERT_TRUE(shape.count().known());
49 ASSERT_TRUE(shape.depth().known());
50 ASSERT_FALSE(shape.height().known());
51 ASSERT_FALSE(shape.width().known());
53 ASSERT_EQ(2, shape.count());
54 ASSERT_EQ(3, shape.depth());
59 ASSERT_TRUE(shape.count().known());
60 ASSERT_TRUE(shape.depth().known());
61 ASSERT_TRUE(shape.height().known());
62 ASSERT_FALSE(shape.width().known());
64 ASSERT_EQ(2, shape.count());
65 ASSERT_EQ(3, shape.depth());
66 ASSERT_EQ(4, shape.height());
71 ASSERT_TRUE(shape.count().known());
72 ASSERT_TRUE(shape.depth().known());
73 ASSERT_TRUE(shape.height().known());
74 ASSERT_TRUE(shape.width().known());
76 ASSERT_EQ(2, shape.count());
77 ASSERT_EQ(3, shape.depth());
78 ASSERT_EQ(4, shape.height());
79 ASSERT_EQ(5, shape.width());