I am unable to use Google Test's ASSERT_THROW()
macro in combination with multiple template arguments. Consider that I want to make sure that construction of Matrix<5,1>
throws:
ASSERT_THROW(Matrix<5,1>(), std::runtime_error);
(this example doesn't make a lot of sense, of course this shoud not throw, but it is what stayed after simplifying what I had.)
I get this output from MS VC++ 2008:
warning C4002: too many actual parameters for macro 'ASSERT_THROW'
error C2143: syntax error : missing ',' before ';'
Whereas there are no problems with:
ASSERT_THROW(Matrix<1>(), std::runtime_error);
How can I overcome this problem?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…