test_param_spec_char (void)
{
GParamSpec *pspec;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean modified;
pspec = g_param_spec_char ("char", "nick", "blurb",
test_param_spec_string (void)
{
GParamSpec *pspec;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean modified;
pspec = g_param_spec_string ("string", "nick", "blurb",
test_param_spec_override (void)
{
GParamSpec *ospec, *pspec;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean modified;
ospec = g_param_spec_char ("char", "nick", "blurb",
g_assert (modified && g_value_get_char (&value) == 40);
g_param_spec_unref (pspec);
+ g_param_spec_unref (ospec);
}
static void
test_param_spec_gtype (void)
{
GParamSpec *pspec;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean modified;
pspec = g_param_spec_gtype ("gtype", "nick", "blurb",
g_value_set_gtype (&value, G_TYPE_PARAM_INT);
modified = g_param_value_validate (pspec, &value);
g_assert (!modified && g_value_get_gtype (&value) == G_TYPE_PARAM_INT);
+
+ g_param_spec_unref (pspec);
}
static void
test_param_spec_variant (void)
{
GParamSpec *pspec;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean modified;
pspec = g_param_spec_variant ("variant", "nick", "blurb",
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
- g_type_init ();
g_test_add_func ("/paramspec/char", test_param_spec_char);
g_test_add_func ("/paramspec/string", test_param_spec_string);