Revert "one more time."

This reverts commit 8dea549887.

Revert "fix following up 8c4fa25c8d65e75978c0a82bc6391906595ff190"

This reverts commit 8726312393.

Revert "attempt to fix "error: chosen constructor is explicit in copy-initialization" error with gcc"

This reverts commit 8c4fa25c8d.

Revert "use `initializer_list const&` to hold expected values (via @lighmare) ref #3636"

This reverts commit 47763afef3.
This commit is contained in:
artemp 2017-03-07 14:08:04 +01:00
parent 8dea549887
commit 791f7b51bb

View file

@ -7,8 +7,7 @@
namespace {
void test_shaping( mapnik::font_set const& fontset, mapnik::face_manager& fm,
std::vector<std::tuple<unsigned, unsigned>> expected,
char const* str, bool debug = false)
std::vector<std::pair<unsigned, unsigned>> const& expected, char const* str, bool debug = false)
{
mapnik::transcoder tr("utf8");
std::map<unsigned,double> width_map;
@ -66,8 +65,8 @@ TEST_CASE("shaping")
mapnik::face_manager fm(fl, font_file_mapping, font_memory_cache);
{
auto expected =
{std::tuple<unsigned, unsigned>(0, 0), {0, 3}, {0, 4}, {0, 7}, {3, 8}, {11, 9}, {68, 10}, {69, 11}, {70, 12}, {12, 13}};
std::vector<std::pair<unsigned, unsigned>> expected =
{{0, 0}, {0, 3}, {0, 4}, {0, 7}, {3, 8}, {11, 9}, {68, 10}, {69, 11}, {70, 12}, {12, 13}};
// with default NotoSans-Regular.ttc and NotoNaskhArabic-Regular.ttf ^^^
//std::vector<std::pair<unsigned, unsigned>> expected =
// {{977,0}, {1094,3}, {1038,4}, {1168,4}, {9,7}, {3,8}, {11,9}, {68,10}, {69,11}, {70,12}, {12,13}};
@ -76,29 +75,29 @@ TEST_CASE("shaping")
}
{
auto expected =
{std::tuple<unsigned, unsigned>(0, 0), {0, 3}, {0, 4}, {0, 7}, {3, 8}, {11, 9}, {0, 10}, {0, 11}, {0, 12}, {12, 13}};
std::vector<std::pair<unsigned, unsigned>> expected =
{{0, 0}, {0, 3}, {0, 4}, {0, 7}, {3, 8}, {11, 9}, {0, 10}, {0, 11}, {0, 12}, {12, 13}};
test_shaping(fontset, fm, expected, u8"སྤུ་ཧྲེང (普兰镇)");
}
{
auto expected =
{std::tuple<unsigned, unsigned>(68, 0), {69, 1}, {70, 2}, {3, 3}, {11, 4}, {0, 5}, {0, 6}, {0, 7}, {12, 8}};
std::vector<std::pair<unsigned, unsigned>> expected =
{{68, 0}, {69, 1}, {70, 2}, {3, 3}, {11, 4}, {0, 5}, {0, 6}, {0, 7}, {12, 8}};
test_shaping(fontset, fm, expected, u8"abc (普兰镇)");
}
{
auto expected =
{std::tuple<unsigned, unsigned>(68, 0), {69, 1}, {70, 2}, {3, 3}, {11, 4}, {68, 5}, {69, 6}, {70, 7}, {12, 8}};
std::vector<std::pair<unsigned, unsigned>> expected =
{{68, 0}, {69, 1}, {70, 2}, {3, 3}, {11, 4}, {68, 5}, {69, 6}, {70, 7}, {12, 8}};
test_shaping(fontset, fm, expected, "abc (abc)");
}
{
// "ⵃⴰⵢ ⵚⵉⵏⴰⵄⵉ الحي الصناعي"
auto expected =
{std::tuple<unsigned, unsigned>(0, 0), {0, 1}, {0, 2}, {3, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7},
{0, 8}, {0, 9}, {3, 10}, {509, 22}, {481, 21}, {438, 20}, {503, 19},
{470, 18}, {496, 17}, {43, 16}, {3, 15}, {509, 14}, {454, 13}, {496, 12}, {43, 11}};
std::vector<std::pair<unsigned, unsigned>> expected =
{{0, 0}, {0, 1}, {0, 2}, {3, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7},
{0, 8}, {0, 9}, {3, 10}, {509, 22}, {481, 21}, {438, 20}, {503, 19},
{470, 18}, {496, 17}, {43, 16}, {3, 15}, {509, 14}, {454, 13}, {496, 12}, {43, 11}};
test_shaping(fontset, fm, expected, u8"ⵃⴰⵢ ⵚⵉⵏⴰⵄⵉ الحي الصناعي");
}