2 #include <boost/test/unit_test.hpp>
3 #include <boost/shared_ptr.hpp>
5 BOOST_AUTO_TEST_SUITE( ClassFactory_Suite )
7 bool is_critical( CStdErrorInfo const& ex ) {
return ex.m_lError < 0; }
9 BOOST_AUTO_TEST_CASE( CreateClassFactory )
12 boost::shared_ptr<IStdClassFactory> lpFactory(IStdClassFactory::LoadModule(
"BulletAnimatSim_vc10D.dll"));
14 BOOST_CHECK( lpFactory != NULL );
17 BOOST_CHECK_EXCEPTION( lpTest = lpFactory->CreateObject(
"test1",
"TestObject"), CStdErrorInfo, is_critical );
18 BOOST_CHECK_EXCEPTION( lpTest = lpFactory->CreateObject(
"test",
"TestObject1"), CStdErrorInfo, is_critical );
20 boost::shared_ptr<CStdSerialize> lpTest2(lpFactory->CreateObject(
"test",
"TestObject"));
21 BOOST_CHECK( lpTest2 != NULL );
24 BOOST_CHECK( lpClone == NULL );
27 BOOST_AUTO_TEST_SUITE_END()