From 6de0aa81a369c6c38792fd863972bf241a377b36 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 6 Jan 2017 18:57:21 -0800 Subject: [PATCH] MemoryTest: add method for testing Bug: 34134129 Test: compiles Change-Id: If0d2a9c00f93f548da5e9261a93d4715412620c3 --- tests/memory/1.0/IMemoryTest.hal | 1 + tests/memory/1.0/default/MemoryTest.cpp | 5 +++++ tests/memory/1.0/default/MemoryTest.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tests/memory/1.0/IMemoryTest.hal b/tests/memory/1.0/IMemoryTest.hal index c20c536e8e..4d6de3f2fc 100644 --- a/tests/memory/1.0/IMemoryTest.hal +++ b/tests/memory/1.0/IMemoryTest.hal @@ -17,5 +17,6 @@ package android.hardware.tests.memory@1.0; interface IMemoryTest { + haveSomeMemory(memory mem) generates(memory mem); fillMemory(memory memory_in, uint8_t filler); }; diff --git a/tests/memory/1.0/default/MemoryTest.cpp b/tests/memory/1.0/default/MemoryTest.cpp index 40bb2dc7e4..37a2a6065a 100644 --- a/tests/memory/1.0/default/MemoryTest.cpp +++ b/tests/memory/1.0/default/MemoryTest.cpp @@ -34,6 +34,11 @@ namespace V1_0 { namespace implementation { // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow. +Return Memory::haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) { + _hidl_cb(mem); + return Void(); +} + Return Memory::fillMemory(const hidl_memory& memory_in, uint8_t filler) { sp memory = mapMemory(memory_in); diff --git a/tests/memory/1.0/default/MemoryTest.h b/tests/memory/1.0/default/MemoryTest.h index 5cab49427a..0d903f157f 100644 --- a/tests/memory/1.0/default/MemoryTest.h +++ b/tests/memory/1.0/default/MemoryTest.h @@ -39,6 +39,8 @@ using ::android::sp; struct Memory : public IMemoryTest { // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow. + Return haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) override; + Return fillMemory(const hidl_memory& memory_in, uint8_t filler) override; };