Commit 20fa8e0d authored by David Zeuthen's avatar David Zeuthen

fix build for dummy backend

parent 109229bb
......@@ -43,6 +43,7 @@
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
#include "polkit-private.h"
#include "polkit-test.h"
/* PolKitAuthorizationDB structure is defined in polkit/polkit-private.h */
......@@ -188,3 +189,19 @@ polkit_authorization_db_revoke_entry (PolKitAuthorizationDB *authdb,
}
#ifdef POLKIT_BUILD_TESTS
static polkit_bool_t
_run_test (void)
{
return TRUE;
}
PolKitTest _test_authorization_db = {
"polkit_authorization_db",
NULL,
NULL,
_run_test
};
#endif /* POLKIT_BUILD_TESTS */
......@@ -591,6 +591,8 @@ polkit_authorization_get_constraint (PolKitAuthorization *auth)
#ifdef POLKIT_BUILD_TESTS
#ifdef POLKIT_AUTHDB_DEFAULT
typedef struct {
const char *entry;
PolKitAuthorizationScope scope;
......@@ -770,6 +772,15 @@ _run_test (void)
return TRUE;
}
#else /* POLKIT_AUTHDB_DEFAULT */
static polkit_bool_t
_run_test (void)
{
return TRUE;
}
#endif /* POLKIT_AUTHDB_DEFAULT */
PolKitTest _test_authorization = {
"polkit_authorization",
......
......@@ -426,9 +426,12 @@ _run_test (void)
}
kit_assert ((d = polkit_policy_file_entry_get_default (pfe)) != NULL);
#ifdef POLKIT_AUTHDB_DEFAULT
kit_assert (polkit_policy_default_get_allow_any (d) == POLKIT_RESULT_NO);
kit_assert (polkit_policy_default_get_allow_inactive (d) == POLKIT_RESULT_ONLY_VIA_SELF_AUTH);
kit_assert (polkit_policy_default_get_allow_active (d) == POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH);
#endif
polkit_policy_file_entry_ref (pfe);
polkit_policy_file_entry_unref (pfe);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment