From 49f262471d8456ee3e421ea112c9c34dda58774f Mon Sep 17 00:00:00 2001 From: Pierre Couillaud Date: Thu, 27 Feb 2020 11:48:01 -0800 Subject: [PATCH] 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 Cherry pick to master from android10-tests-dev Change-Id: I6c1a67fc36dbc653ec2ada6a335d685d21e82800 Merged-In: I6c1a67fc36dbc653ec2ada6a335d685d21e82800 Signed-off-by: Pierre Couillaud --- .../VtsHalGraphicsMapperV2_1TargetTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp b/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp index 1185945775..3d792f9f8e 100644 --- a/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp +++ b/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp @@ -94,7 +94,7 @@ TEST_P(GraphicsMapperHidlTest, ValidateBufferSizeBadBuffer) { mDummyDescriptorInfo.width); ASSERT_EQ(Error::BAD_BUFFER, ret) << "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( mGralloc->allocate(mDummyDescriptorInfo, false))); mGralloc->getMapper()->getTransportSize( - invalidHandle, [&](const auto& tmpError, const auto&, const auto&) { - ASSERT_EQ(Error::BAD_BUFFER, tmpError) - << "getTransportSize with raw buffer handle did not fail with BAD_BUFFER"; - }); - native_handle_delete(rawBufferHandle); + rawBufferHandle, [&](const auto& tmpError, const auto&, const auto&) { + ASSERT_EQ(Error::BAD_BUFFER, tmpError) + << "getTransportSize with raw buffer handle did not fail with BAD_BUFFER"; + }); + ASSERT_NO_FATAL_FAILURE(mGralloc->freeBuffer(rawBufferHandle)); } /**