[gtk+] Add tests for the GtkScale builder parser
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add tests for the GtkScale builder parser
- Date: Mon, 27 Apr 2015 05:18:30 +0000 (UTC)
commit e973d49a1181f9b6943cf86d345a6d0985b4b357
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Apr 25 11:24:40 2015 -0400
Add tests for the GtkScale builder parser
These tests check various error conditions in GtkScale
custom tags.
testsuite/gtk/Makefile.am | 7 +++++++
testsuite/gtk/ui/scale1.expected | 1 +
testsuite/gtk/ui/scale1.ui | 9 +++++++++
testsuite/gtk/ui/scale2.expected | 2 ++
testsuite/gtk/ui/scale2.ui | 8 ++++++++
testsuite/gtk/ui/scale3.expected | 2 ++
testsuite/gtk/ui/scale3.ui | 8 ++++++++
testsuite/gtk/ui/scale4.expected | 2 ++
testsuite/gtk/ui/scale4.ui | 8 ++++++++
testsuite/gtk/ui/scale5.expected | 2 ++
testsuite/gtk/ui/scale5.ui | 8 ++++++++
testsuite/gtk/ui/scale6.expected | 2 ++
testsuite/gtk/ui/scale6.ui | 8 ++++++++
testsuite/gtk/ui/scale7.expected | 2 ++
testsuite/gtk/ui/scale7.ui | 8 ++++++++
15 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 071535b..2d00bf3 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -185,6 +185,13 @@ test_ui = \
ui/celllayout5.ui ui/celllayout5.expected \
ui/celllayout6.ui ui/celllayout6.expected \
ui/celllayout7.ui ui/celllayout7.expected \
+ ui/scale1.ui ui/scale1.expected \
+ ui/scale2.ui ui/scale2.expected \
+ ui/scale3.ui ui/scale3.expected \
+ ui/scale4.ui ui/scale4.expected \
+ ui/scale5.ui ui/scale5.expected \
+ ui/scale6.ui ui/scale6.expected \
+ ui/scale7.ui ui/scale7.expected \
$(NULL)
EXTRA_DIST += \
diff --git a/testsuite/gtk/ui/scale1.expected b/testsuite/gtk/ui/scale1.expected
new file mode 100644
index 0000000..ff43ca4
--- /dev/null
+++ b/testsuite/gtk/ui/scale1.expected
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/scale1.ui b/testsuite/gtk/ui/scale1.ui
new file mode 100644
index 0000000..d84dce3
--- /dev/null
+++ b/testsuite/gtk/ui/scale1.ui
@@ -0,0 +1,9 @@
+<!-- test valid scale custom tags -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <mark translatable="yes" comments="blargh" context="none" value="0.1" position="top">text</mark>
+ <mark value="0.9"/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale2.expected b/testsuite/gtk/ui/scale2.expected
new file mode 100644
index 0000000..5c5ade8
--- /dev/null
+++ b/testsuite/gtk/ui/scale2.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:5:43 attribute 'nosuchattribute' invalid for element 'mark'
diff --git a/testsuite/gtk/ui/scale2.ui b/testsuite/gtk/ui/scale2.ui
new file mode 100644
index 0000000..edfd061
--- /dev/null
+++ b/testsuite/gtk/ui/scale2.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <mark nosuchattribute="" value="0"/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale3.expected b/testsuite/gtk/ui/scale3.expected
new file mode 100644
index 0000000..bdc10fa
--- /dev/null
+++ b/testsuite/gtk/ui/scale3.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 5
+.:5:46 element 'mark', attribute 'translatable', value 'foobar' cannot be parsed as a boolean value
diff --git a/testsuite/gtk/ui/scale3.ui b/testsuite/gtk/ui/scale3.ui
new file mode 100644
index 0000000..a50a892
--- /dev/null
+++ b/testsuite/gtk/ui/scale3.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <mark translatable="foobar" value="0"/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale4.expected b/testsuite/gtk/ui/scale4.expected
new file mode 100644
index 0000000..2f24f77
--- /dev/null
+++ b/testsuite/gtk/ui/scale4.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:5:43 Could not parse enum: `between'
diff --git a/testsuite/gtk/ui/scale4.ui b/testsuite/gtk/ui/scale4.ui
new file mode 100644
index 0000000..41435b3
--- /dev/null
+++ b/testsuite/gtk/ui/scale4.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <mark value="0" position="between"/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale5.expected b/testsuite/gtk/ui/scale5.expected
new file mode 100644
index 0000000..879f98c
--- /dev/null
+++ b/testsuite/gtk/ui/scale5.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:5:26 Could not parse double `abc'
diff --git a/testsuite/gtk/ui/scale5.ui b/testsuite/gtk/ui/scale5.ui
new file mode 100644
index 0000000..0c5620c
--- /dev/null
+++ b/testsuite/gtk/ui/scale5.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <mark value="abc"/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale6.expected b/testsuite/gtk/ui/scale6.expected
new file mode 100644
index 0000000..10a0c49
--- /dev/null
+++ b/testsuite/gtk/ui/scale6.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:5:13 Unsupported tag for GtkScale: <foo>
diff --git a/testsuite/gtk/ui/scale6.ui b/testsuite/gtk/ui/scale6.ui
new file mode 100644
index 0000000..1866655
--- /dev/null
+++ b/testsuite/gtk/ui/scale6.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark element -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ <foo/>
+ </marks>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale7.expected b/testsuite/gtk/ui/scale7.expected
new file mode 100644
index 0000000..7661a45
--- /dev/null
+++ b/testsuite/gtk/ui/scale7.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+Unhandled tag: <foo>
diff --git a/testsuite/gtk/ui/scale7.ui b/testsuite/gtk/ui/scale7.ui
new file mode 100644
index 0000000..aec0cad
--- /dev/null
+++ b/testsuite/gtk/ui/scale7.ui
@@ -0,0 +1,8 @@
+<!-- test invalid scale subelement -->
+<interface>
+ <object class="GtkScale">
+ <marks>
+ </marks>
+ <foo/>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]