Home | History | Annotate | Download | only in hidl_test

Lines Matching defs:memory

12 #include <android/hidl/memory/1.0/IMemory.h>
13 #include <android/hidl/memory/token/1.0/IMemoryToken.h>
31 #include <android/hardware/tests/memory/1.0/IMemoryTest.h>
108 using ::android::hardware::tests::memory::V1_0::IMemoryTest;
124 using ::android::hidl::memory::V1_0::IMemory;
125 using ::android::hidl::memory::token::V1_0::IMemoryToken;
126 using ::android::hidl::memory::block::V1_0::MemoryBlock;
343 memoryTest = IMemoryTest::getService("memory", mode == PASSTHROUGH /* getStub */);
802 sp<IMemory> memory = mapMemory(mem);
804 EXPECT_NE(memory, nullptr);
806 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
809 EXPECT_EQ(memory->getSize(), mem.size());
811 memory->update();
812 memset(data, 0, memory->getSize());
813 memory->commit();
818 memory->read();
822 memory->commit();
825 // Test the memory persists after the call
826 sp<IMemory> memory = mapMemory(mem_copy);
828 EXPECT_NE(memory, nullptr);
830 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
833 memory->read();
837 memory->commit();
844 memory.clear();
845 memory = mapMemory(mem_move);
847 EXPECT_NE(memory, nullptr);
849 data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
852 memory->read();
856 memory->commit();
870 sp<IMemory> memory = mapMemory(batch[i]);
872 EXPECT_NE(nullptr, memory.get());
874 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
877 EXPECT_EQ(memory->getSize(), batch[i].size());
879 memory->update();
880 memset(data, kValue, memory->getSize());
881 memory->commit();
888 // Test the memory persists after the call
889 sp<IMemory> memory = mapMemory(batchCopy[i]);
891 EXPECT_NE(memory, nullptr);
893 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
896 memory->read();
900 memory->commit();
921 sp<IMemory> memory = mapMemory(mem);
923 EXPECT_NE(nullptr, memory.get());
925 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
928 EXPECT_EQ(memory->getSize(), mem.size());
930 memory->update();
931 memset(data, 0, memory->getSize());
932 memory->commit();
935 memory->commit();
948 sp<IMemory> memory = mapMemory(mem);
949 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer()));
958 hidl_memory memory{};
960 EXPECT_EQ(nullptr, memory.handle());
962 EXPECT_OK(memoryTest->haveSomeMemory(memory, [&](const hidl_memory &mem) {