diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-10 18:24:34 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-11 10:33:16 +0000 |
commit | 1625efc870f1a8b7c6e6382277ddbb245f91a294 (patch) | |
tree | 39fbbaa15ed7eb81337b082c2d20b0af68b91c02 /src/armnnTfLiteParser/test/Reshape.cpp | |
parent | 958e0ba61e940a8d11955cf2a10f681c7c47e1fa (diff) | |
download | armnn-1625efc870f1a8b7c6e6382277ddbb245f91a294.tar.gz |
IVGCVSW-5963 'Move unit tests to new framework'
* Used doctest in ArmNN unit tests
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a
Diffstat (limited to 'src/armnnTfLiteParser/test/Reshape.cpp')
-rw-r--r-- | src/armnnTfLiteParser/test/Reshape.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/armnnTfLiteParser/test/Reshape.cpp b/src/armnnTfLiteParser/test/Reshape.cpp index 025612f097..0824a27f87 100644 --- a/src/armnnTfLiteParser/test/Reshape.cpp +++ b/src/armnnTfLiteParser/test/Reshape.cpp @@ -3,15 +3,14 @@ // SPDX-License-Identifier: MIT // -#include <boost/test/unit_test.hpp> #include "ParserFlatbuffersFixture.hpp" #include "../TfLiteParser.hpp" #include <string> #include <iostream> -BOOST_AUTO_TEST_SUITE(TensorflowLiteParser) - +TEST_SUITE("TensorflowLiteParser_Reshape") +{ struct ReshapeFixture : public ParserFlatbuffersFixture { explicit ReshapeFixture(const std::string& inputShape, @@ -83,13 +82,13 @@ struct ReshapeFixtureWithReshapeDims : ReshapeFixture ReshapeFixtureWithReshapeDims() : ReshapeFixture("[ 1, 9 ]", "[ 3, 3 ]", "[ 3, 3 ]") {} }; -BOOST_FIXTURE_TEST_CASE(ParseReshapeWithReshapeDims, ReshapeFixtureWithReshapeDims) +TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDims, "ParseReshapeWithReshapeDims") { SetupSingleInputSingleOutput("inputTensor", "outputTensor"); RunTest<2, armnn::DataType::QAsymmU8>(0, { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9 }); - BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() + CHECK((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() == armnn::TensorShape({3,3}))); } @@ -98,13 +97,13 @@ struct ReshapeFixtureWithReshapeDimsFlatten : ReshapeFixture ReshapeFixtureWithReshapeDimsFlatten() : ReshapeFixture("[ 3, 3 ]", "[ 9 ]", "[ -1 ]") {} }; -BOOST_FIXTURE_TEST_CASE(ParseReshapeWithReshapeDimsFlatten, ReshapeFixtureWithReshapeDimsFlatten) +TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlatten, "ParseReshapeWithReshapeDimsFlatten") { SetupSingleInputSingleOutput("inputTensor", "outputTensor"); RunTest<1, armnn::DataType::QAsymmU8>(0, { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9 }); - BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() + CHECK((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() == armnn::TensorShape({9}))); } @@ -113,13 +112,13 @@ struct ReshapeFixtureWithReshapeDimsFlattenTwoDims : ReshapeFixture ReshapeFixtureWithReshapeDimsFlattenTwoDims() : ReshapeFixture("[ 3, 2, 3 ]", "[ 2, 9 ]", "[ 2, -1 ]") {} }; -BOOST_FIXTURE_TEST_CASE(ParseReshapeWithReshapeDimsFlattenTwoDims, ReshapeFixtureWithReshapeDimsFlattenTwoDims) +TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlattenTwoDims, "ParseReshapeWithReshapeDimsFlattenTwoDims") { SetupSingleInputSingleOutput("inputTensor", "outputTensor"); RunTest<2, armnn::DataType::QAsymmU8>(0, { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }, { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }); - BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() + CHECK((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() == armnn::TensorShape({2,9}))); } @@ -128,13 +127,13 @@ struct ReshapeFixtureWithReshapeDimsFlattenOneDim : ReshapeFixture ReshapeFixtureWithReshapeDimsFlattenOneDim() : ReshapeFixture("[ 2, 9 ]", "[ 2, 3, 3 ]", "[ 2, -1, 3 ]") {} }; -BOOST_FIXTURE_TEST_CASE(ParseReshapeWithReshapeDimsFlattenOneDim, ReshapeFixtureWithReshapeDimsFlattenOneDim) +TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlattenOneDim, "ParseReshapeWithReshapeDimsFlattenOneDim") { SetupSingleInputSingleOutput("inputTensor", "outputTensor"); RunTest<3, armnn::DataType::QAsymmU8>(0, { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }, { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }); - BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() + CHECK((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape() == armnn::TensorShape({2,3,3}))); } @@ -145,7 +144,7 @@ struct DynamicReshapeFixtureWithReshapeDimsFlattenOneDim : ReshapeFixture "[ 2, -1, 3 ]") {} }; -BOOST_FIXTURE_TEST_CASE(DynParseReshapeWithReshapeDimsFlattenOneDim, DynamicReshapeFixtureWithReshapeDimsFlattenOneDim) +TEST_CASE_FIXTURE(DynamicReshapeFixtureWithReshapeDimsFlattenOneDim, "DynParseReshapeWithReshapeDimsFlattenOneDim") { SetupSingleInputSingleOutput("inputTensor", "outputTensor"); RunTest<3, @@ -156,4 +155,4 @@ BOOST_FIXTURE_TEST_CASE(DynParseReshapeWithReshapeDimsFlattenOneDim, DynamicResh true); } -BOOST_AUTO_TEST_SUITE_END() +} |