policy.result_extra = strdup(resultExtra);
}
+void CynaraPoliciesContainer::add(const char *bucket,
+ const CheckKey &checkKey,
+ const int result,
+ const char *resultExtra)
+{
+ add(bucket, checkKey.m_client, checkKey.m_user, checkKey.m_privilege, result, resultExtra);
+}
+
CynaraTestAdmin::CynaraTestAdmin()
: m_admin(nullptr)
{
#ifndef CYNARA_TEST_ADMIN_H
#define CYNARA_TEST_ADMIN_H
+#include <cynara_test_commons.h>
+
#include <cynara-admin.h>
#include <vector>
const char *privilege,
const int result,
const char *resultExtra);
+ void add(const char *bucket,
+ const CheckKey &checkKey,
+ const int result,
+ const char *resultExtra = nullptr);
+
private:
friend class CynaraTestAdmin;
{
}
+CheckKey CheckData::toAdminPolicy()
+{
+ return {m_client.c_str(), m_user.c_str(), m_privilege.c_str()};
+}
+
Client::Client(const StatusFunction &userFunction)
: m_cynara(nullptr), m_statusMonitor(userFunction)
{
#include <cynara_test_client_async_request_monitor.h>
#include <cynara_test_client_async_status_monitor.h>
+#include <cynara_test_commons.h>
#include <cynara-client-async.h>
CheckData(const std::string &major, const std::string &minor = "");
CheckData(const std::string &major, int minor);
+
+ CheckKey toAdminPolicy();
};
class Client
#include <functional>
#include <string>
+#include <vector>
namespace CynaraTestConsts
{
}
+struct CheckKey
+{
+ const char *m_client;
+ const char *m_user;
+ const char *m_privilege;
+};
+
void environmentWrap(const char *testName, const std::function<void(void)> &func);
#define RUN_CYNARA_TEST(Proc) \