diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2022-10-10 15:41:19 +0100 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2022-10-11 10:33:12 +0000 |
commit | e497ed17463820eb33ca051254efd08c892325b5 (patch) | |
tree | 5602e3b0a7105ec1c26d3d38901bf156999ded80 /src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp | |
parent | 149e5f328579729b8e5d6459098c1c5cb95bb4bd (diff) | |
download | armnn-e497ed17463820eb33ca051254efd08c892325b5.tar.gz |
Fix TosaOperatorMapping tests when building for release
* Asserts are removed during a release build, which causes build
failures due to unused variables.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Ie36f2bd22f5b2916b03ba7e64c1895fdf21f11f0
Diffstat (limited to 'src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp')
-rw-r--r-- | src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp b/src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp index 2f5a56d88d..a2949d61ac 100644 --- a/src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp +++ b/src/backends/tosaCommon/test/TosaOperatorMappingTests.cpp @@ -21,15 +21,15 @@ void AssertTosaOneToOneMappingBasicBlock(TosaSerializationBasicBlock* basicBlock DType dataType = DType_FLOAT) { std::string blockStr = operatorString + "_block_"; - ARMNN_ASSERT(basicBlock->GetName().find(blockStr) != std::string::npos); - ARMNN_ASSERT(basicBlock->GetInputs().size() == numInputs); - ARMNN_ASSERT(basicBlock->GetOutputs().size() == numOutputs); - ARMNN_ASSERT(basicBlock->GetOperators().size() == 1); - ARMNN_ASSERT(basicBlock->GetTensors().size() == (numInputs + numOutputs)); + CHECK(basicBlock->GetName().find(blockStr) != std::string::npos); + CHECK(basicBlock->GetInputs().size() == numInputs); + CHECK(basicBlock->GetOutputs().size() == numOutputs); + CHECK(basicBlock->GetOperators().size() == 1); + CHECK(basicBlock->GetTensors().size() == (numInputs + numOutputs)); TosaSerializationOperator* op = basicBlock->GetOperators().at(0); - ARMNN_ASSERT(op->GetInputTensorNames().size() == numInputs); - ARMNN_ASSERT(op->GetOutputTensorNames().size() == numOutputs); + CHECK(op->GetInputTensorNames().size() == numInputs); + CHECK(op->GetOutputTensorNames().size() == numOutputs); for (uint32_t i = 0; i < numInputs; i++) { @@ -39,9 +39,9 @@ void AssertTosaOneToOneMappingBasicBlock(TosaSerializationBasicBlock* basicBlock std::string opStr = operatorString + "_input" + std::to_string(i) + "_"; - ARMNN_ASSERT(blockInputName == operatorInputName); - ARMNN_ASSERT(tensorName == operatorInputName); - ARMNN_ASSERT(blockInputName.find(opStr) != std::string::npos); + CHECK(blockInputName == operatorInputName); + CHECK(tensorName == operatorInputName); + CHECK(blockInputName.find(opStr) != std::string::npos); } for (uint32_t i = 0; i < numOutputs; i++) @@ -52,18 +52,18 @@ void AssertTosaOneToOneMappingBasicBlock(TosaSerializationBasicBlock* basicBlock std::string opStr = operatorString + "_output" + std::to_string(i) + "_"; - ARMNN_ASSERT(blockOutputName == operatorOutputName); - ARMNN_ASSERT(tensorName == operatorOutputName); - ARMNN_ASSERT(blockOutputName.find(opStr) != std::string::npos); + CHECK(blockOutputName == operatorOutputName); + CHECK(tensorName == operatorOutputName); + CHECK(blockOutputName.find(opStr) != std::string::npos); } - ARMNN_ASSERT(op->GetAttributeType() == Attribute_NONE); - ARMNN_ASSERT(op->GetOp() == tosaOp); + CHECK(op->GetAttributeType() == Attribute_NONE); + CHECK(op->GetOp() == tosaOp); TosaSerializationTensor* tensor0 = basicBlock->GetTensors()[0]; - ARMNN_ASSERT(tensor0->GetDtype() == dataType); - ARMNN_ASSERT(tensor0->GetData().size() == 0); - ARMNN_ASSERT(tensor0->GetShape() == shape); + CHECK(tensor0->GetDtype() == dataType); + CHECK(tensor0->GetData().size() == 0); + CHECK(tensor0->GetShape() == shape); } TEST_SUITE("TosaOperatorMappingOneToOneTests") @@ -109,16 +109,16 @@ TEST_CASE("GetTosaMapping_Unimplemented") TosaSerializationBasicBlock* basicBlock = GetTosaMapping(LayerType::UnidirectionalSequenceLstm, {}, {}, BaseDescriptor()); - ARMNN_ASSERT(basicBlock->GetName() == ""); - ARMNN_ASSERT(basicBlock->GetTensors().size() == 0); - ARMNN_ASSERT(basicBlock->GetOperators().size() == 1); - ARMNN_ASSERT(basicBlock->GetInputs().size() == 0); - ARMNN_ASSERT(basicBlock->GetOutputs().size() == 0); + CHECK(basicBlock->GetName() == ""); + CHECK(basicBlock->GetTensors().size() == 0); + CHECK(basicBlock->GetOperators().size() == 1); + CHECK(basicBlock->GetInputs().size() == 0); + CHECK(basicBlock->GetOutputs().size() == 0); TosaSerializationOperator* op = basicBlock->GetOperators()[0]; - ARMNN_ASSERT(op->GetAttributeType() == Attribute_NONE); - ARMNN_ASSERT(op->GetOp() == tosa::Op_UNKNOWN); - ARMNN_ASSERT(op->GetInputTensorNames().size() == 0); - ARMNN_ASSERT(op->GetOutputTensorNames().size() == 0); + CHECK(op->GetAttributeType() == Attribute_NONE); + CHECK(op->GetOp() == tosa::Op_UNKNOWN); + CHECK(op->GetInputTensorNames().size() == 0); + CHECK(op->GetOutputTensorNames().size() == 0); } } |