mu-result: add assert_valid_result

Useful for unit tests
This commit is contained in:
Dirk-Jan C. Binnema 2022-04-18 21:59:12 +03:00
parent 17d2926cd0
commit 4ac66baccc
1 changed files with 8 additions and 0 deletions

View File

@ -115,6 +115,14 @@ Err(Error::Code errcode, GError **err, const char* frm, ...)
return Err(errcode, std::move(str));
}
#define assert_valid_result(R) do { \
if(!R) { \
g_critical("error-result: %s", (R).error().what()); \
} \
} \
while(0)
}// namespace Mu