Skip to content

Commit 18cd002

Browse files
thangktrantargos
authored andcommitted
test: change buffer offset to accommodate V8 BackingStore
To avoid problem with the behavior of new V8 BackingStore API, change the offset. The base address of each test case will be different. Fixes: #31061 PR-URL: #31171 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 20a8175 commit 18cd002

File tree

1 file changed

+8
-4
lines changed
  • test/addons/buffer-free-callback

1 file changed

+8
-4
lines changed

test/addons/buffer-free-callback/test.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@ function check(size, alignment, offset) {
1616
global.gc();
1717
}
1818

19+
// NOTE: If adding more check() test cases,
20+
// be sure to not duplicate alignment/offset.
21+
// Refs: https://github.com/nodejs/node/issues/31061#issuecomment-568612283
22+
1923
check(64, 1, 0);
2024

2125
// Buffers can have weird sizes.
22-
check(97, 1, 0);
26+
check(97, 1, 1);
2327

2428
// Buffers can be unaligned
2529
check(64, 8, 0);
2630
check(64, 16, 0);
2731
check(64, 8, 1);
2832
check(64, 16, 1);
29-
check(97, 8, 1);
30-
check(97, 16, 1);
3133
check(97, 8, 3);
3234
check(97, 16, 3);
35+
check(97, 8, 5);
36+
check(97, 16, 5);
3337

3438
// Empty ArrayBuffer does not allocate data, worth checking
35-
check(0, 1, 0);
39+
check(0, 1, 2);

0 commit comments

Comments
 (0)