Beispiel #1
0
TEST(ModelBase, ProperRegistration)
{
	Model model;
	TestNodes::BinaryNode* root = dynamic_cast<TestNodes::BinaryNode*> (model.createRoot("BinaryNode"));
	CHECK_CONDITION(root->typeId() >= 0);

	Model model2;
	Text* t = dynamic_cast<Text*> (model2.createRoot("Text"));
	CHECK_CONDITION(t->typeId() >= 0);
	CHECK_CONDITION(t->typeId() != root->typeId());

	Model model3;
	Integer* i = dynamic_cast<Integer*> (model3.createRoot("Integer"));
	CHECK_CONDITION(i->typeId() >= 0);
	CHECK_CONDITION(i->typeId() != root->typeId());
	CHECK_CONDITION(i->typeId() != t->typeId());

	Model model4;
	Reference* r = dynamic_cast<Reference*> (model4.createRoot("Reference"));
	CHECK_CONDITION(r->typeId() >= 0);
	CHECK_CONDITION(r->typeId() != root->typeId());
	CHECK_CONDITION(r->typeId() != t->typeId());
	CHECK_CONDITION(r->typeId() != i->typeId());
}