test: fix V8 test on big-endian machines
Ref: https://github.com/nodejs/node/pull/12143#issuecomment-291131159 PR-URL: https://github.com/nodejs/node/pull/12186 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
843b7e68ca
commit
9b05393362
@ -3,6 +3,7 @@
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const v8 = require('v8');
|
||||
const os = require('os');
|
||||
|
||||
const circular = {};
|
||||
circular.circular = circular;
|
||||
@ -124,6 +125,9 @@ const objects = [
|
||||
let buf = Buffer.alloc(32 + 9);
|
||||
buf.write('ff0d5c0404addeefbe', 32, 'hex');
|
||||
buf = buf.slice(32);
|
||||
assert.deepStrictEqual(v8.deserialize(buf),
|
||||
new Uint16Array([0xdead, 0xbeef]));
|
||||
|
||||
const expectedResult = os.endianness() === 'LE' ?
|
||||
new Uint16Array([0xdead, 0xbeef]) : new Uint16Array([0xadde, 0xefbe]);
|
||||
|
||||
assert.deepStrictEqual(v8.deserialize(buf), expectedResult);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user