joyent/node — pull request #2970 by mjor (2012-03-20 17:18:53+00:00)
Title: Fix typed array tests

My previous pull request, [#2967](https://github.com/joyent/node/pull/2967), contained a badly needed rewrite of `test/simple/test-typed-arrays.js`. The pull request was rejected, and rightfully so, but this unfortunately meant that my revised version of the typed array test suite was rejected as well.

There are a number of things wrong with the version currently on master:

1. It incorrectly uses `assert(a, b)` instead of `assert.equal(a, b)`, meaning all relevant assertions will pass regardless of whether they're supposed to when `a == true`.
2. It makes the assumption that elements in typed arrays for numerical types spanning more than one byte, like Uint32Array, are stored little-endian first on all machines.
3. It contains assorted mistakes like `assert(Int32Array, typeof v4)` (that one only passes thanks to point 1).

I have removed the parts of `test/simple/test-typed-arrays.js` specific to my first pull request, and I have also merged in `test/simple/test-typed-arrays-typenames.js`, as per [this TODO notice](https://github.com/joyent/node/blob/549443a7cc600e93cc1d1d1630108e7d0a035500/test/simple/test-typed-arrays-typenames.js#L25).