testsuite: Add a test for symbolic icons in specific sizes

Check that loading symbolics works, even if the symbolic is only
available in a fixed size.
This commit is contained in:
Benjamin Otte
2014-06-12 12:28:07 +02:00
parent 5ef4d71b15
commit 45a64cd7d4
4 changed files with 31 additions and 1 deletions

View File

@ -130,6 +130,7 @@ keyhash_SOURCES = \
test_icontheme = \
icons/16x16/simple.png \
icons/32x32/only32-symbolic.svg \
icons/index.theme \
icons/scalable/everything-justregular.svg \
icons/scalable/everything-justrtl-rtl.svg \

View File

@ -0,0 +1,4 @@
<?xml version="1.0" standalone="no"?>
<svg width="32" height="32" version="1.1" xmlns="http://www.w3.org/2000/svg">
<text x="16" y="24" text-anchor="middle" font-size="24">32</text>
</svg>

After

Width:  |  Height:  |  Size: 191 B

View File

@ -3,13 +3,18 @@ Name=Icons
Comment=Testing of the Icon theme code
Example=16x16/simple.png
Directories=16x16,scalable
Directories=16x16,32x32,scalable
[16x16]
Context=16x16 icons
Size=16
Type=Fixed
[32x32]
Context=32x32 icons
Size=32
Type=Fixed
[scalable]
Context=scalable icons
Type=Scalable

View File

@ -405,6 +405,25 @@ test_rtl (void)
"/icons/scalable/everything-justrtl-rtl.svg");
}
static void
test_symbolic_single_size (void)
{
/* Check we properly load a symbolic icon from a sized directory */
assert_icon_lookup ("only32-symbolic",
32,
0,
"/icons/32x32/only32-symbolic.svg");
/* Check that we still properly load it even if a different size is requested */
assert_icon_lookup ("only32-symbolic",
16,
0,
"/icons/32x32/only32-symbolic.svg");
assert_icon_lookup ("only32-symbolic",
128,
0,
"/icons/32x32/only32-symbolic.svg");
}
int
main (int argc, char *argv[])
{
@ -416,6 +435,7 @@ main (int argc, char *argv[])
g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic);
g_test_add_func ("/icontheme/force-regular", test_force_regular);
g_test_add_func ("/icontheme/rtl", test_rtl);
g_test_add_func ("/icontheme/symbolic-single-size", test_symbolic_single_size);
return g_test_run();
}