Skip to content

Does the test only support little endianess? #507

Closed

Description

@rperlas

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?

Activity

  1. kkoopa commented on Nov 3, 2015

    @kkoopa
    Collaborator

    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.

  2. bnoordhuis commented on Nov 3, 2015

    @bnoordhuis
    Member

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

  3. joransiu commented on Nov 4, 2015

    @joransiu

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions