From 02dea03c8d380c6b3c01500fa2e373ebb2967555 Mon Sep 17 00:00:00 2001 From: emeric Date: Wed, 9 Jul 2014 20:22:10 +0200 Subject: [PATCH] WIP, remote auth test, adding throttling times. Tested OK --- test/RemoteClientServer.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/RemoteClientServer.cpp b/test/RemoteClientServer.cpp index 55fb8cc5..4ea111ef 100644 --- a/test/RemoteClientServer.cpp +++ b/test/RemoteClientServer.cpp @@ -456,7 +456,20 @@ class TestClient if (!response.auth_response().has_password_result()) throw std::runtime_error("not a password result!"); - return (response.auth_response().password_result().type() == Remote::AuthResponse::PasswordResult::TypePasswordValid); + switch( response.auth_response().password_result().type()) + { + case Remote::AuthResponse::PasswordResult::TypePasswordValid: + return true; + case Remote::AuthResponse::PasswordResult::TypePasswordInvalid: + return false; + case Remote::AuthResponse::PasswordResult::TypeLoginThrottling: + if (response.auth_response().password_result().has_delay()) + std::cerr << "Has to wait for " << response.auth_response().password_result().delay() << " seconds" << std::endl; + + return false; + default: + throw std::runtime_error("bad password result type"); + } } private: