[cctest] fix CustomSnapshotDataBlobSharedArrayBuffer on Big Endian
When accessing the buffer in 1 byte increments, the order should be reversed for BE. R=petermarshall@chromium.org, yangguo@chromium.org BUG= LOG=N Change-Id: I27a57e12479d1c00488546a92428b9183d87f8bf Reviewed-on: https://chromium-review.googlesource.com/667902 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com> Cr-Commit-Position: refs/heads/master@{#48031}
This commit is contained in:
parent
aada6a3a29
commit
34bc3cb4af
@ -747,10 +747,22 @@ TEST(CustomSnapshotDataBlobSharedArrayBuffer) {
|
||||
"var x = new Int32Array([12, 24, 48, 96]);"
|
||||
"var y = new Uint8Array(x.buffer)";
|
||||
Int32Expectations expectations = {
|
||||
std::make_tuple("x[0]", 12), std::make_tuple("x[1]", 24),
|
||||
std::make_tuple("y[0]", 12), std::make_tuple("y[1]", 0),
|
||||
std::make_tuple("y[2]", 0), std::make_tuple("y[3]", 0),
|
||||
std::make_tuple("y[4]", 24)};
|
||||
std::make_tuple("x[0]", 12),
|
||||
std::make_tuple("x[1]", 24),
|
||||
#if !V8_TARGET_BIG_ENDIAN
|
||||
std::make_tuple("y[0]", 12),
|
||||
std::make_tuple("y[1]", 0),
|
||||
std::make_tuple("y[2]", 0),
|
||||
std::make_tuple("y[3]", 0),
|
||||
std::make_tuple("y[4]", 24)
|
||||
#else
|
||||
std::make_tuple("y[3]", 12),
|
||||
std::make_tuple("y[2]", 0),
|
||||
std::make_tuple("y[1]", 0),
|
||||
std::make_tuple("y[0]", 0),
|
||||
std::make_tuple("y[7]", 24)
|
||||
#endif
|
||||
};
|
||||
|
||||
TypedArrayTestHelper(code, expectations);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user