diff options
author | Bernard Normier <bernard@zeroc.com> | 2019-11-01 11:24:52 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2021-02-02 10:55:08 -0500 |
commit | 336c68e6e413f45a7269ca6e83850d9e1ef9f751 (patch) | |
tree | d3fc90d53718041c9760cde317b8be194a20807c /cpp/test/Glacier2/ssl/Client.cpp | |
parent | Remove Ice::Application & Glacier2::Application deprecated classes (diff) | |
download | ice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.tar.bz2 ice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.tar.xz ice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.zip |
Update Glacier2 tests to use C++11 mapping
Diffstat (limited to 'cpp/test/Glacier2/ssl/Client.cpp')
-rw-r--r-- | cpp/test/Glacier2/ssl/Client.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/cpp/test/Glacier2/ssl/Client.cpp b/cpp/test/Glacier2/ssl/Client.cpp index bace1ce9100..0f6147c2e72 100644 --- a/cpp/test/Glacier2/ssl/Client.cpp +++ b/cpp/test/Glacier2/ssl/Client.cpp @@ -10,21 +10,21 @@ using namespace std; using namespace Ice; using namespace Test; -class Client : public Test::TestHelper +class Client final : public Test::TestHelper { public: - void run(int, char**); + void run(int, char**) override; }; void Client::run(int argc, char** argv) { - Ice::PropertiesPtr properties = createTestProperties(argc, argv); + auto properties = createTestProperties(argc, argv); properties->setProperty("Ice.Warn.Connections", "0"); Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); - Glacier2::RouterPrx router = Glacier2::RouterPrx::uncheckedCast( + auto router = uncheckedCast<Glacier2::RouterPrx>( communicator->stringToProxy("Glacier2/router:" + getTestEndpoint("tcp"))); communicator->setDefaultRouter(router); @@ -34,7 +34,7 @@ Client::run(int argc, char** argv) cout << "creating non-ssl session with tcp connection... "; try { - Glacier2::SessionPrx session = router->createSession("nossl", ""); + auto session = router->createSession("nossl", ""); session->ice_ping(); router->destroySession(); } @@ -47,7 +47,7 @@ Client::run(int argc, char** argv) cout << "creating ssl session with tcp connection... "; try { - Glacier2::SessionPrx session = router->createSessionFromSecureConnection(); + auto session = router->createSessionFromSecureConnection(); test(false); } catch(const Glacier2::PermissionDeniedException&) @@ -59,8 +59,8 @@ Client::run(int argc, char** argv) // Switch to using the SSL router. First, clear the router. Then // set a new SSL based router. // - communicator->setDefaultRouter(Glacier2::RouterPrx()); - router = Glacier2::RouterPrx::uncheckedCast( + communicator->setDefaultRouter(nullptr); + router = uncheckedCast<Glacier2::RouterPrx>( communicator->stringToProxy("Glacier2/router:" + getTestEndpoint(1, "ssl"))); communicator->setDefaultRouter(router); @@ -70,7 +70,7 @@ Client::run(int argc, char** argv) cout << "creating non-ssl session with ssl connection... "; try { - Glacier2::SessionPrx session = router->createSession("ssl", ""); + auto session = router->createSession("ssl", ""); session->ice_ping(); router->destroySession(); } @@ -83,7 +83,7 @@ Client::run(int argc, char** argv) cout << "creating ssl session with ssl connection... "; try { - Glacier2::SessionPrx session = router->createSessionFromSecureConnection(); + auto session = router->createSessionFromSecureConnection(); session->ice_ping(); router->destroySession(); } @@ -93,8 +93,8 @@ Client::run(int argc, char** argv) } cout << "ok" << endl; - communicator->setDefaultRouter(0); - Ice::ProcessPrx process = Ice::ProcessPrx::checkedCast( + communicator->setDefaultRouter(nullptr); + auto process = checkedCast<Ice::ProcessPrx>( communicator->stringToProxy("Glacier2/admin -f Process:" + getTestEndpoint(2, "tcp"))); process->shutdown(); } |