summaryrefslogtreecommitdiff
path: root/icetray/unittests/testIceBoxInterface.cpp
blob: 73e2fc3fd3893956b2efe89a8930b5671f460af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define BOOST_TEST_MODULE TestIceBoxInterface
#include <boost/test/unit_test.hpp>

#include <Ice/CommunicatorF.h>
#include <dlfcn.h>
#include <icetrayService.h>

BOOST_AUTO_TEST_CASE(IceBoxInterface)
{
	using SetupFunction = IceTray::Service * (*)(Ice::CommunicatorPtr);

	auto sf = reinterpret_cast<SetupFunction>(dlsym(nullptr, "createIceTrayService"));
	BOOST_REQUIRE(sf);
	auto service = sf(nullptr);
	BOOST_REQUIRE(service);
	BOOST_REQUIRE_EQUAL(service, IceTray::Service::getCurrent());
	delete service;
}