]> zoso.dev Git - buffer.git/commitdiff
failing test on android
authorCalvin Metcalf <cmetcalf@appgeo.com>
Tue, 6 Oct 2015 20:16:22 +0000 (16:16 -0400)
committerCalvin Metcalf <cmetcalf@appgeo.com>
Tue, 6 Oct 2015 20:16:22 +0000 (16:16 -0400)
test/write.js

index 38b199e24e60435ef7fa2db112815788834297fe..1163e505d79451f9afd8751704d44612313c4395 100644 (file)
@@ -114,3 +114,18 @@ test('hex of write{Uint,Int}{8,16,32}{LE,BE} with overflow', function (t) {
   }
   t.end()
 })
+test('android issue', function (t) {
+  var nums = [-25589992, -633756690, -898146932]
+  var out = new Buffer(12)
+  out.fill(0)
+  out.writeInt32BE(nums[0], 0)
+  var newNum = out.readInt32BE(0)
+  t.equal(nums[0], newNum)
+  out.writeInt32BE(nums[1], 4)
+  newNum = out.readInt32BE(4)
+  t.equal(nums[1], newNum)
+  out.writeInt32BE(nums[2], 8)
+  newNum = out.readInt32BE(8)
+  t.equal(nums[2], newNum)
+  t.end()
+})