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

#include <dlfcn.h>
#include <icetrayService.h>

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

	void * i = dlsym(nullptr, "createIceTrayService");
	BOOST_REQUIRE(i);
	auto sf = (SetupFunction)i;
	BOOST_REQUIRE(sf);
	auto service = sf(nullptr);
	BOOST_REQUIRE(service);
	BOOST_REQUIRE_EQUAL(service, IceTray::Service::getCurrent());
	delete service;
}