IUTEST(Hoge, ThrowValue)
{
IUTEST_ASSERT_THROW_VALUE_EQ(throw 2, int, 2);
IUTEST_ASSERT_THROW_VALUE_STREQ(throw "error", const char *, "error");
}
IUTEST(Hoge, Inform)
{
IUTEST_INFORM_TRUE(IsEven(2));
}
void TestFunction(int x, int y)
{
IUTEST_ASSERT_EQ(x, y);
}
IUTEST_PMZ(ParamMethodTest, EQ, TestFunction, 0, 0);
IUTEST_PMZ(ParamMethodTest, EQ, TestFunction, 1, 1);
IUTEST_INSTANTIATE_TEST_CASE_P(A, TestP
, ::iutest::Pairwise( ::iutest::Bool(), ::iutest::Values(1, 2), ::iutest::Values(10, 11) ) );
IUTEST_PACKAGE(TestPackage)
{
IUTEST(Test, Hoge)
{
IUTEST_ASSERT_TRUE(true);
}
}
class Hoge
{
int m_x;
};
IUTEST_MAKE_PEEP(int Hoge::*, Hoge, m_x);
IUTEST(ProdTest, Peep)
{
Hoge hoge;
IUTEST_PEEP_GET(hoge, Hoge, m_x) = 4;
IUTEST_ASSERT_EQ(4, IUTEST_PEEP_GET(hoge, Hoge, m_x));
}
//#include "iutest.hpp" #include "gtest/iutest_switch.hpp" // iutest.hpp の代わりに iutest_switch.hpp を使用する