{
cynara_finish(m_cynara);
}
+void Client::check(const char *client, const char *session, const char *user,
+ const char *privilege, int expectedResult)
+{
+ int ret = cynara_check(m_cynara, client, session, user, privilege);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_check returned wrong value: "
+ << ret << " != " << expectedResult << "."
+ << " client: " << formatCstr(client) << ","
+ << " session: " << formatCstr(session) << ","
+ << " user: " << formatCstr(user) << ","
+ << " privilege: " << formatCstr(privilege));
+}
void Client::check(const std::string &client, const std::string &session,
const std::string &user, const std::string &privilege,
int expectedResult)
{
- int ret = cynara_check(m_cynara, client.c_str(), session.c_str(), user.c_str(), privilege.c_str());
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_check returned wrong value: "
- << ret << " != " << expectedResult << "."
- << " client: " << formatCstr(client.c_str()) << ","
- << " session: " << formatCstr(session.c_str()) << ","
- << " user: " << formatCstr(user.c_str()) << ","
- << " privilege: " << formatCstr(privilege.c_str()));
+ check(client.c_str(), session.c_str(), user.c_str(), privilege.c_str(), expectedResult);
}
} //namespace CynaraTestClient
Client();
virtual ~Client();
+ void check(const char *client, const char *session, const char *user, const char *privilege,
+ int expectedResult = CYNARA_API_ACCESS_ALLOWED);
void check(const std::string &client, const std::string &session,
const std::string &user, const std::string &privilege,
int expectedResult = CYNARA_API_ACCESS_ALLOWED);
-
private:
struct cynara *m_cynara;
};