Skip to content

Commit ddc6ea5

Browse files
committed
test: changed the buffer offset
to avoid problem with the new behaviour of new V8 BackingStore API. By changing the offset, the base address of each test case will be different. Fixes: #31061
1 parent 84b15eb commit ddc6ea5

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

Lines changed: 8 additions & 4 deletions
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)