Subject: | Variant types not handled in MockConnection class |
Attempting to return variant-typed data from a method on the MockConnection bus fails with the following exception:
Unguessable compound type '118' ('v')
Attached patch seems to fix it.
Subject: | net-dbus-variant.patch |
diff --git a/lib/Net/DBus/Test/MockIterator.pm b/lib/Net/DBus/Test/MockIterator.pm
index 4130d00..dad9f0e 100644
--- a/lib/Net/DBus/Test/MockIterator.pm
+++ b/lib/Net/DBus/Test/MockIterator.pm
@@ -677,6 +677,8 @@ sub guess_type {
$subtype = [ $self->guess_type(($value->value())[0]->[0]) ];
} elsif ($maintype == &Net::DBus::Binding::Message::TYPE_STRUCT) {
$subtype = [ map { $self->guess_type($_) } @{($value->value())[0]} ];
+ } elsif ($maintype == &Net::DBus::Binding::Message::TYPE_VARIANT) {
+ $subtype = $self->guess_type($value->value);
} else {
die "Unguessable compound type '$maintype' ('", chr($maintype), "')\n";
}