@@ -44,7 +44,7 @@ std::vector<int> get_available_cpus() {
4444 int ret = sched_getaffinity (0 , sizeof (cpu_set_t ), mask);
4545
4646 if (ret != 0 ) {
47- available_cpus.emplace_back (-__LINE__ );
47+ available_cpus.emplace_back (-1 );
4848 CPU_FREE (mask);
4949
5050 return available_cpus;
@@ -98,17 +98,17 @@ struct testNuma : testing::Test {
9898 std::pair<int , bitmask *> retrieve_nodemask (void *addr) {
9999 struct bitmask *retrieved_nodemask = numa_allocate_nodemask ();
100100
101- if (nodemask == nullptr ){
102- return std::make_pair (__LINE__ , nodemask);
101+ if (nodemask == nullptr ) {
102+ return std::make_pair (- 1 , nodemask);
103103 }
104-
104+
105105 int ret = get_mempolicy (nullptr , retrieved_nodemask->maskp ,
106106 nodemask->size , addr, MPOL_F_ADDR);
107107
108108 if (ret != 0 ) {
109- return std::make_pair (__LINE__ , retrieved_nodemask);
109+ return std::make_pair (- 1 , retrieved_nodemask);
110110 }
111-
111+
112112 return std::pair (0 , retrieved_nodemask);
113113 }
114114
@@ -263,10 +263,10 @@ struct testNumaOnEachCpu : testNuma, testing::WithParamInterface<int> {
263263 int cpuNumber = this ->GetParam ();
264264
265265 if (cpuNumber < 0 ) {
266- GTEST_FAIL () << " ret is not equal to 0 in " << __FILE__ << " : " << -cpuNumber;
266+ GTEST_FAIL () << " get_available_cpus(): sched_getaffinity() return "
267+ " value is not equal to 0" ;
267268 }
268269 }
269-
270270};
271271
272272INSTANTIATE_TEST_SUITE_P (testNumaNodesAllocationsAllCpus, testNumaOnEachCpu,
@@ -302,7 +302,6 @@ TEST_P(testNumaOnEachCpu, checkModePreferredEmptyNodeset) {
302302 // Verify we're on the expected CPU
303303 int cpu_check = sched_getcpu ();
304304 ASSERT_EQ (cpu, cpu_check);
305-
306305
307306 int numa_node_number = numa_node_of_cpu (cpu);
308307 printf (" Got CPU: %d, got numa node: %d\n " , cpu, numa_node_number);
@@ -418,14 +417,14 @@ TEST_F(testNuma, checkModeInterleave) {
418417 EXPECT_NODE_EQ ((char *)ptr + page_size * i, numa_nodes[index]);
419418 }
420419
421- // bitmask *retrieved_nodemask = retrieve_nodemask(ptr);
422- auto [fileLine, retrieved_nodemask] = retrieve_nodemask (ptr);
420+ auto [fileLine, retrieved_nodemask] = retrieve_nodemask (ptr);
423421 if (fileLine != 0 ) {
424422 if (retrieved_nodemask == nullptr ) {
425- GTEST_FAIL () << " retrieved_nodemask is nullptr " << __FILE__ << " : " << fileLine;
426- }
427- else {
428- GTEST_FAIL () << " ret is not equal to 0 " << __FILE__ << " : " << fileLine;
423+ GTEST_FAIL () << " retrieve_nodemask(): numa_allocate_nodemask() "
424+ " returned nullptr" ;
425+ } else {
426+ GTEST_FAIL () << " retrieve_nodemask(): get_mempolicy() return value "
427+ " is not equal to 0" ;
429428 }
430429 }
431430 int ret = numa_bitmask_equal (retrieved_nodemask, nodemask);
0 commit comments