rebase draw test as recent roundf changes

This commit is contained in:
Ebrahim Byagowi 2020-06-28 14:31:21 +04:30
parent cb7fb3cf4a
commit 831b090001
1 changed files with 73 additions and 72 deletions

View File

@ -433,14 +433,12 @@ test_hb_draw_font_kit_glyphs_tests (void)
/* should get a path for the glyph */ /* should get a path for the glyph */
user_data.consumed = 0; user_data.consumed = 0;
g_assert (hb_font_draw_glyph (font, 171, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, 171, funcs, &user_data));
char expected2[] = "M639,-20Q396,-20 256,128Q115,276 115,539Q115,804 246,960" char expected2[] = "M639,-20Q396,-20 256,128Q115,276 115,539Q115,804 246,960Q376,1116 596,1116"
"Q376,1116 596,1116Q802,1116 922,981Q1042,845 1042,623" "Q802,1116 922,981Q1042,845 1042,623L1042,518L287,518Q292,325 385,225"
"L1042,518L287,518Q292,325 385,225Q477,125 645,125" "Q477,125 645,125Q822,125 995,199L995,51Q907,13 829,-3Q750,-20 639,-20Z"
"Q822,125 995,199L995,51Q907,13 829,-4Q750,-20 639,-20Z" "M594,977Q462,977 384,891Q305,805 291,653L864,653Q864,810 794,894"
"M594,977Q462,977 384,891Q305,805 291,653L864,653" "Q724,977 594,977ZM471,1266Q519,1328 575,1416Q630,1504 662,1569"
"Q864,810 794,894Q724,977 594,977ZM471,1266Q519,1328 575,1416" "L864,1569L864,1548Q820,1483 733,1388Q646,1293 582,1241L471,1241L471,1266Z";
"Q630,1504 662,1569L864,1569L864,1548Q820,1483 733,1388"
"Q646,1293 582,1241L471,1241L471,1266Z";
g_assert_cmpmem (str, user_data.consumed, expected2, sizeof (expected2) - 1); g_assert_cmpmem (str, user_data.consumed, expected2, sizeof (expected2) - 1);
hb_font_destroy (font); hb_font_destroy (font);
@ -462,17 +460,16 @@ test_hb_draw_font_kit_glyphs_tests (void)
user_data.consumed = 0; user_data.consumed = 0;
g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data));
char expected[] = "M581,274L443,274Q409,274 384,259Q359,243 348,219Q336,194 340,166" char expected[] = "M581,274L443,274Q409,274 384,259Q359,243 348,219Q336,194 340,166"
"Q343,138 365,111L468,-13Q470,-10 473,-7Q475,-3 477,0L253,0" "Q343,138 365,111L468,-13Q470,-10 473,-6Q475,-3 477,0L253,0Q225,0 203,8"
"Q225,0 203,8Q180,15 168,32Q155,48 155,73L155,269L50,269L50,73" "Q180,15 168,32Q155,48 155,73L155,269L50,269L50,73Q50,24 69,-10"
"Q50,24 69,-10Q88,-44 118,-65Q147,-85 181,-95Q214,-104 243,-104" "Q88,-44 118,-64Q147,-85 181,-94Q214,-104 243,-104L473,-104"
"L473,-104Q501,-104 525,-91Q549,-78 564,-56Q578,-34 578,-8" "Q501,-104 525,-91Q549,-78 564,-56Q578,-34 578,-8Q578,18 557,43"
"Q578,18 557,43L442,182Q439,179 437,176Q435,173 432,170" "L442,182Q439,179 437,176Q435,173 432,170L581,170L581,274ZM184,-194"
"L581,170L581,274ZM184,-194Q184,-216 199,-231Q214,-246 236,-246" "Q184,-216 199,-231Q214,-246 236,-246Q258,-246 273,-231Q288,-216 288,-194"
"Q258,-246 273,-231Q288,-216 288,-194Q288,-172 273,-157" "Q288,-172 273,-157Q258,-142 236,-142Q214,-142 199,-157Q184,-172 184,-194Z"
"Q258,-142 236,-142Q214,-142 199,-157Q184,-172 184,-194Z" "M360,-194Q360,-216 375,-231Q390,-246 412,-246Q434,-246 449,-231"
"M360,-194Q360,-216 375,-231Q390,-246 412,-246" "Q464,-216 464,-194Q464,-172 449,-157Q434,-142 412,-142"
"Q434,-246 449,-231Q464,-216 464,-194Q464,-172 449,-157" "Q390,-142 375,-157Q360,-172 360,-194Z";
"Q434,-142 412,-142Q390,-142 375,-157Q360,-172 360,-194Z";
g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1); g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1);
/* should transform points of a composite glyph */ /* should transform points of a composite glyph */
@ -554,15 +551,16 @@ test_hb_draw_font_kit_variations_tests (void)
user_data.consumed = 0; user_data.consumed = 0;
g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data));
char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102Q796,-102 755,-98" char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102"
"L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504L414,504L414,-102" "Q796,-102 755,-98L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504"
"L371,-102ZM203,-94Q138,-94 86,-90L74,-52Q137,-59 188,-59Q211,-59 222,-47" "L414,504L414,-102L371,-102ZM203,-94Q138,-94 86,-90L74,-52"
"Q233,-34 236,12Q238,58 240,135Q242,211 242,262L74,262L94,527L242,527" "Q137,-59 188,-59Q211,-59 222,-46Q233,-34 236,12Q238,58 240,135"
"L242,719L63,719L63,754L285,754L285,492L133,492L117,297L285,297" "Q242,211 242,262L74,262L94,527L242,527L242,719L63,719L63,754"
"Q285,241 284,185Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86" "L285,754L285,492L133,492L117,297L285,297Q285,241 284,185"
"Q223,-94 203,-94ZM461,12L434,43Q473,73 503,115Q478,150 441,188L469,211" "Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86Q223,-94 203,-94Z"
"Q501,179 525,147Q538,172 559,230L594,211Q571,152 551,117Q577,84 602,43" "M461,12L434,43Q473,73 503,115Q478,150 441,188L469,211Q501,179 525,147"
"L566,20Q544,64 528,86Q500,44 461,12ZM465,258L438,285Q474,316 501,351" "Q538,172 559,230L594,211Q571,152 551,117Q577,84 602,43L566,20"
"Q544,64 528,86Q500,44 461,12ZM465,258L438,285Q474,316 501,351"
"Q474,388 445,418L473,441Q500,414 523,381Q546,413 563,453L598,434" "Q474,388 445,418L473,441Q500,414 523,381Q546,413 563,453L598,434"
"Q571,382 549,352Q576,320 598,285L563,262Q546,294 525,322Q491,280 465,258Z" "Q571,382 549,352Q576,320 598,285L563,262Q546,294 525,322Q491,280 465,258Z"
"M707,12L680,43Q717,68 753,115Q731,147 691,188L719,211Q739,190 754,172" "M707,12L680,43Q717,68 753,115Q731,147 691,188L719,211Q739,190 754,172"
@ -600,23 +598,23 @@ test_hb_draw_font_kit_variations_tests (void)
g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data));
char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102Q796,-102 755,-98" char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102Q796,-102 755,-98"
"L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504L414,504L414,-102" "L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504L414,504L414,-102"
"L371,-102ZM203,-94Q138,-94 86,-90L74,-52Q137,-59 188,-59Q211,-59 222,-47" "L371,-102ZM203,-94Q138,-94 86,-90L74,-52Q137,-59 188,-59Q211,-59 222,-46"
"Q233,-34 236,12Q238,58 240,135Q242,211 242,262L74,262L94,527L242,527" "Q233,-34 236,12Q238,58 240,135Q242,211 242,262L74,262L94,527L242,527"
"L242,719L63,719L63,754L285,754L285,492L133,492L117,297L285,297" "L242,719L63,719L63,754L285,754L285,492L133,492L117,297L285,297"
"Q285,241 284,185Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86" "Q285,241 284,185Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86Q223,-94 203,-94Z"
"Q223,-94 203,-94ZM461,12L434,43Q473,73 503,115Q478,150 441,188" "M461,12L434,43Q473,73 503,115Q478,150 441,188L469,211Q501,179 525,147"
"L469,211Q501,179 525,147Q538,172 559,230L594,211Q571,152 551,117" "Q538,172 559,230L594,211Q571,152 551,117Q577,84 602,43L566,20"
"Q577,84 602,43L566,20Q544,64 528,86Q500,44 461,12ZM465,258L438,285" "Q544,64 528,86Q500,44 461,12ZM465,258L438,285Q474,316 501,351"
"Q474,316 501,351Q474,388 445,418L473,441Q500,414 523,381Q546,413 563,453" "Q474,388 445,418L473,441Q500,414 523,381Q546,413 563,453L598,434"
"L598,434Q571,382 549,352Q576,320 598,285L563,262Q546,294 525,322" "Q571,382 549,352Q576,320 598,285L563,262Q546,294 525,322Q491,280 465,258Z"
"Q491,280 465,258ZM707,12L680,43Q717,68 753,115Q731,147 691,188L719,211" "M707,12L680,43Q717,68 753,115Q731,147 691,188L719,211Q739,190 754,172"
"Q739,190 754,172Q769,154 774,147Q793,185 809,230L844,211Q822,155 801,117" "Q769,154 774,147Q793,185 809,230L844,211Q822,155 801,117Q828,82 852,43L820,20"
"Q828,82 852,43L820,20Q798,58 778,87Q747,43 707,12ZM621,-94L621,730L664,730" "Q798,58 778,87Q747,43 707,12ZM621,-94L621,730L664,730L664,-94L621,-94ZM348,570"
"L664,-94L621,-94ZM348,570L324,605Q425,629 527,688L555,656Q491,621 439,601" "L324,605Q425,629 527,688L555,656Q491,621 439,601Q386,581 348,570ZM715,258L688,285"
"Q386,581 348,570ZM715,258L688,285Q727,318 753,351Q733,378 695,418L723,441" "Q727,318 753,351Q733,378 695,418L723,441Q754,410 775,381Q794,407 813,453"
"Q754,410 775,381Q794,407 813,453L848,434Q826,387 801,352Q823,321 848,281" "L848,434Q826,387 801,352Q823,321 848,281L813,262Q791,301 775,323Q749,288 715,258Z"
"L813,262Q791,301 775,323Q749,288 715,258ZM348,719L348,754L941,754L941,719" "M348,719L348,754L941,754L941,719L348,719ZM936,570Q870,602 817,622"
"L348,719ZM936,570Q870,602 817,622Q764,641 727,652L749,688Q852,655 957,605L936,570Z"; "Q764,641 727,652L749,688Q852,655 957,605L936,570Z";
g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1); g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1);
hb_font_destroy (font); hb_font_destroy (font);
@ -644,23 +642,23 @@ test_hb_draw_font_kit_variations_tests (void)
g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, codepoint, funcs, &user_data));
char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102Q796,-102 755,-98" char expected[] = "M371,-102L371,539L914,539L914,-27Q914,-102 840,-102Q796,-102 755,-98"
"L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504L414,504L414,-102" "L742,-59Q790,-66 836,-66Q871,-66 871,-31L871,504L414,504L414,-102"
"L371,-102ZM203,-94Q138,-94 86,-90L74,-52Q137,-59 188,-59Q211,-59 222,-47" "L371,-102ZM203,-94Q138,-94 86,-90L74,-52Q137,-59 188,-59Q211,-59 222,-46"
"Q233,-34 236,12Q238,58 240,135Q242,211 242,262L74,262L94,527L242,527" "Q233,-34 236,12Q238,58 240,135Q242,211 242,262L74,262L94,527L242,527L242,719"
"L242,719L63,719L63,754L285,754L285,492L133,492L117,297L285,297" "L63,719L63,754L285,754L285,492L133,492L117,297L285,297Q285,241 284,185"
"Q285,241 284,185Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86" "Q284,104 281,46Q278,-20 269,-49Q260,-78 242,-86Q223,-94 203,-94ZM461,12"
"Q223,-94 203,-94ZM461,12L434,43Q473,73 503,115Q478,150 441,188" "L434,43Q473,73 503,115Q478,150 441,188L469,211Q501,179 525,147"
"L469,211Q501,179 525,147Q538,172 559,230L594,211Q571,152 551,117" "Q538,172 559,230L594,211Q571,152 551,117Q577,84 602,43L566,20Q544,64 528,86"
"Q577,84 602,43L566,20Q544,64 528,86Q500,44 461,12ZM465,258L438,285" "Q500,44 461,12ZM465,258L438,285Q474,316 501,351Q474,388 445,418L473,441"
"Q474,316 501,351Q474,388 445,418L473,441Q500,414 523,381Q546,413 563,453" "Q500,414 523,381Q546,413 563,453L598,434Q571,382 549,352Q576,320 598,285"
"L598,434Q571,382 549,352Q576,320 598,285L563,262Q546,294 525,322" "L563,262Q546,294 525,322Q491,280 465,258ZM707,12L680,43Q717,68 753,115"
"Q491,280 465,258ZM707,12L680,43Q717,68 753,115Q731,147 691,188L719,211" "Q731,147 691,188L719,211Q739,190 754,172Q769,154 774,147Q793,185 809,230"
"Q739,190 754,172Q769,154 774,147Q793,185 809,230L844,211Q822,155 801,117" "L844,211Q822,155 801,117Q828,82 852,43L820,20Q798,58 778,87Q747,43 707,12Z"
"Q828,82 852,43L820,20Q798,58 778,87Q747,43 707,12ZM621,-94L621,730L664,730" "M621,-94L621,730L664,730L664,-94L621,-94ZM348,570L324,605Q425,629 527,688"
"L664,-94L621,-94ZM348,570L324,605Q425,629 527,688L555,656Q491,621 439,601" "L555,656Q491,621 439,601Q386,581 348,570ZM715,258L688,285Q727,318 753,351"
"Q386,581 348,570ZM715,258L688,285Q727,318 753,351Q733,378 695,418L723,441" "Q733,378 695,418L723,441Q754,410 775,381Q794,407 813,453L848,434Q826,387 801,352"
"Q754,410 775,381Q794,407 813,453L848,434Q826,387 801,352Q823,321 848,281" "Q823,321 848,281L813,262Q791,301 775,323Q749,288 715,258ZM348,719L348,754"
"L813,262Q791,301 775,323Q749,288 715,258ZM348,719L348,754L941,754L941,719" "L941,754L941,719L348,719ZM936,570Q870,602 817,622"
"L348,719ZM936,570Q870,602 817,622Q764,641 727,652L749,688Q852,655 957,605L936,570Z"; "Q764,641 727,652L749,688Q852,655 957,605L936,570Z";
g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1); g_assert_cmpmem (str, user_data.consumed, expected, sizeof (expected) - 1);
hb_font_destroy (font); hb_font_destroy (font);
@ -784,18 +782,21 @@ test_hb_draw_estedad_vf (void)
user_data.consumed = 0; user_data.consumed = 0;
g_assert (hb_font_draw_glyph (font, 180, funcs, &user_data)); g_assert (hb_font_draw_glyph (font, 180, funcs, &user_data));
/* Skip empty path where all the points of a path are equal */ /* Skip empty path where all the points of a path are equal */
char expected2[] = "M120,693Q120,545 177,414Q233,282 333,182Q433,81 567,24Q701,-33 855,-33" char expected2[] = "M120,693Q120,545 177,414Q233,282 333,182Q433,81 567,24"
"Q1010,-33 1144,24Q1277,81 1377,182Q1477,282 1534,414Q1590,545 1590,693" "Q701,-33 856,-33Q1010,-33 1144,24Q1277,81 1377,182Q1477,282 1534,414"
"Q1590,842 1534,973Q1477,1104 1377,1205Q1277,1305 1144,1362Q1010,1419 855,1419" "Q1590,545 1590,693Q1590,842 1534,973Q1477,1104 1377,1205"
"Q701,1419 567,1362Q433,1305 333,1205Q233,1104 177,973Q120,842 120,693ZM220,693" "Q1277,1305 1144,1362Q1010,1419 856,1419Q701,1419 567,1362"
"Q220,828 270,945Q320,1061 409,1148Q497,1235 612,1284Q726,1333 855,1333" "Q433,1305 333,1205Q233,1104 177,973Q120,842 120,693Z"
"Q984,1333 1099,1284Q1213,1235 1302,1148Q1390,1061 1440,945Q1490,828 1490,693" "M220,693Q220,828 270,945Q320,1061 409,1148Q497,1235 612,1284"
"Q1490,558 1440,442Q1390,325 1302,237Q1213,149 1099,100Q984,51 855,51" "Q726,1333 855,1333Q984,1333 1099,1284Q1213,1235 1302,1148"
"Q726,51 612,100Q497,149 409,237Q320,325 270,442Q220,558 220,693ZM690,643" "Q1390,1061 1440,945Q1490,828 1490,693Q1490,558 1440,442"
"L690,997L886,997Q970,997 1029,949Q1087,901 1087,819Q1087,737 1028,690" "Q1390,325 1302,237Q1213,149 1099,100Q984,51 855,51"
"Q969,643 886,643L690,643ZM1165,334L973,568Q1065,591 1126,658Q1187,725 1187,819" "Q726,51 612,100Q497,149 409,237Q320,325 270,442"
"Q1187,896 1147,956Q1106,1015 1038,1049Q969,1083 886,1083L590,1083L590,310" "Q220,558 220,693ZM690,643L690,997L886,997Q970,997 1029,949"
"L690,310L690,557L860,557L1083,286L1165,334Z"; "Q1087,901 1087,819Q1087,737 1028,690Q969,643 886,643L690,643Z"
"M1165,334L973,568Q1065,591 1126,658Q1187,725 1187,819"
"Q1187,896 1147,956Q1106,1015 1038,1049Q969,1083 886,1083"
"L590,1083L590,310L690,310L690,557L860,557L1083,286L1165,334Z";
g_assert_cmpmem (str, user_data.consumed, expected2, sizeof (expected2) - 1); g_assert_cmpmem (str, user_data.consumed, expected2, sizeof (expected2) - 1);
user_data.consumed = 0; user_data.consumed = 0;