diff options
Diffstat (limited to 'tests/factory_test.cpp')
-rw-r--r-- | tests/factory_test.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/factory_test.cpp b/tests/factory_test.cpp index 00239f9..999e86e 100644 --- a/tests/factory_test.cpp +++ b/tests/factory_test.cpp @@ -44,32 +44,32 @@ gras::Block *make_my_block_args3(const long &a0, const std::string &a1, const bo #include <gras/factory.hpp> -GRAS_REGISTER_FACTORY(make_my_block_args0) -GRAS_REGISTER_FACTORY(make_my_block_args1) -GRAS_REGISTER_FACTORY(make_my_block_args2) -GRAS_REGISTER_FACTORY(make_my_block_args3) +GRAS_REGISTER_FACTORY("/tests/my_block_args0", make_my_block_args0) +GRAS_REGISTER_FACTORY("/tests/my_block_args1", make_my_block_args1) +GRAS_REGISTER_FACTORY("/tests/my_block_args2", make_my_block_args2) +GRAS_REGISTER_FACTORY("/tests/my_block_args3", make_my_block_args3) BOOST_AUTO_TEST_CASE(test_register_and_make) { - gras::Element *my_block0 = gras::Factory::make("make_my_block_args0"); + gras::Element *my_block0 = gras::Factory::make("/tests/my_block_args0"); BOOST_CHECK(dynamic_cast<MyBlock *>(my_block0) != NULL); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block0)->a0, 0); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block0)->a1, ""); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block0)->a2, false); - gras::Element *my_block1 = gras::Factory::make("make_my_block_args1", 42); + gras::Element *my_block1 = gras::Factory::make("/tests/my_block_args1", 42); BOOST_CHECK(dynamic_cast<MyBlock *>(my_block1) != NULL); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block1)->a0, 42); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block1)->a1, ""); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block1)->a2, false); - gras::Element *my_block2 = gras::Factory::make("make_my_block_args2", 1, "foo"); + gras::Element *my_block2 = gras::Factory::make("/tests/my_block_args2", 1, "foo"); BOOST_CHECK(dynamic_cast<MyBlock *>(my_block2) != NULL); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block2)->a0, 1); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block2)->a1, "foo"); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block2)->a2, false); - gras::Element *my_block3 = gras::Factory::make("make_my_block_args3", -2, "bar", true); + gras::Element *my_block3 = gras::Factory::make("/tests/my_block_args3", -2, "bar", true); BOOST_CHECK(dynamic_cast<MyBlock *>(my_block3) != NULL); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block3)->a0, -2); BOOST_CHECK_EQUAL(dynamic_cast<MyBlock *>(my_block3)->a1, "bar"); |