(pid, expected)
| 119 | |
| 120 | |
| 121 | function checkPriority(pid, expected) { |
| 122 | const priority = os.getPriority(pid); |
| 123 | |
| 124 | // Verify that the priority values match on Unix, and are range mapped on |
| 125 | // Windows. |
| 126 | if (!common.isWindows) { |
| 127 | assert.strictEqual(priority, expected); |
| 128 | return; |
| 129 | } |
| 130 | |
| 131 | // On Windows setting PRIORITY_HIGHEST will only work for elevated user, |
| 132 | // for others it will be silently reduced to PRIORITY_HIGH |
| 133 | if (expected < PRIORITY_HIGH) |
| 134 | assert.ok(priority === PRIORITY_HIGHEST || priority === PRIORITY_HIGH); |
| 135 | else if (expected < PRIORITY_ABOVE_NORMAL) |
| 136 | assert.strictEqual(priority, PRIORITY_HIGH); |
| 137 | else if (expected < PRIORITY_NORMAL) |
| 138 | assert.strictEqual(priority, PRIORITY_ABOVE_NORMAL); |
| 139 | else if (expected < PRIORITY_BELOW_NORMAL) |
| 140 | assert.strictEqual(priority, PRIORITY_NORMAL); |
| 141 | else if (expected < PRIORITY_LOW) |
| 142 | assert.strictEqual(priority, PRIORITY_BELOW_NORMAL); |
| 143 | else |
| 144 | assert.strictEqual(priority, PRIORITY_LOW); |
| 145 | } |
no test coverage detected
searching dependent graphs…