summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-03 19:47:51 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-03 19:47:51 +0000
commit59cc490cd6db5525e8ef18f703c11eedb3d06fe6 (patch)
tree902df0aabf4e495506acd1d92efdeb7fa301bd1b
parentFirst fuse arg should be binary path (diff)
downloadnetfs-59cc490cd6db5525e8ef18f703c11eedb3d06fe6.tar.bz2
netfs-59cc490cd6db5525e8ef18f703c11eedb3d06fe6.tar.xz
netfs-59cc490cd6db5525e8ef18f703c11eedb3d06fe6.zip
No naked new/delete in unit tests
-rw-r--r--netfs/unittests/mockDaemon.cpp3
-rw-r--r--netfs/unittests/mockDaemon.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/netfs/unittests/mockDaemon.cpp b/netfs/unittests/mockDaemon.cpp
index 0cb3172..1ccd6b7 100644
--- a/netfs/unittests/mockDaemon.cpp
+++ b/netfs/unittests/mockDaemon.cpp
@@ -36,7 +36,6 @@ MockDaemonHost::stop()
{
if (daemon) {
daemon->stop();
- delete daemon;
}
if (ic) {
ic->destroy();
@@ -51,7 +50,7 @@ MockDaemonHost::start()
id.properties->parseCommandLineOptions("", params);
ic = Ice::initialize(id);
ic->getProperties()->setProperty("NetFSD.HostNameOverride", "unittest");
- daemon = new MockDaemon(testEndpoint);
+ daemon = std::make_unique<MockDaemon>(testEndpoint);
daemon->start("NetFSDaemonAdapter", ic, {});
}
diff --git a/netfs/unittests/mockDaemon.h b/netfs/unittests/mockDaemon.h
index fb129c4..8bc6097 100644
--- a/netfs/unittests/mockDaemon.h
+++ b/netfs/unittests/mockDaemon.h
@@ -33,7 +33,7 @@ private:
const std::string testEndpoint;
Ice::StringSeq params;
- NetFSDaemon * daemon;
+ std::unique_ptr<NetFSDaemon> daemon;
};
#endif