Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1182)

Unified Diff: test/mjsunit/harmony/futex.js

Issue 1676613002: [Atomics] Fix atomic access index validation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/harmony/atomics.js ('k') | test/mjsunit/regress/regress-crbug-501809.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/futex.js
diff --git a/test/mjsunit/harmony/futex.js b/test/mjsunit/harmony/futex.js
index 3a73e0a9b82a5c10cdb7a278b5bc81b948c98980..626cff5fdba7554250fb0e67b7bff010369a41de 100644
--- a/test/mjsunit/harmony/futex.js
+++ b/test/mjsunit/harmony/futex.js
@@ -51,24 +51,36 @@
// Valid indexes are 0-3.
[-1, 4, 100].forEach(function(invalidIndex) {
- assertEquals(undefined, Atomics.futexWait(i32a, invalidIndex, 0));
- assertEquals(undefined, Atomics.futexWake(i32a, invalidIndex, 0));
+ assertThrows(function() {
+ Atomics.futexWait(i32a, invalidIndex, 0);
+ }, RangeError);
+ assertThrows(function() {
+ Atomics.futexWake(i32a, invalidIndex, 0);
+ }, RangeError);
var validIndex = 0;
- assertEquals(undefined, Atomics.futexWakeOrRequeue(i32a, invalidIndex, 0, 0,
- validIndex));
- assertEquals(undefined, Atomics.futexWakeOrRequeue(i32a, validIndex, 0, 0,
- invalidIndex));
+ assertThrows(function() {
+ Atomics.futexWakeOrRequeue(i32a, invalidIndex, 0, 0, validIndex);
+ }, RangeError);
+ assertThrows(function() {
+ Atomics.futexWakeOrRequeue(i32a, validIndex, 0, 0, invalidIndex);
+ }, RangeError);
});
i32a = new Int32Array(sab, 8);
[-1, 2, 100].forEach(function(invalidIndex) {
- assertEquals(undefined, Atomics.futexWait(i32a, invalidIndex, 0));
- assertEquals(undefined, Atomics.futexWake(i32a, invalidIndex, 0));
+ assertThrows(function() {
+ Atomics.futexWait(i32a, invalidIndex, 0);
+ }, RangeError);
+ assertThrows(function() {
+ Atomics.futexWake(i32a, invalidIndex, 0);
+ }, RangeError);
var validIndex = 0;
- assertEquals(undefined, Atomics.futexWakeOrRequeue(i32a, invalidIndex, 0, 0,
- validIndex));
- assertEquals(undefined, Atomics.futexWakeOrRequeue(i32a, validIndex, 0, 0,
- invalidIndex));
+ assertThrows(function() {
+ Atomics.futexWakeOrRequeue(i32a, invalidIndex, 0, 0, validIndex);
+ }, RangeError);
+ assertThrows(function() {
+ Atomics.futexWakeOrRequeue(i32a, validIndex, 0, 0, invalidIndex);
+ }, RangeError);
});
})();
« no previous file with comments | « test/mjsunit/harmony/atomics.js ('k') | test/mjsunit/regress/regress-crbug-501809.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698