add macros to test if expected error is thrown