forked from AuroraMiddleware/gtk
Add more icon theme tests
This test checks various directory size behaviours, with and without the FORCE_SIZE flag.
This commit is contained in:
parent
51417f98d1
commit
a6f1f8dacf
BIN
testsuite/gtk/icons/15/size-test.png
Normal file
BIN
testsuite/gtk/icons/15/size-test.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 296 B |
BIN
testsuite/gtk/icons/16-22/size-test.png
Normal file
BIN
testsuite/gtk/icons/16-22/size-test.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 437 B |
87
testsuite/gtk/icons/25+/size-test.svg
Normal file
87
testsuite/gtk/icons/25+/size-test.svg
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30"
|
||||
height="30"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="size-test.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="17.515478"
|
||||
inkscape:cx="11.899233"
|
||||
inkscape:cy="19.702198"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="872"
|
||||
inkscape:window-height="724"
|
||||
inkscape:window-x="39"
|
||||
inkscape:window-y="66"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1022.3622)">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
x="2.3993642"
|
||||
y="1044.8604"
|
||||
id="text2985"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan2987"
|
||||
x="2.3993642"
|
||||
y="1044.8604">30</tspan></text>
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot2989"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
|
||||
id="flowRegion2991"><rect
|
||||
id="rect2993"
|
||||
width="562.85712"
|
||||
height="674.28571"
|
||||
x="182.85715"
|
||||
y="375.21933" /></flowRegion><flowPara
|
||||
id="flowPara2995"></flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot2997"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
|
||||
id="flowRegion2999"><rect
|
||||
id="rect3001"
|
||||
width="105.71429"
|
||||
height="62.857143"
|
||||
x="245.71428"
|
||||
y="326.64789" /></flowRegion><flowPara
|
||||
id="flowPara3003"></flowPara></flowRoot> </g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
87
testsuite/gtk/icons/35+/size-test.svg
Normal file
87
testsuite/gtk/icons/35+/size-test.svg
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="size-test.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="12.385313"
|
||||
inkscape:cx="11.899233"
|
||||
inkscape:cy="19.702198"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1080"
|
||||
inkscape:window-height="734"
|
||||
inkscape:window-x="39"
|
||||
inkscape:window-y="66"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1012.3622)">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:25px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
|
||||
x="4.0949211"
|
||||
y="1041.1464"
|
||||
id="text2985"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3043"
|
||||
x="4.0949211"
|
||||
y="1041.1464">40</tspan></text>
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot2989"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
|
||||
id="flowRegion2991"><rect
|
||||
id="rect2993"
|
||||
width="562.85712"
|
||||
height="674.28571"
|
||||
x="182.85715"
|
||||
y="375.21933" /></flowRegion><flowPara
|
||||
id="flowPara2995"></flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot2997"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
|
||||
id="flowRegion2999"><rect
|
||||
id="rect3001"
|
||||
width="105.71429"
|
||||
height="62.857143"
|
||||
x="245.71428"
|
||||
y="326.64789" /></flowRegion><flowPara
|
||||
id="flowPara3003"></flowPara></flowRoot> </g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
@ -3,7 +3,7 @@ Name=Icons
|
||||
Comment=Testing of the Icon theme code
|
||||
Example=16x16/simple.png
|
||||
|
||||
Directories=16x16,16x16s,32x32,32x32s,scalable
|
||||
Directories=16x16,16x16s,32x32,32x32s,scalable,15,16-22,25+,35+
|
||||
|
||||
[16x16]
|
||||
Context=16x16 icons
|
||||
@ -35,3 +35,28 @@ Type=Scalable
|
||||
Size=128
|
||||
MinSize=1
|
||||
MaxSize=256
|
||||
|
||||
[15]
|
||||
Context=none
|
||||
Type=Fixed
|
||||
Size=15
|
||||
|
||||
[16-22]
|
||||
Context=none
|
||||
Type=Threshold
|
||||
Size=19
|
||||
Threshold=3
|
||||
|
||||
[25+]
|
||||
Context=none
|
||||
Type=Scalable
|
||||
Size=30
|
||||
MinSize=25
|
||||
MaxSize=35
|
||||
|
||||
[35+]
|
||||
Context=none
|
||||
Type=Scalable
|
||||
Size=40
|
||||
MinSize=35
|
||||
MaxSize=1000
|
||||
|
@ -484,6 +484,52 @@ test_builtin (void)
|
||||
assert_icon_lookup_size ("gtk-caps-lock-warning", 30, GTK_ICON_LOOKUP_USE_BUILTIN, NULL, 30);
|
||||
}
|
||||
|
||||
static void
|
||||
test_size (void)
|
||||
{
|
||||
assert_icon_lookup_size ("size-test", 12, 0, "/icons/15/size-test.png", 15);
|
||||
assert_icon_lookup_size ("size-test", 13, 0, "/icons/15/size-test.png", 15);
|
||||
assert_icon_lookup_size ("size-test", 14, 0, "/icons/15/size-test.png", 15);
|
||||
assert_icon_lookup_size ("size-test", 15, 0, "/icons/15/size-test.png", 15);
|
||||
assert_icon_lookup_size ("size-test", 16, 0, "/icons/16-22/size-test.png", 19);
|
||||
assert_icon_lookup_size ("size-test", 17, 0, "/icons/16-22/size-test.png", 19);
|
||||
assert_icon_lookup_size ("size-test", 18, 0, "/icons/16-22/size-test.png", 19);
|
||||
assert_icon_lookup_size ("size-test", 19, 0, "/icons/16-22/size-test.png", 19);
|
||||
//assert_icon_lookup_size ("size-test", 20, 0, "/icons/16-22/size-test.png", 19);
|
||||
//assert_icon_lookup_size ("size-test", 21, 0, "/icons/16-22/size-test.png", 19);
|
||||
//assert_icon_lookup_size ("size-test", 22, 0, "/icons/16-22/size-test.png", 19);
|
||||
assert_icon_lookup_size ("size-test", 23, 0, "/icons/25+/size-test.svg", 23);
|
||||
assert_icon_lookup_size ("size-test", 24, 0, "/icons/25+/size-test.svg", 24);
|
||||
assert_icon_lookup_size ("size-test", 25, 0, "/icons/25+/size-test.svg", 25);
|
||||
assert_icon_lookup_size ("size-test", 28, 0, "/icons/25+/size-test.svg", 28);
|
||||
//assert_icon_lookup_size ("size-test", 31, 0, "/icons/25+/size-test.svg", 31);
|
||||
//assert_icon_lookup_size ("size-test", 34, 0, "/icons/25+/size-test.svg", 34);
|
||||
assert_icon_lookup_size ("size-test", 37, 0, "/icons/35+/size-test.svg", 37);
|
||||
assert_icon_lookup_size ("size-test", 40, 0, "/icons/35+/size-test.svg", 40);
|
||||
assert_icon_lookup_size ("size-test", 45, 0, "/icons/35+/size-test.svg", 45);
|
||||
|
||||
assert_icon_lookup_size ("size-test", 12, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/15/size-test.png", 12);
|
||||
assert_icon_lookup_size ("size-test", 13, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/15/size-test.png", 13);
|
||||
assert_icon_lookup_size ("size-test", 14, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/15/size-test.png", 14);
|
||||
assert_icon_lookup_size ("size-test", 15, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/15/size-test.png", 15);
|
||||
assert_icon_lookup_size ("size-test", 16, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 16);
|
||||
assert_icon_lookup_size ("size-test", 17, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 17);
|
||||
assert_icon_lookup_size ("size-test", 18, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 18);
|
||||
assert_icon_lookup_size ("size-test", 19, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 19);
|
||||
//assert_icon_lookup_size ("size-test", 20, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 20);
|
||||
//assert_icon_lookup_size ("size-test", 21, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 21);
|
||||
//assert_icon_lookup_size ("size-test", 22, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/16-22/size-test.png", 22);
|
||||
assert_icon_lookup_size ("size-test", 23, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 23);
|
||||
assert_icon_lookup_size ("size-test", 24, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 24);
|
||||
assert_icon_lookup_size ("size-test", 25, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 25);
|
||||
assert_icon_lookup_size ("size-test", 28, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 28);
|
||||
//assert_icon_lookup_size ("size-test", 31, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 31);
|
||||
//assert_icon_lookup_size ("size-test", 34, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/25+/size-test.svg", 34);
|
||||
assert_icon_lookup_size ("size-test", 37, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/35+/size-test.svg", 37);
|
||||
assert_icon_lookup_size ("size-test", 40, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/35+/size-test.svg", 40);
|
||||
assert_icon_lookup_size ("size-test", 45, GTK_ICON_LOOKUP_FORCE_SIZE, "/icons/35+/size-test.svg", 45);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -497,6 +543,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/icontheme/rtl", test_rtl);
|
||||
g_test_add_func ("/icontheme/symbolic-single-size", test_symbolic_single_size);
|
||||
g_test_add_func ("/icontheme/svg-size", test_svg_size);
|
||||
g_test_add_func ("/icontheme/size", test_size);
|
||||
g_test_add_func ("/icontheme/builtin", test_builtin);
|
||||
|
||||
return g_test_run();
|
||||
|
Loading…
Reference in New Issue
Block a user