unit_tests: fix memwipe test comparison

free might overwrite the memory, so we can't expect to see
the NULs we overwrote with, but at least we shouldn't see
the original data.
This commit is contained in:
moneromooo-monero 2017-12-17 09:52:43 +00:00
parent 38ecd0526e
commit 223e3788ac
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -47,7 +47,7 @@ static void test(bool wipe)
if ((intptr_t)quux == foop)
{
MDEBUG(std::hex << std::setw(8) << std::setfill('0') << *(uint32_t*)quux);
if (wipe) ASSERT_TRUE(!memcmp(quux, "\0\0\0", 3));
if (wipe) ASSERT_TRUE(memcmp(quux, "bar", 3));
}
else MWARNING("We did not get the same location, cannot check");
free(quux);