Logo Search packages:      
Sourcecode: packagekit version File versions  Download package

pk-backend-test-fail.c

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
 *
 * Licensed under the GNU General Public License Version 2
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <gmodule.h>
#include <glib.h>
#include <string.h>
#include <pk-backend.h>

/**
 * backend_initalize:
 */
static void
backend_initialize (PkBackend *backend)
{
      g_return_if_fail (backend != NULL);
      pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR,
                         "Failed to initialize package manager");
}

/**
 * backend_destroy:
 */
static void
backend_destroy (PkBackend *backend)
{
      g_return_if_fail (backend != NULL);
      pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR,
                         "Failed to release control");
}

/**
 * backend_get_groups:
 */
static void
backend_get_groups (PkBackend *backend, PkEnumList *elist)
{
      g_return_if_fail (backend != NULL);
      pk_enum_list_append_multiple (elist,
                              PK_GROUP_ENUM_ACCESSIBILITY,
                              PK_GROUP_ENUM_GAMES,
                              PK_GROUP_ENUM_SYSTEM,
                              -1);
}

/**
 * backend_get_filters:
 */
static void
backend_get_filters (PkBackend *backend, PkEnumList *elist)
{
      g_return_if_fail (backend != NULL);
      pk_enum_list_append_multiple (elist,
                              PK_FILTER_ENUM_GUI,
                              PK_FILTER_ENUM_INSTALLED,
                              PK_FILTER_ENUM_DEVELOPMENT,
                              -1);
}

/**
 * backend_cancel:
 */
static void
backend_cancel (PkBackend *backend)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_depends:
 */
static void
backend_get_depends (PkBackend *backend, const gchar *package_id, gboolean recursive)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_description:
 */
static void
backend_get_description (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_files:
 */
static void
backend_get_files (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_requires:
 */
static void
backend_get_requires (PkBackend *backend, const gchar *package_id, gboolean recursive)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_update_detail:
 */
static void
backend_get_update_detail (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_get_updates:
 */
static void
backend_get_updates (PkBackend *backend)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_install_package:
 */
static void
backend_install_package (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_install_file:
 */
static void
backend_install_file (PkBackend *backend, const gchar *full_path)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_refresh_cache:
 */
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_remove_package:
 */
static void
backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_resolve:
 */
static void
backend_resolve (PkBackend *backend, const gchar *filter, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_rollback:
 */
static void
backend_rollback (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_search_details:
 */
static void
backend_search_details (PkBackend *backend, const gchar *filter, const gchar *search)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_search_file:
 */
static void
backend_search_file (PkBackend *backend, const gchar *filter, const gchar *search)
{
      g_return_if_fail (backend != NULL);
      pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR,
                         "Error number 1");
      pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR,
                         "Duplicate error");
      pk_backend_finished (backend);
}

/**
 * backend_search_group:
 */
static void
backend_search_group (PkBackend *backend, const gchar *filter, const gchar *search)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_search_name:
 */
static void
backend_search_name (PkBackend *backend, const gchar *filter, const gchar *search)
{
      g_return_if_fail (backend != NULL);
      pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR,
                         "Error number 1");
      pk_backend_finished (backend);
}

/**
 * backend_update_package:
 */
static void
backend_update_package (PkBackend *backend, const gchar *package_id)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

/**
 * backend_update_system:
 */
static void
backend_update_system (PkBackend *backend)
{
      g_return_if_fail (backend != NULL);
      pk_backend_finished (backend);
}

PK_BACKEND_OPTIONS (
      "Test Fail",                        /* description */
      "Richard Hughes <richard@hughsie.com>",   /* author */
      backend_initialize,                 /* initalize */
      backend_destroy,              /* destroy */
      backend_get_groups,                 /* get_groups */
      backend_get_filters,                /* get_filters */
      backend_cancel,                     /* cancel */
      backend_get_depends,                /* get_depends */
      backend_get_description,            /* get_description */
      backend_get_files,                  /* get_files */
      backend_get_requires,               /* get_requires */
      backend_get_update_detail,          /* get_update_detail */
      backend_get_updates,                /* get_updates */
      backend_install_package,            /* install_package */
      backend_install_file,               /* install_file */
      backend_refresh_cache,              /* refresh_cache */
      backend_remove_package,             /* remove_package */
      backend_resolve,              /* resolve */
      backend_rollback,             /* rollback */
      backend_search_details,             /* search_details */
      backend_search_file,                /* search_file */
      backend_search_group,               /* search_group */
      backend_search_name,                /* search_name */
      backend_update_package,             /* update_package */
      backend_update_system,              /* update_system */
      NULL,                         /* get_repo_list */
      NULL,                         /* repo_enable */
      NULL                          /* repo_set_data */
);


Generated by  Doxygen 1.6.0   Back to index