test: check that sysconf returns a positive value · nodejs/node@7ed8753 · GitHub
Skip to content

Commit 7ed8753

Browse files
tniessenRafaelGSS
authored andcommitted
test: check that sysconf returns a positive value
Static analysis insists that sysconf(_SC_PAGE_SIZE) might return a negative integer (even though it never will). This was supposed to be handled by the existing check EXPECT_GE(page, static_cast<int>(N)). I assume that static analysis does not consider this sufficient because static_cast<int>(N) could be negative or zero if N exceeds INT_MAX (even though it never will). To resolve this (theoretical) problem, explicitly check that the return value is positive and then cast it to a size_t. PR-URL: #44666 Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 2a37f74 commit 7ed8753

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

test/cctest/test_crypto_clienthello.cc

Lines changed: 22 additions & 11 deletions

0 commit comments

Comments
 (0)