次のような単体テストがあります。
typedef boost::variant<std::vector<std::string, ...> > Container;
TEST_F (TestAppend, emptyContainer)
{
Container container((std::vector<std::string>()));
Append append("stringValueToAppend");
boost::apply_visitor(append(), container);
...
}
コンテナがまだstd::vector<std::string>()
ビジターを適用したタイプであることをテストする必要があります。vector<string>
次に、その内容をテストするために、バリアントからを抽出する必要があります。
これら2つのことを行うための便利なアプローチは何ですか?
RTTI が有効になっています。