Skip to content

Commit e3238c6

Browse files
For a future branch
1 parent bcdc343 commit e3238c6

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

test/common/test_helpers.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ static inline void UT_OUT(const char *format, ...) {
4242
fprintf(stdout, "\n");
4343
}
4444

45+
static inline bool UT_LOG_ERR(const char *format, ...) {
46+
va_list args_list;
47+
va_start(args_list, format);
48+
vfprintf(stderr, format, args_list);
49+
va_end(args_list);
50+
51+
fprintf(stderr, "\n");
52+
53+
return false;
54+
}
55+
56+
#define GTEST_OUT(cnd) ((bool)((cnd) || (UT_LOG_ERR("%s:%d %s - assertion failure\nExpected: %s", __FILE__, \
57+
__LINE__, __func__, #cnd), \
58+
0)))
4559
// Assert a condition is true at runtime
4660
#define UT_ASSERT(cnd) \
4761
((void)((cnd) || (UT_FATAL("%s:%d %s - assertion failure: %s", __FILE__, \

test/memspaces/memspace_lowest_latency.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ static bool canQueryLatency(size_t nodeId) {
2323
int ret = hwloc_topology_init(&topology);
2424
// UT_ASSERTeq(ret, 0);
2525
// EXPECT_NE(ret, 0);
26-
if (ret == 0) {
27-
//ADD_FAILURE();
28-
// EXPECT_NE(ret, 0);
29-
std::cerr << "stderr ret is not 0 at line: " << __LINE__ << " in file: " << __FILE__ << std::endl;
26+
// if (ret == 0) {
27+
// //ADD_FAILURE();
28+
// // EXPECT_NE(ret, 0);
29+
// std::cerr << "stderr ret is not 0 at line: " << __LINE__ << " in file: " << __FILE__ << std::endl;
30+
// GTEST_OUT_EQ
3031

32+
// return false;
33+
// }
34+
if (!(GTEST_OUT(ret != 0))) {
35+
EXPECT_NE(ret, 0);
3136
return false;
3237
}
3338
ret = hwloc_topology_load(topology);

0 commit comments

Comments
 (0)