Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2d09358 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

GpuMemTest - switch mTestMap bpfmap init to move assignment



also remove use of .getMap() which I want to remove as it exposes fds
and can leak (isValid check in the next line is equivalent)

Bug: 236285127
Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: Ib5e1430acba423fa3d0373833411d44fe7cdde2a
parent 099a4648
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ public:
        mTestableGpuMem = TestableGpuMem(mGpuMem.get());
        mTestableGpuMem.setInitialized();
        errno = 0;
        mTestMap = bpf::BpfMap<uint64_t, uint64_t>(BPF_MAP_TYPE_HASH, TEST_MAP_SIZE,
                                                   BPF_F_NO_PREALLOC);
        mTestMap = std::move(bpf::BpfMap<uint64_t, uint64_t>(BPF_MAP_TYPE_HASH,
                                                             TEST_MAP_SIZE,
                                                             BPF_F_NO_PREALLOC));

        EXPECT_EQ(0, errno);
        EXPECT_LE(0, mTestMap.getMap().get());
        EXPECT_TRUE(mTestMap.isValid());
    }