Permalink
Browse files

Make errno() test a little more sane (and cross-platform); Fixes a bu…

…g in Linux tests
  • Loading branch information...
1 parent 02b5f52 commit cdcb081cfd3d89613834a415b3e20becd7ee04b3 @rbranson rbranson committed Nov 18, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/test.js
View
@@ -539,10 +539,6 @@ libm.ceil(1.5).on("success", function(res) {
///////////////////////
-assert.equal(2, FFI.errno());
-
-///////////////////////
-
// allow the event loop to complete
setTimeout(function() {
assert.ok(asyncAbsCallExecuted);
@@ -592,4 +588,10 @@ setTimeout(function() {
///////////////////////
+var strtoulLib = new FFI.Library(null, { "strtoul": [ "ulong", [ "string", "pointer", "int"] ] });
+strtoulLib.strtoul("1234567890123456789012345678901234567890", null, 0);
+assert.equal(34, FFI.errno()); // errno == ERANGE because value was outside of strtoul's range.
+
+///////////////////////
+
util.log("Heap increased by " + ((process.memoryUsage()["rss"] - rss) / 1024) + " KB");

0 comments on commit cdcb081

Please sign in to comment.