Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 5.0: ref.NULL is broken #45

Closed
ghalle opened this issue Nov 5, 2015 · 3 comments
Closed

Node 5.0: ref.NULL is broken #45

ghalle opened this issue Nov 5, 2015 · 3 comments

Comments

@ghalle
Copy link

ghalle commented Nov 5, 2015

I was trying to use node-ffi and something was not working, I tracked it down to ref.NULL
I ran the tests and all the tests related to ref.NULL are failing.

I ran the tests on Windows 7 64 bit.

These are the failing tests:

  1) address should return 0 for the NULL pointer:

      AssertionError: 0 === 3376672
      + expected - actual

      -0
      +3376672

      at Context.<anonymous> (\ref\test\address.js:10:12)

  2) int64 should throw an Error when reading an int64_t from the NULL pointer:
     AssertionError: Missing expected exception..
      at Function._throws (assert.js:306:5)
      at Function.assert.throws (assert.js:323:11)
      at Context.<anonymous> (\ref\test\int64.js:70:12)

  3) int64 should throw an Error when reading a uint64_t from the NULL pointer:
     AssertionError: Missing expected exception..
      at Function._throws (assert.js:306:5)
      at Function.assert.throws (assert.js:323:11)
      at Context.<anonymous> (\ref\test\int64.js:76:12)

  4) isNull should return "true" for the NULL pointer:

      AssertionError: true === false
      + expected - actual

      -true
      +false

      at Context.<anonymous> (\ref\test\isNull.js:8:12)

  5) Object should throw an Error when reading an Object from the NULL pointer:
     AssertionError: Missing expected exception..
      at Function._throws (assert.js:306:5)
      at Function.assert.throws (assert.js:323:11)
      at Context.<anonymous> (\ref\test\object.js:50:12)

  6) pointer should throw an Error when reading from the NULL pointer:
     AssertionError: Missing expected exception..
      at Function._throws (assert.js:306:5)
      at Function.assert.throws (assert.js:323:11)
      at Context.<anonymous> (\ref\test\pointer.js:49:12)

  7) pointer should return a 0-length Buffer when reading a NULL pointer:

      AssertionError: 100 === 0
      + expected - actual

      -100
      +0

      at Context.<anonymous> (\ref\test\pointer.js:58:12)

  8) C string readCString() should throw an Error when reading from the NULL pointer:
     AssertionError: Missing expected exception..
      at Function._throws (assert.js:306:5)
      at Function.assert.throws (assert.js:323:11)
      at Context.<anonymous> (\ref\test\string.js:20:14)

  9) C string allocCString() should return the NULL pointer for `null` values:

      AssertionError: false == true
      + expected - actual

      -false
      +true

      at Context.<anonymous> (\ref\test\string.js:50:7)

  10) C string allocCString() should return the NULL pointer for `undefined` values:

      AssertionError: false == true
      + expected - actual

      -false
      +true

      at Context.<anonymous> (\ref\test\string.js:56:7)

  11) C string allocCString() should return the NULL pointer for a NULL pointer Buffer:

      AssertionError: expected a "string" as the third argument
      + expected - actual

      -string
      +object

      at Object.writeCString (\ref\lib\ref.js:564:10)
      at Object.allocCString (\ref\lib\ref.js:544:11)
      at Context.<anonymous> (\ref\test\string.js:61:21)

  12) C string CString should return JS `null` when given a pointer pointing to NULL:
     AssertionError: null === '#'
      at Context.<anonymous> (\ref\test\string.js:73:14)
@TooTallNate
Copy link
Owner

Thanks for the report. Travis agrees. Reporting upstream.

@TooTallNate
Copy link
Owner

Looks like nodejs/node@d8011d1 is the breaking commit…

@TooTallNate
Copy link
Owner

Fixed in nodejs/node@827ee49.

See nodejs/node#3781 for posterity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants