2012年6月14日木曜日

iutest にパラメタライズテストの記法を追加

iutest に Google Test とは異なる記法のパラメタライズテストを追加しました。

サンプルコード
void TestFunction(int x, int y)
{
    IUTEST_ASSERT_EQ(x, y);
}
IUTEST_PMZ(ParamMethodTest, EQ, TestFunction, 0, 0);
IUTEST_PMZ(ParamMethodTest, EQ, TestFunction, 1, 2);
IUTEST_PMZ(ParamMethodTest, EQ, TestFunction, 2, 2);

typedef TestFixed ParamMethodTestFixed;

IUTEST_PMZ_F(ParamMethodTestFixed, EQ, TestFunction, 0, 0);
IUTEST_PMZ_F(ParamMethodTestFixed, EQ, TestFunction, 1, 2);
IUTEST_PMZ_F(ParamMethodTestFixed, EQ, TestFunction, 2, 2);

実行結果


"GetParam() = " と出力されますが、既存の仕組みを再利用しているのでそうなってます。
あと、良い名前が思い浮かばなかったのでイイ名前を募集中です。

0 件のコメント:

コメントを投稿