Skip to content

Commit 7d0f8c4

Browse files
authored
Merge pull request #570 from lplewa/cov1
fix coverity issue in multiple numa nodes test
2 parents 4eaed40 + 56d1cf2 commit 7d0f8c4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/provider_os_memory_multiple_numa_nodes.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ TEST_F(testNuma, checkModeInterleave) {
381381
// The page allocations are interleaved across the set of nodes specified in nodemask.
382382
TEST_F(testNuma, checkModeInterleaveCustomPartSize) {
383383
constexpr int part_num = 1024;
384-
size_t page_size = sysconf(_SC_PAGE_SIZE);
384+
long _page_size = sysconf(_SC_PAGE_SIZE);
385+
ASSERT_GT(_page_size, 0);
386+
size_t page_size = _page_size;
385387
size_t part_size = page_size * 100;
386388
umf_os_memory_provider_params_t os_memory_provider_params =
387389
UMF_OS_MEMORY_PROVIDER_PARAMS_TEST;
@@ -538,8 +540,10 @@ INSTANTIATE_TEST_SUITE_P(checkModeSplit, testNumaSplit,
538540

539541
// positive test for numa mode split
540542
TEST_P(testNumaSplit, checkModeSplit) {
541-
auto param = GetParam();
542-
size_t page_size = sysconf(_SC_PAGE_SIZE);
543+
auto &param = GetParam();
544+
long _page_size = sysconf(_SC_PAGE_SIZE);
545+
ASSERT_GT(_page_size, 0);
546+
size_t page_size = _page_size;
543547
auto [required_numa_nodes, pages, in, out] = param;
544548

545549
umf_os_memory_provider_params_t os_memory_provider_params =

0 commit comments

Comments
 (0)