Skip to content
Snippets Groups Projects
Commit d64424b6 authored by intrigeri's avatar intrigeri
Browse files

Fix t/g.t when the runtime version of GLib differs from the version we were...

Fix t/g.t when the runtime version of GLib differs from the version we were compiled against, which can happen e.g. during autopkgtests (Closes: #933069)
parent 0494a21d
No related branches found
No related tags found
No related merge requests found
From: intrigeri <intrigeri@boum.org>
Date: Sat, 27 Jul 2019 14:23:13 +0000
Subject: Implement Glib->check_version().
This is needed to correctly fix t/g.t for GLib 2.59+.
Bug-Debian: https://bugs.debian.org/933069
Origin: https://gitlab.gnome.org/GNOME/perl-glib/merge_requests/4
---
GUtils.xs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/GUtils.xs b/GUtils.xs
index 4403a01..3c455a8 100644
--- a/GUtils.xs
+++ b/GUtils.xs
@@ -467,6 +467,18 @@ CHECK_VERSION (class, guint required_major, guint required_minor, guint required
OUTPUT:
RETVAL
+=for apidoc
+Provides a mechanism for checking the version information that Glib is
+linked against. Essentially equivalent to the glib_check_version() function.
+=cut
+gchar *
+check_version (class, guint required_major, guint required_minor, guint required_micro)
+ CODE:
+ RETVAL = glib_check_version (required_major, required_minor,
+ required_micro);
+ OUTPUT:
+ RETVAL
+
MODULE = Glib::Utils PACKAGE = Glib::Markup PREFIX = g_markup_
=for object Glib::Markup markup handling functions
remove-version-checking
glib259.patch
POD-add-short-description-for-Glib-VariantDict.patch
Implement-Glib-check_version.patch
t-g.t-where-relevant-check-GLib-linked-runtime-version-in.patch
From: intrigeri <intrigeri@boum.org>
Date: Sat, 27 Jul 2019 14:23:53 +0000
Subject: t/g.t: where relevant,
check GLib "linked" (runtime) version instead of the version we were
compiled against.
The expected behavior for these tests depends on what version of GLib we're
using while testing, rather than on what version of GLib we were
compiled against.
Bug-Debian: https://bugs.debian.org/933069
Origin: https://gitlab.gnome.org/GNOME/perl-glib/merge_requests/4
---
t/g.t | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/g.t b/t/g.t
index bc3df03..b1f0e8d 100644
--- a/t/g.t
+++ b/t/g.t
@@ -84,7 +84,7 @@ SKIP: {
eq_array (\@bools, [FALSE, TRUE, FALSE]);
ok ($key_file->has_group('locales'));
- if (Glib->CHECK_VERSION (2, 59, 0)) {
+ if (! defined Glib->check_version (2, 59, 0)) {
is ($key_file->get_comment('locales', 'mystring'), "some string");
} else {
is ($key_file->get_comment('locales', 'mystring'), "some string\n");
@@ -98,7 +98,7 @@ SKIP: {
$key_file->set_string_list('listsection', 'stringlist', 'one', 'two', 'three');
$key_file->set_locale_string('locales', 'mystring', 'en', 'one');
$key_file->set_comment('locales', 'mystring', 'comment');
- if (Glib->CHECK_VERSION (2, 59, 0)) {
+ if (! defined Glib->check_version (2, 59, 0)) {
is ($key_file->get_comment('locales', 'mystring'), "comment");
$key_file->set_comment('locales', undef, "another comment");
is ($key_file->get_comment('locales', undef), "#another comment");
@@ -108,7 +108,7 @@ SKIP: {
is ($key_file->get_comment('locales', undef), "#another comment\n#");
}
$key_file->set_comment(undef, undef, 'one comment more');
- if (Glib->CHECK_VERSION (2, 59, 0)) {
+ if (! defined Glib->check_version (2, 59, 0)) {
is ($key_file->get_comment(undef, undef), "one comment more");
} else {
is ($key_file->get_comment(undef, undef), "one comment more\n");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment