Commit 00b00201 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

[hashtable] Fix SmallOrderedHashTableAllocate test

CHECK is accessing 1 byte across object boundary because
*expect and *actual will return the object address with
tag. And memcmp should return 0 if we expect (expected == actual)

R=cbruni@chromium.org, gsathya@chromium.org, ishell@chromium.org

Bug: v8:6443, v8:7569
Change-Id: I316e450a80400cea4c9394dbe470932a1f30cea5
Reviewed-on: https://chromium-review.googlesource.com/1142351Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#54561}
parent d67e25e5
......@@ -3350,7 +3350,9 @@ TEST(SmallOrderedHashMapAllocate) {
CHECK_EQ(0, actual->NumberOfDeletedElements());
CHECK_EQ(capacity / SmallOrderedHashMap::kLoadFactor,
actual->NumberOfBuckets());
CHECK(memcmp(*expected, *actual, SmallOrderedHashMap::SizeFor(capacity)));
CHECK_EQ(0, memcmp(reinterpret_cast<void*>(expected->address()),
reinterpret_cast<void*>(actual->address()),
SmallOrderedHashMap::SizeFor(capacity)));
#ifdef VERIFY_HEAP
actual->SmallOrderedHashTableVerify(isolate);
#endif
......@@ -3387,7 +3389,9 @@ TEST(SmallOrderedHashSetAllocate) {
CHECK_EQ(0, actual->NumberOfDeletedElements());
CHECK_EQ(capacity / SmallOrderedHashSet::kLoadFactor,
actual->NumberOfBuckets());
CHECK(memcmp(*expected, *actual, SmallOrderedHashSet::SizeFor(capacity)));
CHECK_EQ(0, memcmp(reinterpret_cast<void*>(expected->address()),
reinterpret_cast<void*>(actual->address()),
SmallOrderedHashSet::SizeFor(capacity)));
#ifdef VERIFY_HEAP
actual->SmallOrderedHashTableVerify(isolate);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment