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

Commit 9894812d authored by Pierre Couillaud's avatar Pierre Couillaud Committed by Valerie Hau
Browse files

vts: VtsHalGraphicsMapperV2_1TargetTest fixup's



1) handles allocated through 'allocate' should be removed through
   'freeBuffer'.

2) make use of intended buffer handle in GetTransportSizeBadBuffer.

Bug: 146444563
Test: build, boot, VtsHalGraphicsMapperV2_1TargetTest
Change-Id: I6c1a67fc36dbc653ec2ada6a335d685d21e82800
Signed-off-by: default avatarPierre Couillaud <pierre.couillaud@broadcom.com>
parent ee37ee92
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -94,7 +94,7 @@ TEST_P(GraphicsMapperHidlTest, ValidateBufferSizeBadBuffer) {
                                                    mDummyDescriptorInfo.width);
                                                    mDummyDescriptorInfo.width);
    ASSERT_EQ(Error::BAD_BUFFER, ret)
    ASSERT_EQ(Error::BAD_BUFFER, ret)
        << "validateBufferSize with raw buffer handle did not fail with BAD_BUFFER";
        << "validateBufferSize with raw buffer handle did not fail with BAD_BUFFER";
    native_handle_delete(rawBufferHandle);
    ASSERT_NO_FATAL_FAILURE(mGralloc->freeBuffer(rawBufferHandle));
}
}


/**
/**
@@ -179,11 +179,11 @@ TEST_P(GraphicsMapperHidlTest, GetTransportSizeBadBuffer) {
    ASSERT_NO_FATAL_FAILURE(rawBufferHandle = const_cast<native_handle_t*>(
    ASSERT_NO_FATAL_FAILURE(rawBufferHandle = const_cast<native_handle_t*>(
                                mGralloc->allocate(mDummyDescriptorInfo, false)));
                                mGralloc->allocate(mDummyDescriptorInfo, false)));
    mGralloc->getMapper()->getTransportSize(
    mGralloc->getMapper()->getTransportSize(
        invalidHandle, [&](const auto& tmpError, const auto&, const auto&) {
            rawBufferHandle, [&](const auto& tmpError, const auto&, const auto&) {
                ASSERT_EQ(Error::BAD_BUFFER, tmpError)
                ASSERT_EQ(Error::BAD_BUFFER, tmpError)
                        << "getTransportSize with raw buffer handle did not fail with BAD_BUFFER";
                        << "getTransportSize with raw buffer handle did not fail with BAD_BUFFER";
            });
            });
    native_handle_delete(rawBufferHandle);
    ASSERT_NO_FATAL_FAILURE(mGralloc->freeBuffer(rawBufferHandle));
}
}


/**
/**