#include <libintl.h>
+#define _(String) dgettext("hildon-libs", String)
+
/* -------------------- Fixtures -------------------- */
static HildonCaption *caption = NULL;
/* We control i18n so we will never set it properly because apparently it will not be useful for testing */
/* so _("ecdg_ti_caption_separato") should return the same result that "ecdg_ti_caption_separator" */
/* If in the future we decide activate internationalization we must modify test implementation */
- expected_ret_label = g_strconcat(TEST_LABEL,"ecdg_ti_caption_separator",NULL);
+ expected_ret_label = g_strconcat(TEST_LABEL,_("ecdg_ti_caption_separator"),NULL);
/* Test 1 */
hildon_caption_set_label (caption, TEST_LABEL);
/* Test 2 */
hildon_caption_set_label (caption, "");
- fail_if (strcmp (hildon_caption_get_label (caption),"ecdg_ti_caption_separator") != 0,
+ fail_if (strcmp (hildon_caption_get_label (caption),_("ecdg_ti_caption_separator")) != 0,
"hildon-caption: the returned label is %s and should be default separator",
hildon_caption_get_label (caption));
}
/* Test 1 */
hildon_caption_set_label (caption, TEST_LABEL);
- expected_ret_label = g_strconcat(TEST_LABEL,"ecdg_ti_caption_separator",NULL);
+ expected_ret_label = g_strconcat(TEST_LABEL, _("ecdg_ti_caption_separator"),NULL);
fail_if (strcmp (hildon_caption_get_label (caption), expected_ret_label) != 0,
"hildon-caption: the returned label is %s and should be %s",
/* Test 2 */
hildon_caption_set_label (caption, "");
- fail_if (strcmp (hildon_caption_get_label (caption), "ecdg_ti_caption_separator") != 0,
+ fail_if (strcmp (hildon_caption_get_label (caption), _("ecdg_ti_caption_separator")) != 0,
"hildon-caption: the returned label is %s and should be default separator",
hildon_caption_get_label (caption));
}
min=hildon_controlbar_get_min(controlbar);
- fail_if (min != 0,
- "hildon-controlbar: The returned min is %d and should be 0",
- min);
+ fail_if (min != init_min,
+ "hildon-controlbar: The returned min is %d and should be %d",
+ min, init_min);
max=hildon_controlbar_get_max(controlbar);
min=hildon_controlbar_get_min(controlbar);
- fail_if (min != 0,
- "hildon-controlbar: The returned min is %d and should be 0",
- min, 0);
+ fail_if (min != init_min,
+ "hildon-controlbar: The returned min is %d and should be %d",
+ min, init_min);
max=hildon_controlbar_get_max(controlbar);
- fail_if (max != 0,
- "hildon-controlbar: The returned max is %d and should be 0",
- max);
+ fail_if (max != init_max,
+ "hildon-controlbar: The returned max is %d and should be %d",
+ max, init_max);
/* Test 4: Set a range of [G_MAXINT,-1] */
init_min = G_MAXINT;
max=hildon_controlbar_get_max(controlbar);
- fail_if (max != 0,
- "hildon-controlbar: The returned max is %d and should be 0",
- max);
+ fail_if (max != init_max,
+ "hildon-controlbar: The returned max is %d and should be %d",
+ max, init_max);
min=hildon_controlbar_get_min(controlbar);
- fail_if (min != 0,
- "hildon-controlbar: The returned min is %d and should be 0",
- min);
+ fail_if (min != init_max,
+ "hildon-controlbar: The returned min is %d and should be %d",
+ min, init_max);
/* Test 5: Set a range of [1,G_MININT] */
init_min = 1;
max=hildon_controlbar_get_max(controlbar);
- fail_if (max != 0,
- "hildon-controlbar: The returned max is %d and should be 0",
- max);
+ fail_if (max != init_min,
+ "hildon-controlbar: The returned max is %d and should be %d",
+ max, init_min);
min=hildon_controlbar_get_min(controlbar);
- fail_if (min != 0,
- "hildon-controlbar: The returned min is %d and should be 0",
- min);
+ fail_if (min != init_min,
+ "hildon-controlbar: The returned min is %d and should be %d",
+ min, init_min);
}
END_TEST
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_unless( note_type == HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_unless( note_type == HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;
g_object_get_property(G_OBJECT (invalid_note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
gtk_widget_destroy (GTK_WIDGET (invalid_note));
invalid_note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_INFORMATION_THEME_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_INFORMATION_THEME_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_INFORMATION_THEME,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_INFORMATION_THEME)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_INFORMATION_THEME_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_INFORMATION_THEME_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_INFORMATION_THEME,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_INFORMATION_THEME)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;
g_object_get_property(G_OBJECT (invalid_note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_INFORMATION_THEME_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_INFORMATION_THEME_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_INFORMATION_THEME,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_INFORMATION_THEME)",note_type);
gtk_widget_destroy (GTK_WIDGET (invalid_note));
invalid_note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
g_object_get_property(G_OBJECT (note),"icon",&icon_name_value);
ret_icon_name = g_value_get_string (&icon_name_value);
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
g_object_get_property(G_OBJECT (note),"icon",&icon_name_value);
ret_icon_name = g_value_get_string (&icon_name_value);
g_object_get_property(G_OBJECT (invalid_note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_CONFIRMATION_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_CONFIRMATION_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_CONFIRMATION,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_CONFIRMATION)",note_type);
gtk_widget_destroy (GTK_WIDGET (invalid_note));
invalid_note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_PROGRESSBAR_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_PROGRESSBAR_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_PROGRESSBAR,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_PROGRESSBAR)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_PROGRESSBAR_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_PROGRESSBAR_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_PROGRESSBAR,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_PROGRESSBAR)",note_type);
gtk_widget_destroy (GTK_WIDGET (progress_bar));
gtk_widget_destroy (GTK_WIDGET (note));
g_object_get_property(G_OBJECT (note),"note_type",&enum_value);
note_type = g_value_get_int(&enum_value);
- fail_if( note_type != HILDON_NOTE_PROGRESSBAR_TYPE,
- "hildon-note: Type was not set property on creation (HILDON_NOTE_PROGRESSBAR_TYPE)",note_type);
+ fail_if( note_type != HILDON_NOTE_TYPE_PROGRESSBAR,
+ "hildon-note: Type was not set property on creation (HILDON_NOTE_TYPE_PROGRESSBAR)",note_type);
gtk_widget_destroy (GTK_WIDGET (note));
note=NULL;