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

Does the test only support little endianess? #507

Closed
rperlas opened this issue Nov 3, 2015 · 3 comments · Fixed by #512
Closed

Does the test only support little endianess? #507

rperlas opened this issue Nov 3, 2015 · 3 comments · Fixed by #512

Comments

@rperlas
Copy link

rperlas commented Nov 3, 2015

When I attempt an NPM on big endian machines, I run into two failing test cases.

One error is on the command: "node --expose-gc nannew-test.js".

Another error is:

not ok 69 ../cpp/nannew.cpp:323: stringMatches( New(widestring, 4).ToLocalChecked(), "Hell")
---
file: events.js
line: 72
column: 20
stack:
- |
getCaller (/home/nodebot/node_modules/nan/node_modules/tap/lib/tap-assert.js:439:17)
- |
Function.assert (/home/nodebot/node_modules/nan/node_modules/tap/lib/tap-assert.js:21:16)
- |
Test._testAssert as ok
- |
emitNone (events.js:72:20)
- |
Test.emit (events.js:166:7)
- |
Test.emit (/home/nodebot/node_modules/nan/node_modules/tap/lib/tap-test.js:104:8)
- |
GlobalHarness.Harness.process (/home/nodebot/node_modules/nan/node_modules/tap/lib/tap-harness.js:87:13)
- |
doNTCallback0 (node.js:417:9)
- |
process._tickCallback (node.js:346:13)
- |
emitNone (events.js:72:20)

10:54:20 AM: not ok 95 test/js/nannew-test.js

I am wondering if this is because big endianess is not supported?

@kkoopa
Copy link
Collaborator

kkoopa commented Nov 3, 2015

Don't know. See #481. We can't test on big endian, so we don't really bother. The library might still work even if the tests don't.

@bnoordhuis
Copy link
Member

The node.js CI has BE machines in its matrix. We could move over if needed, details TBD.

@joransiu
Copy link

joransiu commented Nov 4, 2015

Hmm, this test failure looks a bit different than #481. #481 specifically sets the encoding as UCS2 (aka UTF16le). In this case, the test is simply creating a uint16_t string, with the chars encoded in little endian format.

  const uint16_t *widestring = reinterpret_cast<const uint16_t *>("H\0e\0l\0l\0o\0");
  t.ok(_( stringMatches( New(widestring, 4).ToLocalChecked(), "Hell")));`

https://github.com/nodejs/nan/blob/master/test/cpp/nannew.cpp#L322-L323

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

Successfully merging a pull request may close this issue.

4 participants