From 7d3f5751b34725985286dc028f7b35c876806202 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Fri, 6 May 2016 11:45:00 +0530 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen --- test/parallel/test-process-constants-noatime.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-process-constants-noatime.js b/test/parallel/test-process-constants-noatime.js index cf6b98f794..0503e67c38 100644 --- a/test/parallel/test-process-constants-noatime.js +++ b/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)); +}