Enhanced pango attribute tests, Added tests for requires tag handling.
* tests/buildertest.c: Enhanced pango attribute tests, Added tests for requires tag handling. svn path=/trunk/; revision=20154
This commit is contained in:
parent
97902c7c6a
commit
cd697bb2e3
2 changed files with 32 additions and 0 deletions
|
|
@ -12,6 +12,9 @@
|
|||
* gtk/docs/reference/gtk/tmpl/gtkbuilder.sgml: Added documentation
|
||||
for the added xml tags to the ui description.
|
||||
|
||||
* tests/buildertest.c: Enhanced pango attribute tests, Added tests
|
||||
for requires tag handling.
|
||||
|
||||
2008-05-25 Richard Hult <richard@imendio.com>
|
||||
|
||||
* gtk/gtkdnd-quartz.c: (gtk_drag_drop_finished): Run
|
||||
|
|
|
|||
|
|
@ -2084,6 +2084,8 @@ test_pango_attributes (void)
|
|||
gtk_builder_add_from_string (builder, err_buffer1, -1, &error);
|
||||
label = gtk_builder_get_object (builder, "label1");
|
||||
g_assert (error);
|
||||
g_assert (error->domain == GTK_BUILDER_ERROR);
|
||||
g_assert (error->code == GTK_BUILDER_ERROR_MISSING_ATTRIBUTE);
|
||||
g_object_unref (builder);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
|
|
@ -2091,12 +2093,38 @@ test_pango_attributes (void)
|
|||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_string (builder, err_buffer2, -1, &error);
|
||||
label = gtk_builder_get_object (builder, "label1");
|
||||
|
||||
g_assert (error);
|
||||
g_assert (error->domain == GTK_BUILDER_ERROR);
|
||||
g_assert (error->code == GTK_BUILDER_ERROR_INVALID_ATTRIBUTE);
|
||||
g_object_unref (builder);
|
||||
g_error_free (error);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_requires (void)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GError *error = NULL;
|
||||
gchar *buffer;
|
||||
const gchar buffer_fmt[] =
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"%d.%d\"/>"
|
||||
"</interface>";
|
||||
|
||||
buffer = g_strdup_printf (buffer_fmt, GTK_MAJOR_VERSION, GTK_MINOR_VERSION + 1);
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_string (builder, buffer, -1, &error);
|
||||
g_assert (error);
|
||||
g_assert (error->domain == GTK_BUILDER_ERROR);
|
||||
g_assert (error->code == GTK_BUILDER_ERROR_VERSION_MISMATCH);
|
||||
g_object_unref (builder);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_file (const gchar *filename)
|
||||
{
|
||||
|
|
@ -2180,6 +2208,7 @@ main (int argc, char **argv)
|
|||
g_test_add_func ("/Builder/Window", test_window);
|
||||
g_test_add_func ("/Builder/IconFactory", test_icon_factory);
|
||||
g_test_add_func ("/Builder/PangoAttributes", test_pango_attributes);
|
||||
g_test_add_func ("/Builder/Requires", test_requires);
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue