Subject: | Failure to send a dictionary type |
NOTE: This bug requires that the patch listed in the bug '#21212:
Net::DBus::Binding::Message missing variant type' is applied before.
The perl bindings for Net::DBUS crash without an error message when a
dictionary of type variant is being passed through DBUS. This problem
only happens when there is data in the dictionary. Sending an empty
dictionary causes no problem.
A test case is attached to this bug.
Subject: | dbus-test-case.pl |
#!/usr/bin/perl
=head1 NAME
dbus-test-case.pl - Sample DBUS test case.
=head1 SYNOPSIS
dbus-test-case.pl
=head1 DESCRIPTION
Sample program used to demonstrate a failure with the Net::DBUS API.
The failure happens when a dictionary of type variant is passed
through the bus.
=head1 AUTHOR
Emmanuel Rodriguez < emmanuel.rodriguez@gmail.com >
=cut
use strict;
use warnings;
use Net::DBus;
# Main entry point
exit main();
#
# Main entry point of the program
#
sub main {
my $dbus = Net::DBus->session;
my $service = $dbus->get_service("org.freedesktop.Notifications");
my $object = $service->get_object("/org/freedesktop/Notifications");
print "Before\n";
# Send and notification
$object->Notify(
"dbus-test", # Application name
0, # replaces_id (0 -> nothing)
'gtk-connect', #app_icon ("" -> no icon)
'Test event', # summary
"This is a test to see if DBUS works nicely in Perl.\nI hope that this works.", # body
[], # actions
##
## This is where problem seems to be.
## The hashref is meant to be past as a dictionary of type variant.
## For more details on the method signature see :
## http://www.galago-project.org/specs/notification/0.9/x408.html
##
## For more details on the expected type of this particular field see:
## http://www.galago-project.org/specs/notification/0.9/x344.html
##
{
x => 100,
y => 200,
}, # hints
5_000 # expire_timeout in milliseconds
);
# Expected to be printed
print "After\n";
return 0;
}