diff options
Diffstat (limited to 'site/test.cpp')
-rw-r--r-- | site/test.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/site/test.cpp b/site/test.cpp index ab71f83..4cd9763 100644 --- a/site/test.cpp +++ b/site/test.cpp @@ -6,6 +6,7 @@ #include <api.h> #include <Ice/ObjectAdapter.h> +#include <Ice/Initialize.h> using namespace IceSpider; using namespace MirrorSearch; @@ -16,18 +17,18 @@ class TestSerice : public Search { { return {}; } - virtual SearchHits getMatches(const ::std::string & fn, const ::Ice::Current& = ::Ice::Current()) override + virtual SearchHits getMatches(const ::std::string fn, const ::Ice::Current& = ::Ice::Current()) override { BOOST_TEST_INFO(fn); if (fn == "good.txt") { return { - new SearchHit(1, 1, "file:///some/file/path"), - new SearchHit(1, 1, "file:///some/other/path") + std::make_shared<SearchHit>(1, 1, "file:///some/file/path"), + std::make_shared<SearchHit>(1, 1, "file:///some/other/path") }; } return {}; } - virtual ::IceUtil::Optional<::std::string> feelingLucky(const ::std::string & fn, const ::Ice::Current & c = ::Ice::Current()) override + virtual ::Ice::optional<::std::string> feelingLucky(const ::std::string fn, const ::Ice::Current & c = ::Ice::Current()) override { auto ms = getMatches(fn, c); if (ms.empty()) { @@ -47,7 +48,7 @@ class TestApp : public CoreWithDefaultRouter { adp(communicator->createObjectAdapterWithEndpoints("test", "default")) { adp->activate(); - adp->add(new TestSerice(), communicator->stringToIdentity("Search")); + adp->add(std::make_shared<TestSerice>(), Ice::stringToIdentity("Search")); } ~TestApp() |