[openrtm-commit:01305] r2500 - in branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest: ModeCapableServant stubs
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 2月 15日 (土) 18:52:09 JST
Author: win-ei
Date: 2014-02-15 18:52:09 +0900 (Sat, 15 Feb 2014)
New Revision: 2500
Modified:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/Makefile.am
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/ModeCapableServantTests.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeCapableImpl.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.h
Log:
Daily work.
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/Makefile.am
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/Makefile.am 2014-02-15 09:26:49 UTC (rev 2499)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/Makefile.am 2014-02-15 09:52:09 UTC (rev 2500)
@@ -46,6 +46,7 @@
ModeCapableServantTests_SOURCES += $(IDL_SOURCES:.idl=Stub.cpp)
ModeCapableServantTests_SOURCES += $(open_rtm_dir)/doil/ORBManager.cpp
ModeCapableServantTests_SOURCES += $(open_rtm_dir)/doil/corba/CORBAManager.cpp
+ModeCapableServantTests_SOURCES += ../stubs/ModeImpl.cpp
ModeCapableServantTests_SOURCES += ../stubs/ModeCapableImpl.cpp
ModeCapableServantTests_SOURCES += ../stubs/Logger.cpp
@@ -57,6 +58,7 @@
ModeCapableServantTests_LDADD += -lcoil
ModeCapableServantTests_LDADD += -lcppunit
ModeCapableServantTests_LDADD += $(target_srcdir)/ModeCapableServant.o
+ModeCapableServantTests_LDADD += $(target_srcdir)/ModeServant.o
ModeCapableServantTests_LDADD += $(target_srcdir)/RTCTypeConversion.o
ModeCapableServantTests_LDADD += $(target_srcdir)/SDOPackageTypeConversion.o
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/ModeCapableServantTests.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/ModeCapableServantTests.cpp 2014-02-15 09:26:49 UTC (rev 2499)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/ModeCapableServant/ModeCapableServantTests.cpp 2014-02-15 09:52:09 UTC (rev 2500)
@@ -20,10 +20,16 @@
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestAssert.h>
+
#include <ModeCapableServant.h>
+#include <ModeServant.h>
+
#include <doil/ServantBase.h>
#include <doil/corba/CORBAManager.h>
+
#include <stubs/ModeCapableImpl.h>
+#include <stubs/ModeImpl.h>
+
#include <stubs/Logger.h>
/*!
@@ -47,8 +53,11 @@
private:
::UnitTest::Servant::ModeCapableImpl* Impl;
+ ::UnitTest::Servant::ModeImpl* MImpl;
+
::UnitTest::Servant::Logger Log;
::doil::ServantBase* Servant;
+
::RTC::CORBA::ModeCapableServant * CServant;
public:
@@ -66,6 +75,13 @@
doil::ReturnCode_t ret = doil::CORBA::CORBAManager::instance().activateObject(Impl);
Servant = doil::CORBA::CORBAManager::instance().toServant(Impl);
CServant = dynamic_cast<RTC::CORBA::ModeCapableServant*>(Servant);
+
+ MImpl = new UnitTest::Servant::ModeImpl();
+ doil::CORBA::CORBAManager::instance().registerFactory(MImpl->id(),
+ doil::New<RTC::CORBA::ModeServant>,
+ doil::Delete<RTC::CORBA::ModeServant>);
+ ret = doil::CORBA::CORBAManager::instance().activateObject(MImpl);
+
}
/*!
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeCapableImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeCapableImpl.cpp 2014-02-15 09:26:49 UTC (rev 2499)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeCapableImpl.cpp 2014-02-15 09:52:09 UTC (rev 2500)
@@ -10,8 +10,8 @@
#include <stdio.h>
+#include <ModeImpl.h>
#include <ModeCapableImpl.h>
-#include <ModeImpl.h>
#include <iostream>
#include <sstream>
#include <string>
@@ -52,13 +52,13 @@
{
if (m_logger != NULL)
{
- m_logger->push("get_fsm_profile");
+ m_logger->push("get_default_mode");
}
//ModeImpl* lo_ret = new ModeImpl();
- //::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
+ ::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
//::UnitTest::Servant::ModeImpl * ret = new ::UnitTest::Servant::ModeImpl();
//::UnitTest::Servant::ModeImpl ret;
- return NULL;
+ return ret;
}
::RTC::Local::IMode* ModeCapableImpl::get_current_mode()
@@ -68,8 +68,9 @@
{
m_logger->push("get_current_mode");
}
+ ::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
//::RTC::Local::IMode *ret = NULL;
- return NULL;
+ return ret;
}
::RTC::Local::IMode* ModeCapableImpl::get_current_mode_in_context(const ::RTC::Local::IExecutionContext* exec_context)
@@ -80,7 +81,8 @@
m_logger->push("get_current_mode_in_context");
}
//::RTC::Local::IMode *ret = NULL;
- return NULL;
+ ::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
+ return ret;
}
::RTC::Local::IMode* ModeCapableImpl::get_pending_mode()
@@ -91,7 +93,8 @@
m_logger->push("get_pending_mode");
}
//::RTC::Local::IMode *ret = NULL;
- return NULL;
+ ::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
+ return ret;
}
::RTC::Local::IMode* ModeCapableImpl::get_pending_mode_in_context(const ::RTC::Local::IExecutionContext* exec_context)
@@ -102,6 +105,8 @@
m_logger->push("get_pending_mode_in_context");
}
//::RTC::Local::IMode ret = *NULL;
+ ::RTC::Local::IMode * ret = new UnitTest::Servant::ModeImpl();
+ return ret;
return NULL;
}
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.cpp 2014-02-15 09:26:49 UTC (rev 2499)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.cpp 2014-02-15 09:52:09 UTC (rev 2500)
@@ -33,11 +33,13 @@
ModeImpl::ModeImpl()
{
+ sprintf(m_name, "%s", id());
++count;
m_logger = new Logger();
}
ModeImpl::ModeImpl(Logger& aLogger)
{
+ sprintf(m_name, "%s", id());
++count;
m_logger = &aLogger;
}
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.h
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.h 2014-02-15 09:26:49 UTC (rev 2499)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ModeImpl.h 2014-02-15 09:52:09 UTC (rev 2500)
@@ -8,8 +8,8 @@
* $Id$
*/
-#ifndef MODECAPABLE_IMPL_H
-#define MODECAPABLE_IMPL_H
+#ifndef MODE_IMPL_H
+#define MODE_IMPL_H
#include <doil/ImplBase.h>
More information about the openrtm-commit
mailing list