1
Vote

WIN_ASSERT_NOT_THROWS macro

description

Is it possible add WIN_ASSERT_NOT_THROWS macro?
Some times it is useful (for example, when object can change inner state once and before the change some operation will throw exception , but after after not.
 
Currently, I use mentioned below :
 

define WIN_ASSERT_NOT_THROWS(expression, ...) \

{ \
bool __thrown = true;                                                      \
try { (expression); }                                                       \
catch(...) { __thrown = false; }                                  \
WinUnit::Assert::ThrowsException(                                           \
   TSTRING(expression), TSTRING(""),                             \
   __thrown, __TFILE__, __LINE__, __VA_ARGS__);                             \
}

comments