diff options
author | Josh Blum | 2013-07-29 22:14:19 -0700 |
---|---|---|
committer | Josh Blum | 2013-07-29 22:14:19 -0700 |
commit | cf8ca0ba62e78e70b7621b0c81bf7c031eabe3ac (patch) | |
tree | 38013fffdde0f9620bbb6f9dc7a47ba770672e70 /tests/factory_test.cpp | |
parent | 311d63e3f0432c0dda45d622b618b303c41ec541 (diff) | |
download | sandhi-cf8ca0ba62e78e70b7621b0c81bf7c031eabe3ac.tar.gz sandhi-cf8ca0ba62e78e70b7621b0c81bf7c031eabe3ac.tar.bz2 sandhi-cf8ca0ba62e78e70b7621b0c81bf7c031eabe3ac.zip |
gras: simplfy factory w/ macros and namespace
Diffstat (limited to 'tests/factory_test.cpp')
-rw-r--r-- | tests/factory_test.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/factory_test.cpp b/tests/factory_test.cpp index 999e86e..ca8b5ba 100644 --- a/tests/factory_test.cpp +++ b/tests/factory_test.cpp @@ -51,25 +51,25 @@ 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("/tests/my_block_args0"); + gras::Element *my_block0 = gras::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("/tests/my_block_args1", 42); + gras::Element *my_block1 = gras::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("/tests/my_block_args2", 1, "foo"); + gras::Element *my_block2 = gras::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("/tests/my_block_args3", -2, "bar", true); + gras::Element *my_block3 = gras::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"); |