From: Robert L. <rle...@us...> - 2007-03-23 11:04:23
|
Update of /cvsroot/ccmtools/ccmtools/test/CppGenerator/any/impl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17271/test/CppGenerator/any/impl Modified Files: _check_Test.cc Log Message: C++: the local home adapter has no longer a dependency to the home's implementation Index: _check_Test.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppGenerator/any/impl/_check_Test.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _check_Test.cc 5 Jan 2007 14:17:28 -0000 1.3 --- _check_Test.cc 23 Mar 2007 11:03:43 -0000 1.4 *************** *** 1,11 **** /*** ! * CCM Tools Test Client * ! * This file was automatically generated by CCM Tools * <http://ccmtools.sourceforge.net/> * * This test client is part of the mirror component test concept. For each ! * component a corresponding mirror component will be instantiated. ! * All component ports will be connected to the mirror component's ports. * Additionally, developers can add some testing code to validate supported * interfaces as well as component attribute access. --- 1,11 ---- /*** ! * CCM Tools Test Client * ! * This file was automatically generated by CCM Tools * <http://ccmtools.sourceforge.net/> * * This test client is part of the mirror component test concept. For each ! * component a corresponding mirror component will be instantiated. ! * All component ports will be connected to the mirror component's ports. * Additionally, developers can add some testing code to validate supported * interfaces as well as component attribute access. *************** *** 20,23 **** --- 20,24 ---- #include <Components/ccmtools.h> + #include <TestHome_entry.h> #include <TestHome_gen.h> *************** *** 30,35 **** int error = 0; ! error = deploy_TestHome("TestHome"); ! if(error) { cerr << "BOOTSTRAP ERROR: Can't deploy component homes!" << endl; --- 31,36 ---- int error = 0; ! error = deploy_TestHome("TestHome"); ! if(error) { cerr << "BOOTSTRAP ERROR: Can't deploy component homes!" << endl; *************** *** 37,46 **** } ! try { Components::HomeFinder* homeFinder = Components::HomeFinder::Instance(); Test::SmartPtr myTest; AnyTest::SmartPtr test; ! TestHome::SmartPtr myTestHome(dynamic_cast<TestHome*>( homeFinder->find_home_by_name("TestHome").ptr())); --- 38,47 ---- } ! try { Components::HomeFinder* homeFinder = Components::HomeFinder::Instance(); Test::SmartPtr myTest; AnyTest::SmartPtr test; ! TestHome::SmartPtr myTestHome(dynamic_cast<TestHome*>( homeFinder->find_home_by_name("TestHome").ptr())); *************** *** 49,59 **** test = myTest->provide_test(); myTest->configuration_complete(); ! ! { // any op1(in any p1, inout any p2, out any p3); SmartPtr<Value> p1(new ShortValue(11)); SmartPtr<Value> p2(new ShortValue(22)); SmartPtr<Value> p3; SmartPtr<Value> result = test->op1(p1, p2, p3); ! ShortValue* p2Value = dynamic_cast<ShortValue*>(p2.ptr()); assert(p2Value->value() == 11); --- 50,60 ---- test = myTest->provide_test(); myTest->configuration_complete(); ! ! { // any op1(in any p1, inout any p2, out any p3); SmartPtr<Value> p1(new ShortValue(11)); SmartPtr<Value> p2(new ShortValue(22)); SmartPtr<Value> p3; SmartPtr<Value> result = test->op1(p1, p2, p3); ! ShortValue* p2Value = dynamic_cast<ShortValue*>(p2.ptr()); assert(p2Value->value() == 11); *************** *** 67,76 **** { // anyList op2(in anyList p1, inout anyList p2, out anyList p3); ! AnyList p1; AnyList p2; AnyList p3; AnyList result; ! for(int i = 0; i < 5; i++) { SmartPtr<Value> p1Value(new ShortValue(i)); --- 68,77 ---- { // anyList op2(in anyList p1, inout anyList p2, out anyList p3); ! AnyList p1; AnyList p2; AnyList p3; AnyList result; ! for(int i = 0; i < 5; i++) { SmartPtr<Value> p1Value(new ShortValue(i)); *************** *** 80,84 **** } result = result = test->op2(p1, p2, p3); ! for(int i = 0; i < 5; i++) { ShortValue* p2Value = dynamic_cast<ShortValue*>(p2.at(i).ptr()); --- 81,85 ---- } result = result = test->op2(p1, p2, p3); ! for(int i = 0; i < 5; i++) { ShortValue* p2Value = dynamic_cast<ShortValue*>(p2.at(i).ptr()); *************** *** 92,96 **** } } ! { // pair op3(in pair p1, inout pair p2, out pair p3); Pair p1; --- 93,97 ---- } } ! { // pair op3(in pair p1, inout pair p2, out pair p3); Pair p1; *************** *** 108,112 **** result = test->op3(p1, p2, p3); ! assert(p2.name == "key1"); LongValue* p2Value = dynamic_cast<LongValue*>(p2.value.ptr()); --- 109,113 ---- result = test->op3(p1, p2, p3); ! assert(p2.name == "key1"); LongValue* p2Value = dynamic_cast<LongValue*>(p2.value.ptr()); *************** *** 116,120 **** LongValue* p3Value = dynamic_cast<LongValue*>(p3.value.ptr()); assert(p3Value->value() == 2); ! assert(result.name == "key1"); LongValue* resultValue = dynamic_cast<LongValue*>(result.value.ptr()); --- 117,121 ---- LongValue* p3Value = dynamic_cast<LongValue*>(p3.value.ptr()); assert(p3Value->value() == 2); ! assert(result.name == "key1"); LongValue* resultValue = dynamic_cast<LongValue*>(result.value.ptr()); *************** *** 123,145 **** myTest->remove(); ! } ! catch(Components::HomeNotFound& e) { cout << "DEPLOYMENT ERROR: can't find a home!" << endl; return -1; ! } ! catch(Components::NotImplemented& e) { ! cout << "DEPLOYMENT ERROR: function not implemented: " << e.what ( ) << endl; return -1; ! } ! catch(Components::InvalidName& e) { ! cout << "DEPLOYMENT ERROR: invalid name during connection: " << e.what() << endl; return -1; } ! catch(...) { cout << "DEPLOYMENT ERROR: there is something wrong!" << endl; --- 124,146 ---- myTest->remove(); ! } ! catch(Components::HomeNotFound& e) { cout << "DEPLOYMENT ERROR: can't find a home!" << endl; return -1; ! } ! catch(Components::NotImplemented& e) { ! cout << "DEPLOYMENT ERROR: function not implemented: " << e.what ( ) << endl; return -1; ! } ! catch(Components::InvalidName& e) { ! cout << "DEPLOYMENT ERROR: invalid name during connection: " << e.what() << endl; return -1; } ! catch(...) { cout << "DEPLOYMENT ERROR: there is something wrong!" << endl; *************** *** 148,160 **** error += undeploy_TestHome("TestHome"); ! if(error) { cerr << "TEARDOWN ERROR: Can't undeploy component homes!" << endl; return error; } ! // Clean up HomeFinder singleton Components::HomeFinder::destroy(); ! cout << ">>>> Stop Test Client: " << __FILE__ << endl; } --- 149,161 ---- error += undeploy_TestHome("TestHome"); ! if(error) { cerr << "TEARDOWN ERROR: Can't undeploy component homes!" << endl; return error; } ! // Clean up HomeFinder singleton Components::HomeFinder::destroy(); ! cout << ">>>> Stop Test Client: " << __FILE__ << endl; } |