Browse Source

test: make sure O_NOATIME is present only in Linux

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: https://github.com/nodejs/node/pull/6614
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v6.x
Sakthipriyan Vairamani 9 years ago
committed by Evan Lucas
parent
commit
7d3f5751b3
  1. 15
      test/parallel/test-process-constants-noatime.js

15
test/parallel/test-process-constants-noatime.js

@ -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));
}

Loading…
Cancel
Save