Merge origin/feature/migrate-and-test-DDS-targets into feature/qt6-migration-basis-modules
Resolve merge conflicts between Qt6 migration basis modules and DDS test/target migration:
- codegen_simple.py: Keep Qt6 includes (generic_dtc_impl.h, service header)
- svc_ftc_impl.cpp.grantlee: Adopt DDS branch conditional logic ({% if ft.isCoreFt %})
- generic_dtc.h/.impl.h (include/ and Lts/): Keep Qt6 full-path includes, explicit wrapper methods for consistency
- connext.h: Add logger initialization for Requester/Replier (DDS branch enhancement)
- new_docker_build.sh:
- Add GROUP4_TARGETS for DDS tests
- Smart DOCKER_IMAGE selection (prebuilt vs ubuntu:26.04)
- Add BUILD_TESTING=ON to cmake
- Add Group 4 (DDS Tests) build step
Strategy: Preserve Qt6 migration decisions while incorporating DDS test/target changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
34 files changed
+617
-200
No files matched your search
@@ -6,10 +6,14 @@
|
||||
|
||||
IF(BUILD_RTI)
|
||||
ADD_SUBDIRECTORY(QosProfile)
|
||||
ADD_SUBDIRECTORY(DDSConnector)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(DTC)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
ADD_SUBDIRECTORY(DDSConnector)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(DTS)
|
||||
IF(BUILD_RTI)
|
||||
ADD_SUBDIRECTORY(FTC)
|
||||
|
||||
@@ -111,6 +111,13 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcCoreClient SHARED ${SRCS_client})
|
||||
|
||||
# Add compile definition for export macros
|
||||
TARGET_COMPILE_DEFINITIONS(svcCoreClient
|
||||
PRIVATE
|
||||
MAKE_SVCCORECLIENT_LIB
|
||||
)
|
||||
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcCoreClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
|
||||
@@ -19,7 +19,7 @@ LOGGER_T getLogger(const char *name)
|
||||
|
||||
try
|
||||
{
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger( loggerName );
|
||||
return ::NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger( loggerName );
|
||||
}
|
||||
catch ( const std::exception &ex )
|
||||
{
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
|
||||
namespace Core
|
||||
{
|
||||
using LOGGER_T = NGL::INGLLogger&;
|
||||
using LOGGER_T = ::NGL::INGLLogger&;
|
||||
CORE_COMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Core
|
||||
{
|
||||
Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector)
|
||||
: QObject(nullptr)
|
||||
, m_logger(NGL::INGLLoggerBootstrap::getNGLLogger("Core.Pacemaker"))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Core.Pacemaker"))
|
||||
{
|
||||
init(ddsConnector);
|
||||
}
|
||||
@@ -40,11 +40,11 @@ void Pacemaker::setNewState(Core::RunningState newState, const QString& errorStr
|
||||
|
||||
void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString)
|
||||
{
|
||||
m_state.runningState(newState);
|
||||
m_state.runningState = newState;
|
||||
if (errorString.isEmpty())
|
||||
m_state.errorString().reset();
|
||||
m_state.errorString.reset();
|
||||
else
|
||||
m_state.errorString(errorString.toStdString());
|
||||
m_state.errorString = errorString.toStdString();
|
||||
publishState();
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, cons
|
||||
|
||||
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
|
||||
{
|
||||
if (!m_state.ports().is_set())
|
||||
m_state.ports() = std::vector<Core::PortInformation>();
|
||||
m_state.ports().get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
if (!m_state.ports.has_value())
|
||||
m_state.ports = std::vector<Core::PortInformation>();
|
||||
m_state.ports.value().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
|
||||
publishState();
|
||||
}
|
||||
@@ -81,8 +81,8 @@ void Pacemaker::init(DDSConnector::DdsConnector* ddsConnector)
|
||||
WARNING_LOG(m_logger) << "Can not initialize DTS::CurrentRunningState!";
|
||||
return;
|
||||
}
|
||||
m_state.pid(QCoreApplication::applicationPid());
|
||||
m_state.runningState(Core::RunningState::Starting);
|
||||
m_state.pid = QCoreApplication::applicationPid();
|
||||
m_state.runningState = Core::RunningState::Starting;
|
||||
|
||||
m_paceThread = new QThread;
|
||||
this->moveToThread(m_paceThread);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
public Q_SLOTS:
|
||||
void setNewState(Core::RunningState newState, const QString &errorString = QString());
|
||||
void addPort(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
|
||||
void addPort(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
|
||||
|
||||
// only public for special purposes, not needed to call explicitly by default
|
||||
void publishState();
|
||||
@@ -48,7 +48,7 @@ public Q_SLOTS:
|
||||
private:
|
||||
void init(DDSConnector::DdsConnector *ddsConnector);
|
||||
void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString());
|
||||
void addPortInternal(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
|
||||
void addPortInternal(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
|
||||
private:
|
||||
static constexpr const int m_publishTimerDelay = 3000;
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "topic_lock_master.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <functional>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
@@ -27,14 +30,14 @@ bool TopicLockMaster::init(const std::shared_ptr<DDSConnector::DdsConnector> &dd
|
||||
return false;
|
||||
m_coreDtc->enableAll();
|
||||
|
||||
m_coreDtc->lockedEntitys([this] (const LockedEntity &data) {
|
||||
m_lockedEntitys << key(data.entityId(), data.exerciseId(), QString::fromStdString(data.entityTypeName()));
|
||||
m_coreDtc->lockedEntitys([this] (const ::Core::LockedEntity &data) {
|
||||
m_lockedEntitys << key(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
|
||||
});
|
||||
|
||||
connect(m_coreDtc.get(), &Interface::Dtc::lockedEntityChanged, this,
|
||||
[this] (const LockedEntity &data, DataModification modType)
|
||||
connect(m_coreDtc.get(), &Core::Interface::Dtc::lockedEntityChanged, this,
|
||||
[this] (const ::Core::LockedEntity &data, DataModification modType)
|
||||
{
|
||||
key k(data.entityId(), data.exerciseId(), QString::fromStdString(data.entityTypeName()));
|
||||
key k(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
|
||||
if (modType == DataModification::eAdded)
|
||||
m_lockedEntitys << k;
|
||||
else if (modType == DataModification::eRemoved)
|
||||
@@ -44,4 +47,6 @@ bool TopicLockMaster::init(const std::shared_ptr<DDSConnector::DdsConnector> &dd
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BUILD_RTI
|
||||
@@ -7,10 +7,10 @@
|
||||
#include <Core/core_export.h>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <Core/core_dtc.h>
|
||||
#include <DDS/Core/core_dtc.h>
|
||||
#else
|
||||
// Forward declarations for moc compatibility when BUILD_RTI=OFF
|
||||
namespace DDS { namespace Core { namespace Interface { class Dtc; } } }
|
||||
namespace Core { namespace Interface { class Dtc; } }
|
||||
#endif
|
||||
|
||||
namespace DDSConnector
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
private:
|
||||
QSet<key> m_lockedEntitys;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDS::Core::Interface::Dtc> m_coreDtc;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_coreDtc;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,19 @@
|
||||
# $Author$
|
||||
#
|
||||
|
||||
IF(BUILD_TESTING AND BUILD_RTI AND TARGET ddsgen AND TARGET ddsdtc AND TARGET ddsfts AND TARGET ddsQoS)
|
||||
# Check for required targets - use simpler condition for INTERFACE library compatibility
|
||||
IF(BUILD_TESTING AND BUILD_RTI)
|
||||
# Verify required targets exist
|
||||
SET(_required_targets ddsgen ddsdtc ddsfts ddsQoS)
|
||||
SET(_targets_found TRUE)
|
||||
FOREACH(_tgt ${_required_targets})
|
||||
IF(NOT TARGET ${_tgt})
|
||||
SET(_targets_found FALSE)
|
||||
MESSAGE(WARNING "Required target ${_tgt} not found - DDS unit tests will not be built")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
IF(_targets_found)
|
||||
|
||||
SET(xml_FILE ddsut.xml)
|
||||
|
||||
@@ -106,6 +118,10 @@ TARGET_LINK_LIBRARIES(ddsGenericDataTests
|
||||
Qt6::Test
|
||||
ddsut_common
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(ddsGenericDataTests PRIVATE
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/Lts/DDS
|
||||
)
|
||||
ADD_TEST(NAME ddsGenericDataTests COMMAND $<TARGET_FILE:ddsGenericDataTests>)
|
||||
|
||||
# Testing DataTopic Functionality (DTS/DTC)
|
||||
@@ -123,6 +139,11 @@ TARGET_LINK_LIBRARIES(ddsDataTopicTests
|
||||
Qt6::Test
|
||||
ddsut_common
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(ddsDataTopicTests PRIVATE
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/Lts
|
||||
${CMAKE_SOURCE_DIR}/Lts/DDS
|
||||
)
|
||||
ADD_TEST(NAME ddsDataTopicTests COMMAND $<TARGET_FILE:ddsDataTopicTests>)
|
||||
|
||||
# Testing FunctionTopic Functionality (FTS/FTC)
|
||||
@@ -140,8 +161,15 @@ TARGET_LINK_LIBRARIES(ddsFunctionTopicTests
|
||||
Qt6::Test
|
||||
ddsut_common
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(ddsFunctionTopicTests PRIVATE
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/Lts
|
||||
${CMAKE_SOURCE_DIR}/Lts/DDS
|
||||
)
|
||||
ADD_TEST(NAME ddsFunctionTopicTests COMMAND $<TARGET_FILE:ddsFunctionTopicTests>)
|
||||
|
||||
ENDIF() # _targets_found
|
||||
|
||||
IF(NOT BUILD_RPM)
|
||||
NGL_INSTALL(AAR SV TARGETS ddsut_common DESTINATION bin/test)
|
||||
NGL_INSTALL(AAR SV TARGETS ddsGenericDataTests DESTINATION bin/test)
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtTest/QTest>
|
||||
|
||||
DataTopicTests::DataTopicTests() : m_domainParticipantPub(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_partitionId(1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_testPart(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subscriberListener(nullptr)
|
||||
, m_dtcTestPart(nullptr)
|
||||
, m_mainThreadId(QThread::currentThreadId())
|
||||
.getNGLLogger("UnitTests.DataTopicTests")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
DataTopicTests::DataTopicTests()
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.DataTopicTests"))
|
||||
, m_domainParticipantPub(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_partitionId(1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_testPart(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subscriberListener(nullptr)
|
||||
, m_dtcTestPart(nullptr)
|
||||
, m_mainThreadId(QThread::currentThreadId())
|
||||
{
|
||||
if (!DDS::QosProfile::setDefault())
|
||||
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
||||
@@ -63,8 +63,8 @@ bool DataTopicTests::initPublisher()
|
||||
bool DataTopicTests::write(const DdsUnitTests::TestParticipant& data)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish topic TestParticipant ";
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.location().participantId()
|
||||
<< ", equipNo = " << data.location().equipNo();
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.location.participantId
|
||||
<< ", equipNo = " << data.location.equipNo;
|
||||
|
||||
return m_testPart->write(data);
|
||||
}
|
||||
@@ -119,8 +119,8 @@ void DataTopicTests::processData(const DdsUnitTests::TestParticipant& instance,
|
||||
{
|
||||
INFO_LOG(m_logger) << "process data in topic TestParticipant, Sampleinfo: " << si.source_timestamp().sec();
|
||||
|
||||
DEBUG_LOG(m_logger) << "participantId: " << instance.location().participantId();
|
||||
DEBUG_LOG(m_logger) << "equipNo: " << instance.location().equipNo();
|
||||
DEBUG_LOG(m_logger) << "participantId: " << instance.location.participantId;
|
||||
DEBUG_LOG(m_logger) << "equipNo: " << instance.location.equipNo;
|
||||
|
||||
m_receivedParticipantData = instance;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <DdsUnitTests/ddsut_dtc_types.h>
|
||||
#include <DdsUnitTests/ddsut_dts_types.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
#include <dds/sub/Subscriber.hpp>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
@@ -44,9 +44,9 @@ void DataTopicTestsMain::publishTestCase()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DataTopicTestsMain: publish TestParticipant";
|
||||
|
||||
m_sentParticipantData.location().participantId(100);
|
||||
m_sentParticipantData.location().equipNo(1010);
|
||||
m_sentParticipantData.testId(100);
|
||||
m_sentParticipantData.location.participantId = 100;
|
||||
m_sentParticipantData.location.equipNo = 1010;
|
||||
m_sentParticipantData.testId = 100;
|
||||
QVERIFY2(m_dtTest->write(m_sentParticipantData), "Publishing Topic TestParticipant failed");
|
||||
|
||||
DEBUG_LOG(m_logger) << "DataTopicTestsMain: publish ready";
|
||||
@@ -60,8 +60,8 @@ void DataTopicTestsMain::subscribeTestCase()
|
||||
|
||||
DdsUnitTests::TestParticipant recvPartiticpant = m_dtTest->getReceivedParticipantData();
|
||||
|
||||
QCOMPARE(recvPartiticpant.location().participantId(), m_sentParticipantData.location().participantId());
|
||||
QCOMPARE(recvPartiticpant.location().equipNo(), m_sentParticipantData.location().equipNo());
|
||||
QCOMPARE(recvPartiticpant.location.participantId, m_sentParticipantData.location.participantId);
|
||||
QCOMPARE(recvPartiticpant.location.equipNo, m_sentParticipantData.location.equipNo);
|
||||
}
|
||||
|
||||
void DataTopicTestsMain::deleteDataReaderTestCase()
|
||||
@@ -69,19 +69,19 @@ void DataTopicTestsMain::deleteDataReaderTestCase()
|
||||
DdsUnitTests::TestParticipant data;
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
m_sentParticipantData.id(i);
|
||||
m_sentParticipantData.id = i;
|
||||
m_dtTest->write(m_sentParticipantData);
|
||||
}
|
||||
m_dtTest->deleteDTC();
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
m_sentParticipantData.id(i);
|
||||
m_sentParticipantData.id = i;
|
||||
m_dtTest->write(m_sentParticipantData);
|
||||
}
|
||||
m_dtTest->deleteSubscriber();
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
m_sentParticipantData.id(i);
|
||||
m_sentParticipantData.id = i;
|
||||
m_dtTest->write(m_sentParticipantData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ int main(int argc, char* argv[])
|
||||
return retCode;
|
||||
}
|
||||
|
||||
FunctionTopicTests::FunctionTopicTests() : m_mainThreadId(QThread::currentThreadId())
|
||||
.getNGLLogger("UnitTests.FunctionTopicTests")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
FunctionTopicTests::FunctionTopicTests()
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.FunctionTopicTests"))
|
||||
, m_mainThreadId(QThread::currentThreadId())
|
||||
{
|
||||
qRegisterMetaType<DdsUnitTests::FunctionReply>("DdsUnitTests::FunctionReply");
|
||||
qRegisterMetaType<DdsUnitTests::FunctionReplyWithState>("DdsUnitTests::FunctionReplyWithState");
|
||||
@@ -98,14 +98,14 @@ void FunctionTopicTests::requestWithState()
|
||||
|
||||
DdsUnitTests::FunctionRequestWithState data;
|
||||
|
||||
data.id(1);
|
||||
data.info(std::string("Test request"));
|
||||
data.value(1000.0);
|
||||
data.id = 1;
|
||||
data.info = std::string("Test request");
|
||||
data.value = 1000.0;
|
||||
|
||||
int uniqueId = 0;
|
||||
bool bRet = m_ftcWS->requestDataClassic(
|
||||
data, SLOT(slotRequestedData(DdsUnitTests::FunctionTopicTestWithStateReply, int, bool)),
|
||||
SLOT(slotRequestedDataError(int, int, int)), uniqueId);
|
||||
data, SLOT(slotRequestedData(DdsUnitTests::FunctionTopicTestWithStateReply,int,bool)),
|
||||
SLOT(slotRequestedDataError(int,int,int)), uniqueId);
|
||||
|
||||
QVERIFY2(bRet, "Could not request data!");
|
||||
|
||||
@@ -123,14 +123,14 @@ void FunctionTopicTests::requestTestCase2()
|
||||
|
||||
DdsUnitTests::FunctionRequest data;
|
||||
|
||||
data.id(1);
|
||||
data.info(std::string("Test request"));
|
||||
data.value(1000.0);
|
||||
data.id = 1;
|
||||
data.info = std::string("Test request");
|
||||
data.value = 1000.0;
|
||||
|
||||
int uniqueId = 0;
|
||||
bool bRet =
|
||||
m_ftc->requestDataClassic(data, SLOT(slotRequestedData(DdsUnitTests::FunctionTopicTestReply, int, bool)),
|
||||
SLOT(slotRequestedDataError(int, int, int)), uniqueId);
|
||||
m_ftc->requestDataClassic(data, SLOT(slotRequestedData(DdsUnitTests::FunctionTopicTestReply,int,bool)),
|
||||
SLOT(slotRequestedDataError(int,int,int)), uniqueId);
|
||||
|
||||
QVERIFY2(bRet, "Could not request data!");
|
||||
|
||||
@@ -157,16 +157,16 @@ void FunctionTopicTests::onFunctionTopicRequest(const rti::core::SampleIdentity&
|
||||
|
||||
INFO_LOG(m_logger) << "Got function topic request (with status member)";
|
||||
m_requestTopicWithState = request;
|
||||
QCOMPARE(m_requestTopicWithState.id(), 1);
|
||||
QCOMPARE(m_requestTopicWithState.info().get(), std::string("Test request"));
|
||||
QCOMPARE(m_requestTopicWithState.value(), 1000.0);
|
||||
QCOMPARE(m_requestTopicWithState.id, 1);
|
||||
QCOMPARE(m_requestTopicWithState.info.get(), std::string("Test request"));
|
||||
QCOMPARE(m_requestTopicWithState.value, 1000.0);
|
||||
|
||||
DdsUnitTests::FunctionReplyWithState reply;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Send sample with status REPLY_COMPLETED";
|
||||
reply.id(1);
|
||||
reply.errorString("Hello");
|
||||
reply.replyState(Core::FtReplyState::Completed);
|
||||
reply.id = 1;
|
||||
reply.errorString = "Hello";
|
||||
reply.replyState = Core::FtReplyState::Completed;
|
||||
|
||||
bool bRet = m_ftsWS->sendReply(sampleId, reply);
|
||||
QVERIFY2(bRet, "Sending Reply failed");
|
||||
@@ -185,8 +185,8 @@ void FunctionTopicTests::onFunctionTopicRequest(const rti::core::SampleIdentity&
|
||||
|
||||
DdsUnitTests::FunctionReply reply;
|
||||
|
||||
reply.id(2);
|
||||
reply.errorString("What?");
|
||||
reply.id = 2;
|
||||
reply.errorString = "What?";
|
||||
|
||||
bool bRet = m_fts->sendReply(sampleId, reply);
|
||||
QVERIFY2(bRet, "Sending Reply failed");
|
||||
@@ -200,21 +200,21 @@ void FunctionTopicTests::slotRequestedData(const DdsUnitTests::FunctionTopicTest
|
||||
Q_UNUSED(seqNo);
|
||||
QCOMPARE(m_mainThreadId, QThread::currentThreadId());
|
||||
|
||||
INFO_LOG(m_logger) << "Got reply from FTS: " << reply.replyState();
|
||||
INFO_LOG(m_logger) << "Got reply from FTS: " << reply.replyState;
|
||||
|
||||
m_replyTopicWithState = reply;
|
||||
|
||||
if (m_replyTopicWithState.replyState() == Core::FtReplyState::InProgress)
|
||||
if (m_replyTopicWithState.replyState == Core::FtReplyState::InProgress)
|
||||
{
|
||||
QVERIFY(!bFinished);
|
||||
QCOMPARE(m_replyTopicWithState.id(), 0);
|
||||
QCOMPARE(m_replyTopicWithState.id, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
QVERIFY(bFinished);
|
||||
QCOMPARE(m_replyTopicWithState.id(), 1);
|
||||
QCOMPARE(m_replyTopicWithState.errorString(), std::string("Hello"));
|
||||
QCOMPARE(m_replyTopicWithState.replyState().underlying(), Core::FtReplyState::Completed);
|
||||
QCOMPARE(m_replyTopicWithState.id, 1);
|
||||
QCOMPARE(m_replyTopicWithState.errorString, std::string("Hello"));
|
||||
QCOMPARE(static_cast<int>(m_replyTopicWithState.replyState), static_cast<int>(Core::FtReplyState::Completed));
|
||||
}
|
||||
emit functionTopicReply();
|
||||
}
|
||||
@@ -226,8 +226,8 @@ void FunctionTopicTests::slotRequestedData(const DdsUnitTests::FunctionTopicTest
|
||||
QCOMPARE(m_mainThreadId, QThread::currentThreadId());
|
||||
|
||||
m_replyTopic = reply;
|
||||
QCOMPARE(m_replyTopic.id(), 2);
|
||||
QCOMPARE(m_replyTopic.errorString(), std::string("What?"));
|
||||
QCOMPARE(m_replyTopic.id, 2);
|
||||
QCOMPARE(m_replyTopic.errorString, std::string("What?"));
|
||||
|
||||
emit functionTopicReply();
|
||||
}
|
||||
|
||||
@@ -50,8 +50,6 @@ class FunctionTopicTests : public QObject
|
||||
NGL::INGLLogger& m_logger;
|
||||
void requestWithState();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
std::unique_ptr<FTS::FunctionTopicTest> m_fts;
|
||||
std::unique_ptr<FTS::FunctionTopicTestWithState> m_ftsWS;
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ int main(int argc, char* argv[])
|
||||
GenericDataTests::GenericDataTests()
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.GenericDataTests"))
|
||||
{
|
||||
m_spatialData.equipNo(0);
|
||||
m_testPart.location().equipNo(0);
|
||||
m_testPart.location().participantId(0);
|
||||
m_spatialData.equipNo = 0;
|
||||
m_testPart.location.equipNo = 0;
|
||||
m_testPart.location.participantId = 0;
|
||||
}
|
||||
|
||||
void GenericDataTests::initTestCase()
|
||||
@@ -82,38 +82,38 @@ void GenericDataTests::dataWriterTestCase()
|
||||
|
||||
DdsUnitTests::SpatialData data;
|
||||
|
||||
data.participantId(100);
|
||||
data.equipNo(999);
|
||||
data.gpsPosition().lon(70000);
|
||||
data.gpsPosition().lat(90000);
|
||||
data.gpsPosition().z(10);
|
||||
data.participantId = 100;
|
||||
data.equipNo = 999;
|
||||
data.gpsPosition.lon = 70000;
|
||||
data.gpsPosition.lat = 90000;
|
||||
data.gpsPosition.z = 10;
|
||||
|
||||
data.orientation().heave(10);
|
||||
data.orientation().pitch(10);
|
||||
data.orientation().roll(10);
|
||||
data.orientation.heave = 10;
|
||||
data.orientation.pitch = 10;
|
||||
data.orientation.roll = 10;
|
||||
|
||||
data.velocity().x(10);
|
||||
data.velocity().y(2);
|
||||
data.velocity().z(1);
|
||||
data.velocity.x = 10;
|
||||
data.velocity.y = 2;
|
||||
data.velocity.z = 1;
|
||||
|
||||
data.changedAt(11111);
|
||||
data.changedAt = 11111;
|
||||
|
||||
QVERIFY2(m_dataWriterSd->write(data), "Publishing Topic (SpatialData) failed");
|
||||
|
||||
DdsUnitTests::TestParticipant allData;
|
||||
|
||||
allData.name("************************ Name of TestParticpant ***********************");
|
||||
allData.location() = data;
|
||||
allData.id(10000);
|
||||
allData.name = "************************ Name of TestParticpant ***********************";
|
||||
allData.location = data;
|
||||
allData.id = 10000;
|
||||
QVERIFY2(m_dataWriter->write(allData), "Publishing Topic (TestParticipant) failed");
|
||||
allData.id(11000);
|
||||
allData.id = 11000;
|
||||
QVERIFY2(m_dataWriter->write(allData), "Publishing Topic (TestParticipant) failed");
|
||||
allData.id(11100);
|
||||
allData.id = 11100;
|
||||
QVERIFY2(m_dataWriter->write(allData), "Publishing Topic (TestParticipant) failed");
|
||||
allData.id(11110);
|
||||
allData.id = 11110;
|
||||
QVERIFY2(m_dataWriter->write(allData), "Publishing Topic (TestParticipant) failed");
|
||||
|
||||
allData.id(11111);
|
||||
allData.id = 11111;
|
||||
|
||||
QVERIFY2(m_dataWriter->write(allData), "Publishing Topic (TestParticipant) failed");
|
||||
}
|
||||
@@ -122,30 +122,30 @@ void GenericDataTests::dataReaderTestCase()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "GenericDataTests: dataReader";
|
||||
|
||||
QTRY_COMPARE(m_spatialData.equipNo(), 999);
|
||||
QCOMPARE(m_spatialData.changedAt(), 11111);
|
||||
QTRY_COMPARE(m_spatialData.equipNo, 999);
|
||||
QCOMPARE(m_spatialData.changedAt, 11111);
|
||||
|
||||
QTRY_COMPARE(m_testPart.location().equipNo(), 999);
|
||||
QCOMPARE(m_testPart.location().participantId(), 100);
|
||||
QTRY_COMPARE(m_testPart.location.equipNo, 999);
|
||||
QCOMPARE(m_testPart.location.participantId, 100);
|
||||
|
||||
bool bSeenUnreadSamples = false;
|
||||
dds::sub::LoanedSamples<DdsUnitTests::TestParticipant> vecTp = m_dataReader->readAlive(bSeenUnreadSamples);
|
||||
INFO_LOG(m_logger) << "vecTp size: " << vecTp.length();
|
||||
QCOMPARE(vecTp.length(), static_cast<decltype(vecTp.length())>(5));
|
||||
QCOMPARE(vecTp[0].data().id(), 10000);
|
||||
QCOMPARE(vecTp[1].data().id(), 11000);
|
||||
QCOMPARE(vecTp[2].data().id(), 11100);
|
||||
QCOMPARE(vecTp[3].data().id(), 11110);
|
||||
QCOMPARE(vecTp[4].data().id(), 11111);
|
||||
QCOMPARE(vecTp[0].data().id, 10000);
|
||||
QCOMPARE(vecTp[1].data().id, 11000);
|
||||
QCOMPARE(vecTp[2].data().id, 11100);
|
||||
QCOMPARE(vecTp[3].data().id, 11110);
|
||||
QCOMPARE(vecTp[4].data().id, 11111);
|
||||
|
||||
dds::sub::LoanedSamples<DdsUnitTests::TestParticipant> vecTpLoaned = m_dataReader->takeAlive(bSeenUnreadSamples);
|
||||
INFO_LOG(m_logger) << "vecTpLoaned size: " << vecTp.length();
|
||||
QCOMPARE(vecTpLoaned.length(), static_cast<decltype(vecTpLoaned.length())>(5));
|
||||
QCOMPARE(vecTpLoaned[0].data().id(), 10000);
|
||||
QCOMPARE(vecTpLoaned[1].data().id(), 11000);
|
||||
QCOMPARE(vecTpLoaned[2].data().id(), 11100);
|
||||
QCOMPARE(vecTpLoaned[3].data().id(), 11110);
|
||||
QCOMPARE(vecTpLoaned[4].data().id(), 11111);
|
||||
QCOMPARE(vecTpLoaned[0].data().id, 10000);
|
||||
QCOMPARE(vecTpLoaned[1].data().id, 11000);
|
||||
QCOMPARE(vecTpLoaned[2].data().id, 11100);
|
||||
QCOMPARE(vecTpLoaned[3].data().id, 11110);
|
||||
QCOMPARE(vecTpLoaned[4].data().id, 11111);
|
||||
}
|
||||
|
||||
void GenericDataTests::deleteDataReaderTestCase()
|
||||
@@ -153,7 +153,7 @@ void GenericDataTests::deleteDataReaderTestCase()
|
||||
DdsUnitTests::TestParticipant data;
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
data.id(i);
|
||||
data.id = i;
|
||||
m_dataWriter->write(data);
|
||||
}
|
||||
m_init->getSubscriberListener()->removeCallback(m_dataReader->getDataReader(), this);
|
||||
@@ -161,7 +161,7 @@ void GenericDataTests::deleteDataReaderTestCase()
|
||||
m_dataReader = nullptr;
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
data.id(i);
|
||||
data.id = i;
|
||||
m_dataWriter->write(data);
|
||||
}
|
||||
}
|
||||
@@ -188,14 +188,14 @@ void GenericDataTests::cleanupTestCase()
|
||||
|
||||
void GenericDataTests::processData(const DdsUnitTests::SpatialData& data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "SpatialData: equipNo = " << data.equipNo() << " modType: " << modType;
|
||||
DEBUG_LOG(m_logger) << "SpatialData: equipNo = " << data.equipNo << " modType: " << modType;
|
||||
m_spatialData = data;
|
||||
}
|
||||
|
||||
void GenericDataTests::processData(const DdsUnitTests::TestParticipant& data, const dds::sub::SampleInfo& si)
|
||||
{
|
||||
Q_UNUSED(si);
|
||||
DEBUG_LOG(m_logger) << "TestParticipant: equipNo = " << data.location().equipNo();
|
||||
DEBUG_LOG(m_logger) << "TestParticipant: equipNo = " << data.location.equipNo;
|
||||
m_testPart = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
Initialisation::Initialisation() : m_domainParticipant(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_exerciseId(-1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subListener(new DDSGeneric::SubscriberListener)
|
||||
.getNGLLogger("UnitTests.Initialisation")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
Initialisation::Initialisation()
|
||||
: m_domainParticipant(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_exerciseId(-1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subListener(new DDSGeneric::SubscriberListener)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.Initialisation"))
|
||||
{
|
||||
if (!DDS::QosProfile::setDefault())
|
||||
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <DDS/Generic/subscriber_listener.h>
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
#include <dds/sub/Subscriber.hpp>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
@@ -430,7 +430,7 @@ private:
|
||||
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
|
||||
// QueuedConnection to make sure the data is handled in the correct Qt (main) thread
|
||||
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
|
||||
QArgument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()), // need to explicitly specify the registered typename
|
||||
Q_RETURN_ARG(ReplyTopic, reply.data()),
|
||||
Q_ARG(int, request.uniqueId),
|
||||
Q_ARG(bool, !inProgress)); // finished yes/no
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
, m_dataReader(nullptr)
|
||||
, m_contentFilteredTopic(nullptr)
|
||||
, m_curInstanceHandle(dds::core::InstanceHandle::nil())
|
||||
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.requester"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -425,6 +425,7 @@ private:
|
||||
dds::sub::DataReader<REPLY> m_dataReader;
|
||||
dds::topic::ContentFilteredTopic<REPLY> m_contentFilteredTopic;
|
||||
dds::core::InstanceHandle m_curInstanceHandle;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
template <typename REQUEST, typename REPLY> class Replier final : public ReplyRequestBase<REQUEST, REPLY>
|
||||
@@ -439,7 +440,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
, m_dataReader(dds::sub::DataReader<REQUEST>(replierParams.subscriber(),
|
||||
ReplyRequestBase<REQUEST, REPLY>::m_requestTopic,
|
||||
replierParams.datareader_qos()))
|
||||
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.replier"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -508,6 +509,7 @@ private:
|
||||
connext::ReplierParams<REQUEST, REPLY> m_replierParams;
|
||||
dds::pub::DataWriter<REPLY> m_dataWriter;
|
||||
dds::sub::DataReader<REQUEST> m_dataReader;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace connext
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <DDS/FTS/generic_fts.h>
|
||||
#include "generic_fts_internal.h"
|
||||
#include "generic_fts.h"
|
||||
#include "connext.h"
|
||||
#include <DDS/Generic/wait_set_handler.h>
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
|
||||
@@ -38,6 +38,11 @@ NGL_TARGET_LINK_LIBRARIES(ddsgen
|
||||
LtsUtilsCoreHeaderOnly
|
||||
)
|
||||
|
||||
IF(NOT BUILD_RPM)
|
||||
NGL_INSTALL(AAR SV TARGETS ddsgen DESTINATION bin)
|
||||
NGL_INSTALL(AAR SV FILES dynamic_data_reader.h DESTINATION include/DDS/Generic)
|
||||
ENDIF()
|
||||
|
||||
# topic_type_plugin
|
||||
ADD_LIBRARY(topic_type_plugin INTERFACE)
|
||||
TARGET_SOURCES(topic_type_plugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/topic_type_plugin.h)
|
||||
|
||||
Reference in new issue
Block a user