[gtk+] icon-theme: Test inheritance vs. generic fallback
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] icon-theme: Test inheritance vs. generic fallback
- Date: Sun, 21 Sep 2014 20:35:37 +0000 (UTC)
commit df8a68865695a4bd8b8a261d2998e2041c9ea872
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 21 16:28:15 2014 -0400
icon-theme: Test inheritance vs. generic fallback
Add a few tests that check the behavior of icon theme inheritance
vs generic fallback vs symbolic icons.
testsuite/gtk/Makefile.am | 6 ++++
testsuite/gtk/icons/index.theme | 1 +
testsuite/gtk/icons/scalable/one-two-rtl.svg | 5 +++
testsuite/gtk/icons/scalable/one-two.svg | 5 +++
testsuite/gtk/icons2/index.theme | 12 ++++++++
.../gtk/icons2/scalable/one-two-symbolic-rtl.svg | 5 +++
testsuite/gtk/icons2/scalable/one-two-symbolic.svg | 5 +++
.../gtk/icons2/scalable/one-two-three-symbolic.svg | 5 +++
testsuite/gtk/icontheme.c | 30 ++++++++++++++++++++
9 files changed, 74 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 0a3889d..7e8e50f 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -152,6 +152,12 @@ test_icontheme = \
icons/16-22/size-test.png \
icons/25+/size-test.svg \
icons/35+/size-test.svg \
+ icons/scalable/one-two.svg \
+ icons/scalable/one-two-rtl.svg \
+ icons2/scalable/one-two-three-symbolic.svg \
+ icons2/scalable/one-two-symbolic.svg \
+ icons2/scalable/one-two-symbolic-rtl.svg \
+ icons2/index.theme \
$(NULL)
EXTRA_DIST += \
diff --git a/testsuite/gtk/icons/index.theme b/testsuite/gtk/icons/index.theme
index dbe538c..3156781 100644
--- a/testsuite/gtk/icons/index.theme
+++ b/testsuite/gtk/icons/index.theme
@@ -2,6 +2,7 @@
Name=Icons
Comment=Testing of the Icon theme code
Example=16x16/simple.png
+Inherits=icons2
Directories=16x16,16x16s,32x32,32x32s,scalable,15,16-22,25+,35+
diff --git a/testsuite/gtk/icons/scalable/one-two-rtl.svg b/testsuite/gtk/icons/scalable/one-two-rtl.svg
new file mode 100644
index 0000000..eefa1e5
--- /dev/null
+++ b/testsuite/gtk/icons/scalable/one-two-rtl.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" fill="black"/>
+ <rect x="64" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons/scalable/one-two.svg b/testsuite/gtk/icons/scalable/one-two.svg
new file mode 100644
index 0000000..eefa1e5
--- /dev/null
+++ b/testsuite/gtk/icons/scalable/one-two.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" fill="black"/>
+ <rect x="64" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons2/index.theme b/testsuite/gtk/icons2/index.theme
new file mode 100644
index 0000000..96d6965
--- /dev/null
+++ b/testsuite/gtk/icons2/index.theme
@@ -0,0 +1,12 @@
+[Icon Theme]
+Name=Icons2
+Comment=Testing of the Icon theme code
+
+Directories=scalable
+
+[scalable]
+Context=scalable icons
+Type=Scalable
+Size=128
+MinSize=1
+MaxSize=256
diff --git a/testsuite/gtk/icons2/scalable/one-two-symbolic-rtl.svg
b/testsuite/gtk/icons2/scalable/one-two-symbolic-rtl.svg
new file mode 100644
index 0000000..eefa1e5
--- /dev/null
+++ b/testsuite/gtk/icons2/scalable/one-two-symbolic-rtl.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" fill="black"/>
+ <rect x="64" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons2/scalable/one-two-symbolic.svg
b/testsuite/gtk/icons2/scalable/one-two-symbolic.svg
new file mode 100644
index 0000000..eefa1e5
--- /dev/null
+++ b/testsuite/gtk/icons2/scalable/one-two-symbolic.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" fill="black"/>
+ <rect x="64" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons2/scalable/one-two-three-symbolic.svg
b/testsuite/gtk/icons2/scalable/one-two-three-symbolic.svg
new file mode 100644
index 0000000..eefa1e5
--- /dev/null
+++ b/testsuite/gtk/icons2/scalable/one-two-three-symbolic.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" fill="black"/>
+ <rect x="64" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c
index 4a3c2cc..de895c2 100644
--- a/testsuite/gtk/icontheme.c
+++ b/testsuite/gtk/icontheme.c
@@ -669,6 +669,35 @@ test_async (void)
g_assert (loaded == 2);
}
+static void
+test_inherit (void)
+{
+ assert_icon_lookup ("one-two-three",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+ "/icons/scalable/one-two.svg");
+ assert_icon_lookup ("one-two-three",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_RTL,
+ "/icons/scalable/one-two-rtl.svg");
+ assert_icon_lookup ("one-two-three-symbolic",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+ "/icons2/scalable/one-two-three-symbolic.svg");
+ assert_icon_lookup ("one-two-three-symbolic",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_RTL,
+ "/icons2/scalable/one-two-three-symbolic.svg");
+ assert_icon_lookup ("one-two-symbolic",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+ "/icons2/scalable/one-two-symbolic.svg");
+ assert_icon_lookup ("one-two-symbolic",
+ SCALABLE_IMAGE_SIZE,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_RTL,
+ "/icons2/scalable/one-two-symbolic-rtl.svg");
+}
+
int
main (int argc, char *argv[])
{
@@ -686,6 +715,7 @@ main (int argc, char *argv[])
g_test_add_func ("/icontheme/builtin", test_builtin);
g_test_add_func ("/icontheme/list", test_list);
g_test_add_func ("/icontheme/async", test_async);
+ g_test_add_func ("/icontheme/inherit", test_inherit);
return g_test_run();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]