mirror of
https://github.com/djcb/mu.git
synced 2024-06-28 07:41:04 +02:00
mu-result: add assert_valid_result
Useful for unit tests
This commit is contained in:
parent
17d2926cd0
commit
4ac66baccc
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user