blob: 56120d9832e1c3151f6a6ea60879cdcb4ed6df19 [file] [log] [blame]
description(
"This test checks that iterating a large array backwards works correctly."
);
var bytes = new Array();
function prepare(nbytes) {
var i = nbytes - 1;
while (i >= 0) {
bytes[i] = new Number(i);
i -= 1;
}
}
function verify(nbytes) {
var i = nbytes - 1;
while (i >= 0) {
if (bytes[i] != i)
return false;
i -= 1;
}
return true;
}
prepare(32768);
shouldBeTrue('verify(32768)');
prepare(65536);
shouldBeTrue('verify(65536)');
prepare(120000);
shouldBeTrue('verify(120000)');