Skip to content

Commit

Permalink
test: make sure O_NOATIME is present only in Linux
Browse files Browse the repository at this point in the history
As it is, the test checks if the return value is `undefined` in other
platforms. But it should also make sure that the `O_NOATIME` should be
found only in Linux.

PR-URL: #6614
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
thefourtheye authored and evanlucas committed May 17, 2016
1 parent ce2d5be commit 7d3f575
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/parallel/test-process-constants-noatime.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

require('../common');
const assert = require('assert');

const isLinux = process.platform === 'linux';

const O_NOATIME = process.binding('constants').O_NOATIME;
const expected = isLinux ? 0x40000 : undefined;

assert.strictEqual(O_NOATIME, expected);
const constants = process.binding('constants');

if (process.platform === 'linux') {
assert('O_NOATIME' in constants);
assert.strictEqual(constants.O_NOATIME, 0x40000);
} else {
assert(!('O_NOATIME' in constants));
}

0 comments on commit 7d3f575

Please sign in to comment.