Skip to content

Commit e7a5858

Browse files
Nicer look
1 parent 0791fef commit e7a5858

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

test/common/test_helpers.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,19 @@ static inline bool UT_LOG_ERR(const char *format, ...) {
5656

5757
// Assertions which does not impact the program execution
5858
// Formatting is intended to resemble GTEST assertions outputs
59-
#define GTEST_OUT_EQ(lhs, rhs) \
59+
#define GTEST_OUT_EQ(lhs, rhs) \
6060
((bool)(((lhs) == (rhs)) || \
61-
UT_LOG_ERR("%s:%d %s - assertion failure\nExpected: %s == %s, actual: (0x%llx) vs (0x%llx)" \
62-
, \
63-
__FILE__, __LINE__, __func__, #lhs, \
64-
#rhs, (unsigned long long)(lhs), \
65-
(unsigned long long)(rhs))))
66-
67-
#define GTEST_OUT_NE(lhs, rhs) \
61+
UT_LOG_ERR("%s:%d %s - assertion failure\nExpected: %s == %s, " \
62+
"actual: (0x%llx) vs (0x%llx)", \
63+
__FILE__, __LINE__, __func__, #lhs, #rhs, \
64+
(unsigned long long)(lhs), (unsigned long long)(rhs))))
65+
66+
#define GTEST_OUT_NE(lhs, rhs) \
6867
((bool)(((lhs) != (rhs)) || \
69-
UT_LOG_ERR("%s:%d %s - assertion failure\nExpected: %s != %s, actual: (0x%llx) vs (0x%llx)" \
70-
, \
71-
__FILE__, __LINE__, __func__, #lhs, \
72-
#rhs, (unsigned long long)(lhs), \
73-
(unsigned long long)(rhs))))
68+
UT_LOG_ERR("%s:%d %s - assertion failure\nExpected: %s != %s, " \
69+
"actual: (0x%llx) vs (0x%llx)", \
70+
__FILE__, __LINE__, __func__, #lhs, #rhs, \
71+
(unsigned long long)(lhs), (unsigned long long)(rhs))))
7472

7573
// Assert a condition is true at runtime
7674
#define UT_ASSERT(cnd) \

test/memspaces/memspace_highest_bandwidth.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static bool canQueryBandwidth(size_t nodeId) {
1313
hwloc_topology_t topology = nullptr;
1414
int ret = hwloc_topology_init(&topology);
1515

16-
if (!GTEST_OUT_EQ(ret, 0)){
16+
if (!GTEST_OUT_EQ(ret, 0)) {
1717
return false;
1818
}
1919

@@ -26,7 +26,7 @@ static bool canQueryBandwidth(size_t nodeId) {
2626
hwloc_obj_t numaNode =
2727
hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, nodeId);
2828

29-
if (!GTEST_OUT_NE(numaNode, nullptr)){
29+
if (!GTEST_OUT_NE(numaNode, nullptr)) {
3030
return false;
3131
}
3232

@@ -43,8 +43,7 @@ static bool canQueryBandwidth(size_t nodeId) {
4343

4444
if (!GTEST_OUT_EQ(ret, 0)) {
4545
return false;
46-
}
47-
else {
46+
} else {
4847
return true;
4948
}
5049
}

test/memspaces/memspace_lowest_latency.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ static bool canQueryLatency(size_t nodeId) {
4747

4848
if (!GTEST_OUT_EQ(ret, 0)) {
4949
return false;
50-
}
51-
else {
50+
} else {
5251
return true;
5352
}
5453
}

0 commit comments

Comments
 (0)