Just to clarify: the macro is named EXPECT_THROW.
> This failed. However, when I do the following:
>
> EXPECT_ANY_EXCEPTION( Div(0, 0))
> It passes. And, the exception thrown that was shown was
> std::invalid_argument.
>
> Anyone have any advice as to how to use EXPECT_EXCEPTION correctly to
> check for a specific argument? Cause I must be doing something wrong.
Please provide more information. How's Div() defined? Which OS and
compiler are you using?
On Linux using gcc, the following definition of Div() causes your code
to be killed by a signal instead of an exception:
int Div(int m, int n) { return m/n; }
--
Zhanyong