[openrtm-commit:01295] r2490 - branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 2月 15日 (土) 02:20:52 JST
Author: win-ei
Date: 2014-02-15 02:20:52 +0900 (Sat, 15 Feb 2014)
New Revision: 2490
Modified:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/Makefile.am
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/SDOSystemElementServantTests.cpp
Log:
Daily work.
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/Makefile.am
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/Makefile.am 2014-02-14 16:55:13 UTC (rev 2489)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/Makefile.am 2014-02-14 17:20:52 UTC (rev 2490)
@@ -29,6 +29,8 @@
AM_CPPFLAGS += -I$(open_rtm_dir)
AM_CPPFLAGS += -I$(open_rtm_dir)/rtc/corba/idl
AM_CPPFLAGS += -I../../../../../../coil/posix
+AM_CPPFLAGS += -I../
+AM_CPPFLAGS += -I../stubs
AM_LDFLAGS = -L.
AM_LDFLAGS += -L$(open_rtm_dir)/coil/lib
@@ -44,6 +46,8 @@
SDOSystemElementServantTests_SOURCES += $(IDL_SOURCES:.idl=Stub.cpp)
SDOSystemElementServantTests_SOURCES += $(open_rtm_dir)/doil/ORBManager.cpp
SDOSystemElementServantTests_SOURCES += $(open_rtm_dir)/doil/corba/CORBAManager.cpp
+SDOSystemElementServantTests_SOURCES += ../stubs/SDOSystemElementImpl.cpp
+SDOSystemElementServantTests_SOURCES += ../stubs/Logger.cpp
SDOSystemElementServantTests_LDFLAGS = -L$(libdir)
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/SDOSystemElementServantTests.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/SDOSystemElementServantTests.cpp 2014-02-14 16:55:13 UTC (rev 2489)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/SDOSystemElementServant/SDOSystemElementServantTests.cpp 2014-02-14 17:20:52 UTC (rev 2490)
@@ -20,6 +20,11 @@
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestAssert.h>
+#include <SDOSystemElementServant.h>
+#include <doil/ServantBase.h>
+#include <doil/corba/CORBAManager.h>
+#include <stubs/SDOSystemElementImpl.h>
+#include <stubs/Logger.h>
/*!
* @class SDOSystemElementServantTests class
@@ -31,10 +36,15 @@
: public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(SDOSystemElementServantTests);
- CPPUNIT_TEST(test_case0);
+ CPPUNIT_TEST(test_call_get_owned_organizations);
+ //CPPUNIT_TEST(test_case0);
CPPUNIT_TEST_SUITE_END();
private:
+ ::UnitTest::Servant::SDOSystemElementImpl* Impl;
+ ::UnitTest::Servant::Logger Log;
+ ::doil::ServantBase* Servant;
+ ::SDOPackage::CORBA::SDOSystemElementServant * CServant;
public:
@@ -43,6 +53,14 @@
*/
SDOSystemElementServantTests()
{
+ // registerFactory
+ Impl = new UnitTest::Servant::SDOSystemElementImpl(Log);
+ doil::CORBA::CORBAManager::instance().registerFactory(Impl->id(),
+ doil::New<SDOPackage::CORBA::SDOSystemElementServant>,
+ doil::Delete<SDOPackage::CORBA::SDOSystemElementServant>);
+ doil::ReturnCode_t ret = doil::CORBA::CORBAManager::instance().activateObject(Impl);
+ Servant = doil::CORBA::CORBAManager::instance().toServant(Impl);
+ CServant = dynamic_cast<SDOPackage::CORBA::SDOSystemElementServant*>(Servant);
}
/*!
@@ -50,6 +68,8 @@
*/
~SDOSystemElementServantTests()
{
+ delete Impl;
+ Impl = 0;
}
/*!
@@ -65,6 +85,17 @@
virtual void tearDown()
{
}
+
+ void test_call_get_owned_organizations()
+ {
+ CPPUNIT_ASSERT(CServant);
+
+ std::string str("get_owned_organizations");
+ ::SDOPackage::OrganizationList_var result;
+ result = CServant->get_owned_organizations();
+ //CPPUNIT_ASSERT_EQUAL_MESSAGE("not true", RTC::RTC_OK, result);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("not method name", Log.pop(), str);
+ }
/* test case */
void test_case0()
More information about the openrtm-commit
mailing list