diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-02-27 09:51:29 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-02-27 09:51:29 +0100 |
| commit | 2c65a2c6b02924df720f55c6e96e2e201d404c0c (patch) | |
| tree | d5103d1d2fa92099a71553d4523138617c1e0bbd /backend/tests | |
| parent | 5875f6ac9ad2191eb761157fb94cb73bc671a9f0 (diff) | |
| download | katja-2c65a2c6b02924df720f55c6e96e2e201d404c0c.tar.gz | |
Rename Glib primitive types to standard C types
Diffstat (limited to 'backend/tests')
| -rw-r--r-- | backend/tests/definitions.cc | 68 | ||||
| -rw-r--r-- | backend/tests/dl-test.cc | 9 | ||||
| -rw-r--r-- | backend/tests/slackpkg-test.cc | 9 |
3 files changed, 51 insertions, 35 deletions
diff --git a/backend/tests/definitions.cc b/backend/tests/definitions.cc index 7906dd8..37f6134 100644 --- a/backend/tests/definitions.cc +++ b/backend/tests/definitions.cc @@ -1,27 +1,33 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#include <cstdint> #include "pk-backend.h" #include <pk-backend-job.h> -gpointer +void * pk_backend_job_get_user_data (PkBackendJob *job) { - return NULL; + return nullptr; } void -pk_backend_job_set_user_data (PkBackendJob *job, gpointer user_data) +pk_backend_job_set_user_data (PkBackendJob *job, void *user_data) { } void -pk_backend_job_set_allow_cancel (PkBackendJob *job, gboolean allow_cancel) +pk_backend_job_set_allow_cancel (PkBackendJob *job, bool allow_cancel) { } void pk_backend_job_package (PkBackendJob *job, PkInfoEnum info, - const gchar *package_id, - const gchar *summary) + const char *package_id, + const char *summary) { } @@ -31,62 +37,62 @@ pk_backend_job_set_status (PkBackendJob *job, PkStatusEnum status) } void -pk_backend_job_set_percentage (PkBackendJob *job, guint percentage) +pk_backend_job_set_percentage (PkBackendJob *job, unsigned percentage) { } void pk_backend_job_error_code (PkBackendJob *job, - PkErrorEnum error_code, const gchar *format, ...) + PkErrorEnum error_code, const char *format, ...) { } void pk_backend_job_files (PkBackendJob *job, - const gchar *package_id, gchar **files) + const char *package_id, char **files) { } void pk_backend_job_details (PkBackendJob *job, - const gchar *package_id, - const gchar *summary, - const gchar *license, + const char *package_id, + const char *summary, + const char *license, PkGroupEnum group, - const gchar *description, - const gchar *url, - gulong size, - guint64 download_size) + const char *description, + const char *url, + unsigned long size, + std::uint64_t download_size) { } void pk_backend_job_update_detail (PkBackendJob *job, - const gchar *package_id, - gchar **updates, - gchar **obsoletes, - gchar **vendor_urls, - gchar **bugzilla_urls, - gchar **cve_urls, + const char *package_id, + char **updates, + char **obsoletes, + char **vendor_urls, + char **bugzilla_urls, + char **cve_urls, PkRestartEnum restart, - const gchar *update_text, - const gchar *changelog, + const char *update_text, + const char *changelog, PkUpdateStateEnum state, - const gchar *issued, - const gchar *updated) + const char *issued, + const char *updated) { } -gboolean +bool pk_backend_job_thread_create (PkBackendJob *job, PkBackendJobThreadFunc func, - gpointer user_data, + void *user_data, GDestroyNotify destroy_func) { - return FALSE; + return false; } -gboolean pk_directory_remove_contents (const gchar *directory) +bool pk_directory_remove_contents (const char *directory) { - return TRUE; + return true; } diff --git a/backend/tests/dl-test.cc b/backend/tests/dl-test.cc index f4959fe..d04b2b5 100644 --- a/backend/tests/dl-test.cc +++ b/backend/tests/dl-test.cc @@ -1,3 +1,8 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ #include "dl.h" using namespace slack; @@ -5,7 +10,7 @@ using namespace slack; static void slack_test_dl_construct() { - auto dl = new Dl ("some", "mirror", 1, NULL, NULL); + auto dl = new Dl ("some", "mirror", 1, nullptr, nullptr); g_assert_cmpstr (dl->get_name (), ==, "some"); g_assert_cmpstr (dl->get_mirror (), ==, "mirror"); @@ -17,7 +22,7 @@ slack_test_dl_construct() int main(int argc, char *argv[]) { - g_test_init(&argc, &argv, NULL); + g_test_init(&argc, &argv, nullptr); g_test_add_func("/slack/dl/construct", slack_test_dl_construct); diff --git a/backend/tests/slackpkg-test.cc b/backend/tests/slackpkg-test.cc index 09c4142..bc2e227 100644 --- a/backend/tests/slackpkg-test.cc +++ b/backend/tests/slackpkg-test.cc @@ -1,3 +1,8 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ #include "slackpkg.h" using namespace slack; @@ -5,7 +10,7 @@ using namespace slack; static void slack_test_slackpkg_construct() { - auto slackpkg = new Slackpkg ("some", "mirror", 1, NULL, NULL); + auto slackpkg = new Slackpkg ("some", "mirror", 1, nullptr, nullptr); g_assert_cmpstr(slackpkg->get_name (), ==, "some"); g_assert_cmpstr(slackpkg->get_mirror (), ==, "mirror"); @@ -17,7 +22,7 @@ slack_test_slackpkg_construct() int main(int argc, char *argv[]) { - g_test_init(&argc, &argv, NULL); + g_test_init(&argc, &argv, nullptr); g_test_add_func("/slack/slackpkg/construct", slack_test_slackpkg_construct); |
