gsettings: add test for repeated <summary> errors
authorRyan Lortie <desrt@desrt.ca>
Thu, 9 Apr 2015 02:11:27 +0000 (22:11 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 9 Apr 2015 02:35:35 +0000 (22:35 -0400)
Make sure error handling on repeated <summary> and <description> is
being done properly, not resulting in glib-compile-schemas throwing a
critical.

https://bugzilla.gnome.org/show_bug.cgi?id=747542

gio/tests/gschema-compile.c
gio/tests/schema-tests/summary-xmllang-and-attrs.gschema.xml [new file with mode: 0644]

index 1f2b746..a215a84 100644 (file)
@@ -44,6 +44,8 @@ test_schema (gpointer data)
   if (test->err)
     {
       g_test_trap_assert_failed ();
+      g_test_trap_assert_stderr_unmatched ("*CRITICAL*");
+      g_test_trap_assert_stderr_unmatched ("*WARNING*");
       g_test_trap_assert_stderr (test->err);
     }
   else
@@ -128,6 +130,7 @@ static const SchemaTest tests[] = {
   { "flags-with-enum-tag",          NULL, "*<flags id='flags'> not (yet) defined*"              },
   { "summary-xmllang",              NULL, "*Only one <summary> element allowed*"                },
   { "description-xmllang",          NULL, "*Only one <description> element allowed*"            },
+  { "summary-xmllang-and-attrs",    NULL, "*attribute 'lang' invalid for element 'summary'*"    },
   { "inherit-gettext-domain",       NULL, NULL                                                  },
   { "range-type-test",              NULL, NULL                                                  },
   { "cdata",                        NULL, NULL                                                  }
diff --git a/gio/tests/schema-tests/summary-xmllang-and-attrs.gschema.xml b/gio/tests/schema-tests/summary-xmllang-and-attrs.gschema.xml
new file mode 100644 (file)
index 0000000..b1da54e
--- /dev/null
@@ -0,0 +1,13 @@
+<schemalist>
+  <schema path="/org/gnome/gnome-screenshot/" id="org.gnome.gnome-screenshot">
+    <key type="b" name="take-window-shot">
+      <default>false</default>
+      <summary>Window-specific screenshot (deprecated)</summary>
+      <summary lang="an">Captura especifica de finestra (obsoleto)</summary>
+      <summary lang="ar">لقطة شاشة مختصّة بنافذة (مُبطل)</summary>
+      <summary lang="as">উইন্ডোৰ ক্ষেত্ৰত নিৰ্দিষ্ট স্ক্ৰিনশ্বট (স্খলিত)</summary>
+      <summary lang="ast">Captura específica de ventana (obsoleto)</summary>
+      <description>Bla</description>
+    </key>
+  </schema>
+</schemalist>