From: Remi Gacogne Date: Thu, 4 Apr 2024 13:01:02 +0000 (+0200) Subject: auth: Use smart pointers in the remote backend unit tests X-Git-Tag: rec-5.1.0-alpha1~58^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14033%2Fhead;p=thirdparty%2Fpdns.git auth: Use smart pointers in the remote backend unit tests --- diff --git a/modules/remotebackend/test-remotebackend-http.cc b/modules/remotebackend/test-remotebackend-http.cc index 7d7646ed13..b103fb64ba 100644 --- a/modules/remotebackend/test-remotebackend-http.cc +++ b/modules/remotebackend/test-remotebackend-http.cc @@ -75,7 +75,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "http:url=http://localhost:62434/dns"; diff --git a/modules/remotebackend/test-remotebackend-json.cc b/modules/remotebackend/test-remotebackend-json.cc index ec85e16852..88f7c183d9 100644 --- a/modules/remotebackend/test-remotebackend-json.cc +++ b/modules/remotebackend/test-remotebackend-json.cc @@ -73,7 +73,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "http:url=http://localhost:62434/dns/endpoint.json,post=1,post_json=1"; diff --git a/modules/remotebackend/test-remotebackend-pipe.cc b/modules/remotebackend/test-remotebackend-pipe.cc index 8061adaf63..0fa9390d4e 100644 --- a/modules/remotebackend/test-remotebackend-pipe.cc +++ b/modules/remotebackend/test-remotebackend-pipe.cc @@ -73,7 +73,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "pipe:command=unittest_pipe.py"; diff --git a/modules/remotebackend/test-remotebackend-post.cc b/modules/remotebackend/test-remotebackend-post.cc index 47107149e0..3db16dfddd 100644 --- a/modules/remotebackend/test-remotebackend-post.cc +++ b/modules/remotebackend/test-remotebackend-post.cc @@ -73,7 +73,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "http:url=http://localhost:62434/dns,post=1"; diff --git a/modules/remotebackend/test-remotebackend-unix.cc b/modules/remotebackend/test-remotebackend-unix.cc index 09651e7579..5e3ca2ea3f 100644 --- a/modules/remotebackend/test-remotebackend-unix.cc +++ b/modules/remotebackend/test-remotebackend-unix.cc @@ -73,7 +73,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "unix:path=/tmp/remotebackend.sock"; diff --git a/modules/remotebackend/test-remotebackend-zeromq.cc b/modules/remotebackend/test-remotebackend-zeromq.cc index a0e7e00d18..8a3ac4af18 100644 --- a/modules/remotebackend/test-remotebackend-zeromq.cc +++ b/modules/remotebackend/test-remotebackend-zeromq.cc @@ -75,7 +75,7 @@ struct RemotebackendSetup try { // setup minimum arguments ::arg().set("module-dir") = "./.libs"; - new RemoteLoader(); + auto loader = std::make_unique(); BackendMakers().launch("remote"); // then get us a instance of it ::arg().set("remote-connection-string") = "zeromq:endpoint=ipc:///tmp/remotebackend.0";