googletest and EXPECT_THROW weirdness
- by thumper
I have a class that has no default constructor, but the construct may throw.
I was wanting to have a test like:
EXPECT_THROW(MyClass(param), std::runtime_error);
But the compiler, g++, complains that there is no default constructor for Myclass.
However the following:
EXPECT_THROW(MyClass foo(param), std::runtime_error);
Works, and the test passes as expected. Why though won't googletest accept the temporary object?