Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5493ff1f authored by hsnam.nam@samsung.com's avatar hsnam.nam@samsung.com Committed by Harish Mahendrakar
Browse files

C2 VTS: only InputBufferTest can be skipped for secure codecs



Bug: 191414127

Test: atest VtsHalMediaC2V1_0TargetComponentTest

Change-Id: I6a6503b893008ca7175819f0ec12dca1fb74052d
Signed-off-by: default avatarhsnam.nam@samsung.com <hsnam.nam@samsung.com>
(cherry picked from commit 79244e57)
parent 6320947b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ class Codec2ComponentHidlTestBase : public ::testing::Test {
  public:
    virtual void SetUp() override {
        getParams();
        mDisableTest = false;
        mEos = false;
        mClient = android::Codec2Client::CreateFromService(mInstanceName.c_str());
        ASSERT_NE(mClient, nullptr);
@@ -73,6 +74,14 @@ class Codec2ComponentHidlTestBase : public ::testing::Test {
        for (int i = 0; i < MAX_INPUT_BUFFERS; ++i) {
            mWorkQueue.emplace_back(new C2Work);
        }

        C2SecureModeTuning secureModeTuning{};
        mComponent->query({&secureModeTuning}, {}, C2_MAY_BLOCK, nullptr);
        if (secureModeTuning.value != C2Config::SM_UNPROTECTED) {
            mDisableTest = true;
        }

        if (mDisableTest) std::cout << "[   WARN   ] Test Disabled \n";
    }

    virtual void TearDown() override {
@@ -105,6 +114,7 @@ class Codec2ComponentHidlTestBase : public ::testing::Test {
    std::string mInstanceName;
    std::string mComponentName;
    bool mEos;
    bool mDisableTest;
    std::mutex mQueueLock;
    std::condition_variable mQueueCondition;
    std::list<std::unique_ptr<C2Work>> mWorkQueue;
@@ -324,6 +334,7 @@ class Codec2ComponentInputTests : public Codec2ComponentHidlTestBase,
};

TEST_P(Codec2ComponentInputTests, InputBufferTest) {
    if (mDisableTest) GTEST_SKIP() << "Test is disabled";
    description("Tests for different inputs");

    uint32_t flags = std::get<2>(GetParam());