--- e.t 02 Jun 2008 09:56:28 +1000 1.2 +++ e.t 15 Jul 2008 09:44:59 +1000 @@ -3,7 +3,7 @@ # use strict; use Glib ':constants'; -use Test::More tests => 231; +use Test::More tests => 238; # first register some types with which to play below. @@ -58,11 +58,20 @@ 'Is you is, or is you ain\'t my baby', TRUE, 'readable'); pspec_common_ok ($pspec, 'Boolean', 'readable'); -ok ($pspec->get_default_value, "Boolean default (expect TRUE)"); +is ($pspec->get_default_value, 1, "Boolean default (expect TRUE)"); push @params, $pspec; +$pspec = Glib::ParamSpec->boolean ('untrue', 'Untrue', + 'A pernicious falsehood', + FALSE, 'readable'); +# this is PL_sv_no, not a 0, for historical compatibility +is ($pspec->get_default_value, '', "Boolean default (expect TRUE)"); +# not pushed, just checking the default +# push @params, $pspec; + + # # all of the integer types have the same interface. # @@ -132,6 +141,7 @@ # we only know one boxed type at this point. 'Glib::Scalar', G_PARAM_READWRITE); pspec_common_ok ($pspec, 'Boxed', G_PARAM_READWRITE, 'Glib::Scalar'); +is ($pspec->get_default_value, undef, 'Boxed default'); push @params, $pspec; @@ -139,6 +149,7 @@ 'I object, Your Honor, that\'s pure conjecture!', 'Skeezle', G_PARAM_READWRITE); pspec_common_ok ($pspec, 'Object', G_PARAM_READWRITE, 'Skeezle'); +is ($pspec->get_default_value, undef, 'Object default'); push @params, $pspec; @@ -154,6 +165,7 @@ ok ($pspec->get_flags == G_PARAM_READWRITE, 'Param flags'); is ($pspec->get_value_type, 'Glib::Param::Enum', 'Param value type'); ok (! $pspec->get_owner_type, 'Param owner type'); +is ($pspec->get_default_value, undef, 'Param default'); push @params, $pspec; @@ -171,6 +183,7 @@ $pspec = Glib::ParamSpec->IV ('iv', 'IV', 'This is the same as Int', -20, 10, -5, G_PARAM_READWRITE); +is ($pspec->get_default_value, -5, 'IV default'); isa_ok ($pspec, 'Glib::Param::Long', 'IV is actually Long'); push @params, $pspec; @@ -179,6 +192,7 @@ 'This is the same as UInt', 10, 20, 15, G_PARAM_READWRITE); isa_ok ($pspec, 'Glib::Param::ULong', 'UV is actually ULong'); +is ($pspec->get_default_value, 15, 'UV default'); push @params, $pspec; @@ -187,6 +201,7 @@ G_PARAM_READWRITE); isa_ok ($pspec, 'Glib::Param::Boxed', 'Scalar is actually Boxed'); is ($pspec->get_value_type, 'Glib::Scalar', 'boxed holding scalar'); +is ($pspec->get_default_value, undef, 'Scalar default'); push @params, $pspec;