[Offload] Make OffloadAPI gtest error messages more readable (#140728)

This commit is contained in:
Ross Brunton 2025-05-20 14:50:26 +01:00 committed by GitHub
parent 050892d2f8
commit c19a3cb613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,14 @@
#pragma once #pragma once
#ifndef ASSERT_SUCCESS #ifndef ASSERT_SUCCESS
#define ASSERT_SUCCESS(ACTUAL) ASSERT_EQ(OL_SUCCESS, ACTUAL) #define ASSERT_SUCCESS(ACTUAL) \
do { \
ol_result_t Res = ACTUAL; \
if (Res && Res->Code != OL_ERRC_SUCCESS) { \
GTEST_FAIL() << #ACTUAL " returned " << Res->Code << ": " \
<< Res->Details; \
} \
} while (0)
#endif #endif
// TODO: rework this so the EXPECTED/ACTUAL results are readable // TODO: rework this so the EXPECTED/ACTUAL results are readable