Migrates OcSituation and ServiceManagement to generated rtiddsgen API
Converts accessor calls to plain member access in osc, oss and obd services.
This commit is contained in:
30 files changed
+1000
-1007
No files matched your search
+22
-22
@@ -98,11 +98,11 @@ bool DataTopicTests::write(const ServiceManagement::ServiceInformation &data)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish topic ServiceInformation ";
|
||||
|
||||
DEBUG_LOG(m_logger) << "Id: " << data.id()
|
||||
<< ", Name: " << data.name()
|
||||
<< ", State: " << data.state()
|
||||
<< ", Timestamp: " << data.timestamp()
|
||||
<< ", ErrorString: " << data.errorString()
|
||||
DEBUG_LOG(m_logger) << "Id: " << data.id
|
||||
<< ", Name: " << data.name
|
||||
<< ", State: " << data.state
|
||||
<< ", Timestamp: " << data.timestamp
|
||||
<< ", ErrorString: " << data.errorString
|
||||
;
|
||||
|
||||
return m_dtsServiceInformation->write(data);
|
||||
@@ -116,7 +116,7 @@ bool DataTopicTests::write(const ServiceManagement::GroupInformation &data)
|
||||
{
|
||||
QString services;
|
||||
|
||||
for(int serviceId : data.services())
|
||||
for(int serviceId : data.services)
|
||||
{
|
||||
services.append(QString::number(serviceId));
|
||||
services.append(QLatin1Char(','));
|
||||
@@ -125,12 +125,12 @@ bool DataTopicTests::write(const ServiceManagement::GroupInformation &data)
|
||||
if(services.endsWith(QLatin1Char(',')))
|
||||
services.chop(1);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Type: " << data.type()
|
||||
<< ", Domain: " << data.domainId()
|
||||
<< ", Partition: " << data.exercisePartitionId()
|
||||
<< ", Partition: " << data.replayPartitionId()
|
||||
DEBUG_LOG(m_logger) << "Type: " << data.type
|
||||
<< ", Domain: " << data.domainId
|
||||
<< ", Partition: " << data.exercisePartitionId
|
||||
<< ", Partition: " << data.replayPartitionId
|
||||
<< ", Services: " << services
|
||||
<< ", Timestamp: " << data.timestamp();
|
||||
<< ", Timestamp: " << data.timestamp;
|
||||
}
|
||||
|
||||
return m_dtsGroupInformation->write(data);
|
||||
@@ -151,11 +151,11 @@ void DataTopicTests::processData(const ServiceManagement::ServiceInformation &in
|
||||
Q_UNUSED(modType);
|
||||
INFO_LOG(m_logger) << "process Lts_ServiceInformation";
|
||||
|
||||
DEBUG_LOG(m_logger) << "Id: " << instance.id();
|
||||
DEBUG_LOG(m_logger) << "Name: " << instance.name();
|
||||
DEBUG_LOG(m_logger) << "State: " << instance.state();
|
||||
DEBUG_LOG(m_logger) << "Timestamp: " << instance.timestamp();
|
||||
DEBUG_LOG(m_logger) << "ErrorString: " << instance.errorString();
|
||||
DEBUG_LOG(m_logger) << "Id: " << instance.id;
|
||||
DEBUG_LOG(m_logger) << "Name: " << instance.name;
|
||||
DEBUG_LOG(m_logger) << "State: " << instance.state;
|
||||
DEBUG_LOG(m_logger) << "Timestamp: " << instance.timestamp;
|
||||
DEBUG_LOG(m_logger) << "ErrorString: " << instance.errorString;
|
||||
|
||||
m_receivedServiceInformationData = instance;
|
||||
|
||||
@@ -173,7 +173,7 @@ void DataTopicTests::processData(const ServiceManagement::GroupInformation &inst
|
||||
{
|
||||
QString services;
|
||||
|
||||
for(int serviceId : instance.services())
|
||||
for(int serviceId : instance.services)
|
||||
{
|
||||
services.append(QString::number(serviceId));
|
||||
services.append(QLatin1Char(','));
|
||||
@@ -182,12 +182,12 @@ void DataTopicTests::processData(const ServiceManagement::GroupInformation &inst
|
||||
if(services.endsWith(QLatin1Char(',')))
|
||||
services.chop(1);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Type: " << instance.type();
|
||||
DEBUG_LOG(m_logger) << "Domain: " << instance.domainId();
|
||||
DEBUG_LOG(m_logger) << "Partition: " << instance.exercisePartitionId();
|
||||
DEBUG_LOG(m_logger) << "Replay Partition: " << instance.replayPartitionId();
|
||||
DEBUG_LOG(m_logger) << "Type: " << instance.type;
|
||||
DEBUG_LOG(m_logger) << "Domain: " << instance.domainId;
|
||||
DEBUG_LOG(m_logger) << "Partition: " << instance.exercisePartitionId;
|
||||
DEBUG_LOG(m_logger) << "Replay Partition: " << instance.replayPartitionId;
|
||||
DEBUG_LOG(m_logger) << "Services: " << services;
|
||||
DEBUG_LOG(m_logger) << "Timestamp: " << instance.timestamp();
|
||||
DEBUG_LOG(m_logger) << "Timestamp: " << instance.timestamp;
|
||||
}
|
||||
|
||||
m_receivedGroupInformationData = instance;
|
||||
|
||||
+20
-20
@@ -55,11 +55,11 @@ void DataTopicTestsMain::publishServiceInformationTestCase()
|
||||
DEBUG_LOG(m_logger) <<"DataTopicTestsMain: publish ServiceInformation data";
|
||||
|
||||
// Topic ServiceInformation
|
||||
m_sentServiceInformationData.id(13);
|
||||
m_sentServiceInformationData.name("UnitTest dummy Service");
|
||||
m_sentServiceInformationData.state(Core::RunningState::inner_enum::NotYetStarted);
|
||||
m_sentServiceInformationData.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
m_sentServiceInformationData.errorString(QStringLiteral("UnitTest dummy Error").toStdString());
|
||||
m_sentServiceInformationData.id = 13;
|
||||
m_sentServiceInformationData.name = "UnitTest dummy Service";
|
||||
m_sentServiceInformationData.state = Core::RunningState::NotYetStarted;
|
||||
m_sentServiceInformationData.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
m_sentServiceInformationData.errorString = QStringLiteral("UnitTest dummy Error").toStdString();
|
||||
|
||||
QVERIFY2(m_dtTest->write(m_sentServiceInformationData), "Publishing Topic ServiceInformation failed");
|
||||
}
|
||||
@@ -72,11 +72,11 @@ void DataTopicTestsMain::subscribeServiceInformationTestCase()
|
||||
|
||||
ServiceManagement::ServiceInformation recvServiceInformation = m_dtTest->getReceivedServiceInformationData();
|
||||
|
||||
QCOMPARE(recvServiceInformation.id(), m_sentServiceInformationData.id());
|
||||
QCOMPARE(recvServiceInformation.name(), m_sentServiceInformationData.name());
|
||||
QCOMPARE(recvServiceInformation.state(), m_sentServiceInformationData.state());
|
||||
QCOMPARE(recvServiceInformation.timestamp(), m_sentServiceInformationData.timestamp());
|
||||
QCOMPARE(recvServiceInformation.errorString(), m_sentServiceInformationData.errorString());
|
||||
QCOMPARE(recvServiceInformation.id, m_sentServiceInformationData.id);
|
||||
QCOMPARE(recvServiceInformation.name, m_sentServiceInformationData.name);
|
||||
QCOMPARE(recvServiceInformation.state, m_sentServiceInformationData.state);
|
||||
QCOMPARE(recvServiceInformation.timestamp, m_sentServiceInformationData.timestamp);
|
||||
QCOMPARE(recvServiceInformation.errorString, m_sentServiceInformationData.errorString);
|
||||
}
|
||||
|
||||
void DataTopicTestsMain::publishGroupInformationTestCase()
|
||||
@@ -86,11 +86,11 @@ void DataTopicTestsMain::publishGroupInformationTestCase()
|
||||
std::vector<int> services = {1, 3, 5, 7, 11, 13, 17, 19, 23, 42};
|
||||
|
||||
// Topic GroupInformation
|
||||
m_sentGroupInformationData.type(Core::ServiceGroupType::inner_enum::Master);
|
||||
m_sentGroupInformationData.exercisePartitionId(113);
|
||||
m_sentGroupInformationData.domainId(42);
|
||||
m_sentGroupInformationData.services(services);
|
||||
m_sentGroupInformationData.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
m_sentGroupInformationData.type = Core::ServiceGroupType::Master;
|
||||
m_sentGroupInformationData.exercisePartitionId = 113;
|
||||
m_sentGroupInformationData.domainId = 42;
|
||||
m_sentGroupInformationData.services = services;
|
||||
m_sentGroupInformationData.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
QVERIFY2(m_dtTest->write(m_sentGroupInformationData), "Publishing Topic GroupInformation failed");
|
||||
}
|
||||
@@ -103,11 +103,11 @@ void DataTopicTestsMain::subscribeGroupInformationTestCase()
|
||||
|
||||
ServiceManagement::GroupInformation recvGroupInformation = m_dtTest->getReceivedGroupInformationData();
|
||||
|
||||
QCOMPARE(recvGroupInformation.type(), m_sentGroupInformationData.type());
|
||||
QCOMPARE(recvGroupInformation.exercisePartitionId(), m_sentGroupInformationData.exercisePartitionId());
|
||||
QCOMPARE(recvGroupInformation.domainId(), m_sentGroupInformationData.domainId());
|
||||
QCOMPARE(recvGroupInformation.services(), m_sentGroupInformationData.services());
|
||||
QCOMPARE(recvGroupInformation.timestamp(), m_sentGroupInformationData.timestamp());
|
||||
QCOMPARE(recvGroupInformation.type, m_sentGroupInformationData.type);
|
||||
QCOMPARE(recvGroupInformation.exercisePartitionId, m_sentGroupInformationData.exercisePartitionId);
|
||||
QCOMPARE(recvGroupInformation.domainId, m_sentGroupInformationData.domainId);
|
||||
QCOMPARE(recvGroupInformation.services, m_sentGroupInformationData.services);
|
||||
QCOMPARE(recvGroupInformation.timestamp, m_sentGroupInformationData.timestamp);
|
||||
}
|
||||
|
||||
void DataTopicTestsMain::cleanupTestCase()
|
||||
|
||||
Reference in new issue
Block a user