OSDN Git Service

MemoryTest: add method for testing
authorSteven Moreland <smoreland@google.com>
Sat, 7 Jan 2017 02:57:21 +0000 (18:57 -0800)
committerMartijn Coenen <maco@google.com>
Thu, 12 Jan 2017 15:27:43 +0000 (16:27 +0100)
Bug: 34134129
Test: compiles
Change-Id: If0d2a9c00f93f548da5e9261a93d4715412620c3

tests/memory/1.0/IMemoryTest.hal
tests/memory/1.0/default/MemoryTest.cpp
tests/memory/1.0/default/MemoryTest.h

index c20c536..4d6de3f 100644 (file)
@@ -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);
 };
index 40bb2dc..37a2a60 100644 (file)
@@ -34,6 +34,11 @@ namespace V1_0 {
 namespace implementation {
 
 // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+Return<void> Memory::haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) {
+    _hidl_cb(mem);
+    return Void();
+}
+
 Return<void> Memory::fillMemory(const hidl_memory& memory_in, uint8_t filler) {
     sp<IMemory> memory = mapMemory(memory_in);
 
index 5cab494..0d903f1 100644 (file)
@@ -39,6 +39,8 @@ using ::android::sp;
 
 struct Memory : public IMemoryTest {
     // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+    Return<void> haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) override;
+
     Return<void> fillMemory(const hidl_memory& memory_in, uint8_t filler) override;
 
 };