SDK: Pass CSession as shared ptr

Even though it is copyable the copy does not work.
This commit is contained in:
Dennis Klein
2019-07-25 14:40:24 +02:00
parent 5ab328b01f
commit 363576496d
8 changed files with 75 additions and 64 deletions

View File

@@ -6,7 +6,7 @@
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include "TopologyFixture.h"
#include "Fixtures.h"
#include <DDS/Topology.h>
#include <DDS/Tools.h>
@@ -20,13 +20,15 @@ using Topology = fair::mq::test::TopologyFixture;
TEST(Topology2, ConstructionWithNativeDdsApiObjects)
{
// This is only needed for this unit test
fair::mq::test::LoggerConfig cfg;
fair::mq::sdk::DDSEnv env(CMAKE_CURRENT_BINARY_DIR);
/////////////////////////////////////////
// Example usage:
dds::topology_api::CTopology nativeTopo(fair::mq::tools::ToString(SDK_TESTSUITE_SOURCE_DIR, "/test_topo.xml"));
dds::tools_api::CSession nativeSession;
nativeSession.create();
fair::mq::sdk::Topology topo(nativeTopo, nativeSession, env);
auto nativeSession(std::make_shared<dds::tools_api::CSession>());
nativeSession->create();
EXPECT_THROW(fair::mq::sdk::Topology topo(nativeTopo, nativeSession, env), std::runtime_error);
}
TEST_F(Topology, Construction)