aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/memwipe.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-17 09:52:43 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-17 09:56:36 +0000
commit223e3788acfb6ceaf42370cc941cfbdb2b5bd8d3 (patch)
treedb72706613af1f1fc748c8f3498c94127a1e10ae /tests/unit_tests/memwipe.cpp
parentMerge pull request #2881 (diff)
downloadmonero-223e3788acfb6ceaf42370cc941cfbdb2b5bd8d3.tar.xz
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.
Diffstat (limited to 'tests/unit_tests/memwipe.cpp')
-rw-r--r--tests/unit_tests/memwipe.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit_tests/memwipe.cpp b/tests/unit_tests/memwipe.cpp
index b2b19fbf5..2d8980ef7 100644
--- a/tests/unit_tests/memwipe.cpp
+++ b/tests/unit_tests/memwipe.cpp
@@ -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);