[openrtm-commit:02991] r3125 - in branches/RELENG_1_2/OpenRTM-aist: examples/SeqIO src/lib/coil/tests/stringutil src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 12月 11日 (月) 12:27:45 JST
Author: n-ando
Date: 2017-12-11 12:27:45 +0900 (Mon, 11 Dec 2017)
New Revision: 3125
Modified:
branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqIn.h
branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqOut.h
branches/RELENG_1_2/OpenRTM-aist/src/lib/coil/tests/stringutil/stringutilTests.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/NVUtil.cpp
Log:
merged changes from branches/FSM4RTC/OpenRTM-aist r2894, 2897, 2901:
[compat,->RELENG_1_2,->RELENG_2_0] NVUtil dump() function outputs doubled CR. It is removed.
[FSM4RTC,->RELENG_1_2,->RELENG_2_0] Some sample components listener have been modified to follow ConnectorListener changes. refs #3871
[coil,test,->RELENG_1_2,->RELENG_2_0] coil::stringutils tests added.
Modified: branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqIn.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqIn.h 2017-12-11 03:23:55 UTC (rev 3124)
+++ branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqIn.h 2017-12-11 03:27:45 UTC (rev 3125)
@@ -34,6 +34,7 @@
class DataListener
: public ConnectorDataListenerT<RTC::TimedLong>
{
+ USE_CONNLISTENER_STATUS;
public:
DataListener(const char* name) : m_name(name) {}
virtual ~DataListener()
@@ -45,8 +46,8 @@
}
}
- virtual void operator()(const ConnectorInfo& info,
- const TimedLong& data)
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ TimedLong& data)
{
// Connector Listener Dump check
if(g_Listener_dump_enabled)
@@ -61,6 +62,7 @@
std::cout << "Data: " << data.data << std::endl;
std::cout << "------------------------------" << std::endl;
}
+ return NO_CHANGE;
};
std::string m_name;
};
@@ -69,6 +71,7 @@
class ConnListener
: public ConnectorListener
{
+ USE_CONNLISTENER_STATUS;
public:
ConnListener(const char* name) : m_name(name) {}
virtual ~ConnListener()
@@ -80,7 +83,7 @@
}
}
- virtual void operator()(const ConnectorInfo& info)
+ virtual ReturnCode operator()(ConnectorInfo& info)
{
// Connector Listener Dump check
if(g_Listener_dump_enabled)
@@ -94,6 +97,7 @@
std::cout << std::endl;
std::cout << "------------------------------" << std::endl;
}
+ return NO_CHANGE;
};
std::string m_name;
};
Modified: branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqOut.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqOut.h 2017-12-11 03:23:55 UTC (rev 3124)
+++ branches/RELENG_1_2/OpenRTM-aist/examples/SeqIO/SeqOut.h 2017-12-11 03:27:45 UTC (rev 3125)
@@ -35,6 +35,7 @@
class DataListener
: public ConnectorDataListenerT<RTC::TimedLong>
{
+ USE_CONNLISTENER_STATUS;
public:
DataListener(const char* name) : m_name(name) {}
virtual ~DataListener()
@@ -46,8 +47,8 @@
}
}
- virtual void operator()(const ConnectorInfo& info,
- const TimedLong& data)
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ TimedLong& data)
{
// Connector Listener Dump check
if(g_Listener_dump_enabled)
@@ -62,6 +63,7 @@
std::cout << "Data: " << data.data << std::endl;
std::cout << "------------------------------" << std::endl;
}
+ return NO_CHANGE;
}
std::string m_name;
};
@@ -70,6 +72,7 @@
class ConnListener
: public ConnectorListener
{
+ USE_CONNLISTENER_STATUS;
public:
ConnListener(const char* name) : m_name(name) {}
virtual ~ConnListener()
@@ -81,7 +84,7 @@
}
}
- virtual void operator()(const ConnectorInfo& info)
+ virtual ReturnCode operator()(ConnectorInfo& info)
{
// Connector Listener Dump check
if(g_Listener_dump_enabled)
@@ -95,6 +98,7 @@
std::cout << std::endl;
std::cout << "------------------------------" << std::endl;
}
+ return NO_CHANGE;
};
std::string m_name;
};
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/coil/tests/stringutil/stringutilTests.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/coil/tests/stringutil/stringutilTests.cpp 2017-12-11 03:23:55 UTC (rev 3124)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/coil/tests/stringutil/stringutilTests.cpp 2017-12-11 03:27:45 UTC (rev 3125)
@@ -53,6 +53,8 @@
CPPUNIT_TEST(test_toBool);
CPPUNIT_TEST(test_isAbsolutePath);
CPPUNIT_TEST(test_isURL);
+ CPPUNIT_TEST(test_isIPv4);
+ CPPUNIT_TEST(test_isIPv6);
CPPUNIT_TEST(test_otos);
CPPUNIT_TEST(test_stringTo);
CPPUNIT_TEST(test_stringToBool);
@@ -136,6 +138,76 @@
void test_isURL()
{
}
+ void test_isIPv4()
+ {
+ std::string addr;
+ addr = "255.250.255.255"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "0.0.0.0"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "192.168.0.1"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "192.168.100.0"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+
+ addr = "255.250.255"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "255,250.255.0"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "192.168.0.256"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "ff.ff.ff.ff"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "xx.yy.zz.00"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+
+ addr = "255.250.255.255:92183"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "0.0.0.0:97763"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "192.168.0.1:98657"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+ addr = "192.168.100.0:4689"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), true);
+
+ addr = "255.250.255:8686"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "255,250.255.0:86545"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "1293:192.168.0.1"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "ff.ff.ff.ff.ff:9763"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ addr = "xx.yy.zz.00:98767"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv4(addr), false);
+ }
+ void test_isIPv6()
+ {
+ std::string addr;
+ addr = "fe80:0:0:0:21c:42ff:fe87:d3d4"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+ addr = "::1"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+ addr = "fe80::21c:42ff:fe87:d3d4"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+
+ addr = "fe80::21c:42ff:fe87:1ffff"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), false);
+ addr = "ffe80::21c:42ff:fe87:d3d4"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), false);
+
+ addr = "[fe80:0:0:0:21c:42ff:fe87:d3d4]"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+ addr = "[::1]:9679"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+ addr = "[fe80::21c:42ff:fe87:d3d4]:7657"; // OK
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), true);
+
+ addr = "[ffe80::21c:42ff:fe87:d3d4]:5678"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), false);
+ addr = "fe80::21c:42ff:fe87:d3d4]:87654"; // NG
+ CPPUNIT_ASSERT_EQUAL(coil::isIPv6(addr), false);
+ }
void test_otos()
{
}
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/NVUtil.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/NVUtil.cpp 2017-12-11 03:23:55 UTC (rev 3124)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/NVUtil.cpp 2017-12-11 03:27:45 UTC (rev 3125)
@@ -397,7 +397,7 @@
{
for (CORBA::ULong i(0), n(nv.length()); i < n; ++i)
{
- out << nv[i] << std::endl;
+ out << nv[i];
}
return out;
}
More information about the openrtm-commit
mailing list