aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/UNIT/TensorInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/UNIT/TensorInfo.cpp')
-rw-r--r--tests/validation/UNIT/TensorInfo.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/validation/UNIT/TensorInfo.cpp b/tests/validation/UNIT/TensorInfo.cpp
index 009c757925..b79c1e9253 100644
--- a/tests/validation/UNIT/TensorInfo.cpp
+++ b/tests/validation/UNIT/TensorInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 ARM Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -93,7 +93,7 @@ TEST_CASE(Clone, framework::DatasetMode::ALL)
// Get clone of current tensor info
std::unique_ptr<ITensorInfo> info_clone = info.clone();
- ARM_COMPUTE_EXPECT(info_clone != nullptr, framework::LogLevel::ERRORS);
+ ARM_COMPUTE_ASSERT(info_clone != nullptr);
ARM_COMPUTE_EXPECT(info_clone->total_size() == info.total_size(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(info_clone->num_channels() == info.num_channels(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(info_clone->data_type() == info.data_type(), framework::LogLevel::ERRORS);
@@ -184,8 +184,17 @@ TEST_CASE(SymmPerChannelQuantizationInfo, framework::DatasetMode::ALL)
ARM_COMPUTE_EXPECT(info.quantization_info().offset().empty(), framework::LogLevel::ERRORS);
}
-TEST_SUITE_END() // TensorInfoValidation
-TEST_SUITE_END()
+/** Validates lock paddings flag*/
+TEST_CASE(SubTensorPaddingExpansion, framework::DatasetMode::ALL)
+{
+ TensorInfo tensor_info(TensorShape(23U, 17U, 3U), 1, DataType::F32);
+ tensor_info.set_lock_paddings(true);
+
+ // Now lock padding is set to true, therefore the extend padding would fail
+ ARM_COMPUTE_EXPECT_THROW(tensor_info.extend_padding(PaddingSize(2, 1)), framework::LogLevel::ERRORS);
+}
+TEST_SUITE_END() // TensorInfo
+TEST_SUITE_END() // UNIT
} // namespace validation
} // namespace test
} // namespace arm_compute