2015-09-17 10:48:16 -06:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
|
|
|
|
function testUint8Array(ui) {
|
|
|
|
const length = ui.length;
|
|
|
|
for (let i = 0; i < length; i++)
|
|
|
|
if (ui[i] !== 0) return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < 100; i++) {
|
2016-01-25 15:00:06 -08:00
|
|
|
Buffer.alloc(0);
|
2015-10-08 23:11:29 +05:30
|
|
|
const ui = new Uint8Array(65);
|
2015-09-17 10:48:16 -06:00
|
|
|
assert.ok(testUint8Array(ui), 'Uint8Array is not zero-filled');
|
|
|
|
}
|