diff options
Diffstat (limited to 'neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp')
-rw-r--r-- | neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp index 1929750d28..57bc1aed54 100644 --- a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -1125,12 +1125,15 @@ TEST_P(MemoryDomainExecutionTest, InvalidDimensions) { utils::toSigned(kTestOperand.dimensions).value()); if (deviceBuffer.buffer == nullptr) return; - RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); - RequestMemoryPool deviceMemory = createDeviceMemoryPool(deviceBuffer.token); + // Use an incompatible dimension and make sure the length matches with the bad dimension. auto badDimensions = utils::toSigned(kTestOperand.dimensions).value(); badDimensions[0] = 2; + const uint32_t badTestOperandDataSize = kTestOperandDataSize * 2; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(badTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(deviceBuffer.token); RequestArgument sharedMemoryArg = { - .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}, + .location = {.poolIndex = 0, .offset = 0, .length = badTestOperandDataSize}, .dimensions = badDimensions}; RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; RequestArgument deviceMemoryArgWithBadDimensions = {.location = {.poolIndex = 1}, |