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

Commit 46245c59 authored by Dan Shi's avatar Dan Shi
Browse files

Convert VtsHalGraphicsMapperV4_0TargetTest to be parameterized test

Bug: 142397658
Test: atest VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I3854f9d4e601d37952e41a5c503f3b1d833c47a5
parent f72f955b
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
#include <gralloctypes/Gralloc4.h>
#include <mapper-vts/4.0/MapperVts.h>

#include <VtsHalHidlTargetTestBase.h>

namespace android {
namespace hardware {
namespace graphics {
@@ -36,19 +34,19 @@ Gralloc::Gralloc(const std::string& allocatorServiceName, const std::string& map
}

void Gralloc::init(const std::string& allocatorServiceName, const std::string& mapperServiceName) {
    mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>(allocatorServiceName);
    mAllocator = IAllocator::getService(allocatorServiceName);
    ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service";

    mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>(mapperServiceName);
    mMapper = IMapper::getService(mapperServiceName);
    ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service";
    ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode";
}

void Gralloc::initNoErr(const std::string& allocatorServiceName,
                        const std::string& mapperServiceName) {
    mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>(allocatorServiceName);
    mAllocator = IAllocator::getService(allocatorServiceName);

    mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>(mapperServiceName);
    mMapper = IMapper::getService(mapperServiceName);
    if (mMapper.get()) {
        ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode";
    }
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include <android/hardware/graphics/allocator/4.0/IAllocator.h>
#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <gtest/gtest.h>
#include <utils/StrongPointer.h>

namespace android {
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,9 @@ cc_test {
    srcs: ["VtsHalGraphicsMapperV4_0TargetTest.cpp"],
    static_libs: [
        "android.hardware.graphics.mapper@4.0-vts",
        "libgralloctypes",
        "libsync",
        "vintf-graphics-common-ndk_platform",
    ],
    shared_libs: [
        "android.hardware.graphics.allocator@4.0",
@@ -28,11 +30,9 @@ cc_test {
        "android.hardware.graphics.common@1.1",
        "android.hardware.graphics.common@1.2",
        "android.hardware.graphics.mapper@4.0",
        "libgralloctypes",
        "vintf-graphics-common-ndk_platform",
    ],
    header_libs: [
        "libsystem_headers",
    ],
    test_suites: ["general-tests"],
    test_suites: ["general-tests", "vts-core"],
}
+104 −124

File changed.

Preview size limit exceeded, changes collapsed.