iutest  1.17.99.14
fixture.cpp
//======================================================================
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//======================================================================
#include "../include/iutest.hpp"
/* ---------------------------------------------------
* テストフィクスチャの利用
*//*--------------------------------------------------*/
class TestFixed : public ::iutest::Test
{
protected:
static int x;
public:
virtual void SetUp()
{
++x;
}
static void SetUpTestSuite()
{
x = 0;
}
};
int TestFixed::x = -1;
IUTEST_F(TestFixed, Test1)
{
}
IUTEST_F(TestFixed, Test2)
{
}
typedef TestFixed TestFixed2;
struct Point
{
int x, y;
bool operator == (const Point& rhs) const { return x==rhs.x && y==rhs.y; }
};
IUTEST_F(TestFixed2, Test1)
{
{
Point a = {0, 0};
Point b = {0, 0};
IUTEST_EXPECT_EQ(a, b); // operator == があれば可能.
}
}
IUTEST_F(TestFixed2, Test2)
{
}
テストベース
Definition: iutest_body.hpp:44
virtual void SetUp()
実行前処理
Definition: iutest_body.hpp:167
static void SetUpTestSuite()
test suite setup
Definition: iutest_body.hpp:172
#define IUTEST_ASSERT_EQ(expected, actual)
== テスト
Definition: iutest.hpp:308
#define IUTEST_EXPECT_EQ(expected, actual)
== テスト
Definition: iutest.hpp:719
#define IUTEST_INFORM_EQ(expected, actual)
== テスト
Definition: iutest.hpp:1140
#define IUTEST_F(testfixture_, testname_)
ユーザー指定テスト関数定義マクロ
Definition: iutest.hpp:81