This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=76e8427f1099999aabbb541c2239fafa73d7113b commit 76e8427f1099999aabbb541c2239fafa73d7113b Author: Guillem Jover <[email protected]> AuthorDate: Thu Dec 10 03:23:22 2020 +0100 test: Add support for basic test try/catch/finally keywords This hooks into the dpkg error-handling and makes it possible to catch those errors and ignore them. The finally keyword serves as a teardown point. --- lib/dpkg/test.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/dpkg/test.h b/lib/dpkg/test.h index 66b86f330..ff99fe9d0 100644 --- a/lib/dpkg/test.h +++ b/lib/dpkg/test.h @@ -61,6 +61,14 @@ test_alloc(void *ptr, const char *reason) #define test_alloc(ptr) \ test_alloc((ptr), "cannot allocate memory for " #ptr " in " __FILE__ ":" test_stringify(__LINE__)) +#define test_try(jmp) \ + push_error_context_jump(&(jmp), NULL, "test try"); \ + if (!setjmp((jmp))) +#define test_catch \ + else +#define test_finally \ + pop_error_context(ehflag_normaltidy); + static inline const char * test_get_envdir(const char *envvar) { -- Dpkg.Org's dpkg

