From 1625efc870f1a8b7c6e6382277ddbb245f91a294 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Thu, 10 Jun 2021 18:24:34 +0100 Subject: IVGCVSW-5963 'Move unit tests to new framework' * Used doctest in ArmNN unit tests Signed-off-by: Sadik Armagan Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a --- .../test/OutputShapeOfSqueeze.cpp | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp') diff --git a/src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp b/src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp index e616158f29..395038d959 100644 --- a/src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp +++ b/src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp @@ -3,11 +3,15 @@ // SPDX-License-Identifier: MIT // -#include #include "../TfLiteParser.hpp" #include #include +#include + +TEST_SUITE("TensorflowLiteParser_OutputShapeOfSqueeze") +{ + struct TfLiteParserFixture { @@ -19,41 +23,38 @@ struct TfLiteParserFixture }; -BOOST_AUTO_TEST_SUITE(TensorflowLiteParser); - - -BOOST_FIXTURE_TEST_CASE( EmptySqueezeDims_OutputWithAllDimensionsSqueezed, TfLiteParserFixture ) +TEST_CASE_FIXTURE(TfLiteParserFixture, "EmptySqueezeDims_OutputWithAllDimensionsSqueezed") { std::vector squeezeDims = { }; armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32); armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo); - BOOST_TEST(outputTensorInfo.GetNumElements() == 4); - BOOST_TEST(outputTensorInfo.GetNumDimensions() == 2); - BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 2, 2 }))); + CHECK(outputTensorInfo.GetNumElements() == 4); + CHECK(outputTensorInfo.GetNumDimensions() == 2); + CHECK((outputTensorInfo.GetShape() == armnn::TensorShape({ 2, 2 }))); }; -BOOST_FIXTURE_TEST_CASE( SqueezeDimsNotIncludingSizeOneDimensions_NoDimensionsSqueezedInOutput, TfLiteParserFixture ) +TEST_CASE_FIXTURE(TfLiteParserFixture, "SqueezeDimsNotIncludingSizeOneDimensions_NoDimensionsSqueezedInOutput") { std::vector squeezeDims = { 1, 2 }; armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32); armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo); - BOOST_TEST(outputTensorInfo.GetNumElements() == 4); - BOOST_TEST(outputTensorInfo.GetNumDimensions() == 4); - BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 }))); + CHECK(outputTensorInfo.GetNumElements() == 4); + CHECK(outputTensorInfo.GetNumDimensions() == 4); + CHECK((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 }))); }; -BOOST_FIXTURE_TEST_CASE( SqueezeDimsRangePartial_OutputWithDimensionsWithinRangeSqueezed, TfLiteParserFixture ) +TEST_CASE_FIXTURE(TfLiteParserFixture, "SqueezeDimsRangePartial_OutputWithDimensionsWithinRangeSqueezed") { std::vector squeezeDims = { 1, 3 }; armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32); armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo); - BOOST_TEST(outputTensorInfo.GetNumElements() == 4); - BOOST_TEST(outputTensorInfo.GetNumDimensions() == 3); - BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2 }))); + CHECK(outputTensorInfo.GetNumElements() == 4); + CHECK(outputTensorInfo.GetNumDimensions() == 3); + CHECK((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2 }))); }; -BOOST_AUTO_TEST_SUITE_END(); \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.1