Skip to content

Commit c19a3cb

Browse files
authored
[Offload] Make OffloadAPI gtest error messages more readable (#140728)
1 parent 050892d commit c19a3cb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

offload/unittests/OffloadAPI/common/Fixtures.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
#pragma once
1616

1717
#ifndef ASSERT_SUCCESS
18-
#define ASSERT_SUCCESS(ACTUAL) ASSERT_EQ(OL_SUCCESS, ACTUAL)
18+
#define ASSERT_SUCCESS(ACTUAL) \
19+
do { \
20+
ol_result_t Res = ACTUAL; \
21+
if (Res && Res->Code != OL_ERRC_SUCCESS) { \
22+
GTEST_FAIL() << #ACTUAL " returned " << Res->Code << ": " \
23+
<< Res->Details; \
24+
} \
25+
} while (0)
1926
#endif
2027

2128
// TODO: rework this so the EXPECTED/ACTUAL results are readable

0 commit comments

Comments
 (0)