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:
@ -130,6 +130,7 @@ keyhash_SOURCES = \
|
|||||||
|
|
||||||
test_icontheme = \
|
test_icontheme = \
|
||||||
icons/16x16/simple.png \
|
icons/16x16/simple.png \
|
||||||
|
icons/32x32/only32-symbolic.svg \
|
||||||
icons/index.theme \
|
icons/index.theme \
|
||||||
icons/scalable/everything-justregular.svg \
|
icons/scalable/everything-justregular.svg \
|
||||||
icons/scalable/everything-justrtl-rtl.svg \
|
icons/scalable/everything-justrtl-rtl.svg \
|
||||||
|
|||||||
4
testsuite/gtk/icons/32x32/only32-symbolic.svg
Normal file
4
testsuite/gtk/icons/32x32/only32-symbolic.svg
Normal 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 |
@ -3,13 +3,18 @@ Name=Icons
|
|||||||
Comment=Testing of the Icon theme code
|
Comment=Testing of the Icon theme code
|
||||||
Example=16x16/simple.png
|
Example=16x16/simple.png
|
||||||
|
|
||||||
Directories=16x16,scalable
|
Directories=16x16,32x32,scalable
|
||||||
|
|
||||||
[16x16]
|
[16x16]
|
||||||
Context=16x16 icons
|
Context=16x16 icons
|
||||||
Size=16
|
Size=16
|
||||||
Type=Fixed
|
Type=Fixed
|
||||||
|
|
||||||
|
[32x32]
|
||||||
|
Context=32x32 icons
|
||||||
|
Size=32
|
||||||
|
Type=Fixed
|
||||||
|
|
||||||
[scalable]
|
[scalable]
|
||||||
Context=scalable icons
|
Context=scalable icons
|
||||||
Type=Scalable
|
Type=Scalable
|
||||||
|
|||||||
@ -405,6 +405,25 @@ test_rtl (void)
|
|||||||
"/icons/scalable/everything-justrtl-rtl.svg");
|
"/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
|
int
|
||||||
main (int argc, char *argv[])
|
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-symbolic", test_force_symbolic);
|
||||||
g_test_add_func ("/icontheme/force-regular", test_force_regular);
|
g_test_add_func ("/icontheme/force-regular", test_force_regular);
|
||||||
g_test_add_func ("/icontheme/rtl", test_rtl);
|
g_test_add_func ("/icontheme/rtl", test_rtl);
|
||||||
|
g_test_add_func ("/icontheme/symbolic-single-size", test_symbolic_single_size);
|
||||||
|
|
||||||
return g_test_run();
|
return g_test_run();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user