diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-21 23:54:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-21 23:54:15 +0000 |
commit | 216791a94d49b9c2142dcb14d7d7ff639b9e2e5b (patch) | |
tree | 5af1781eb56ff157c7e0ff6346b5cbc3b4e152ed /Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp | |
parent | 91c9b5dc1e480401f79c7ea64bd98754e1eab170 (diff) |
dvisvgm-2.1.3
git-svn-id: svn://tug.org/texlive/trunk@43293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp')
-rw-r--r-- | Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp index 8d04483d393..29ffc6f2684 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp @@ -19,23 +19,25 @@ *************************************************************************/ #include <gtest/gtest.h> +#include <sstream> +#include <string> #include "ToUnicodeMap.hpp" using namespace std; +#define CHECK_RANGE(ucmap, min, max, minval) check_range(ucmap, min, max, minval, __LINE__) -static void check_range (const ToUnicodeMap &ucmap, int min, int max, int minval) { - for (int i=min; i <= max; i++) - ASSERT_EQ(ucmap.valueAt(i), minval+(i-min)); +static void check_range (const ToUnicodeMap &ucmap, uint32_t min, uint32_t max, uint32_t minval, int line) { + for (uint32_t i=min; i <= max; i++) + ASSERT_EQ(ucmap.valueAt(i), minval+(i-min)) << __FILE__ << ":" << line << ": i=" << i; } TEST(ToUnicodeMapTest, addMissingMappings1) { ToUnicodeMap ucmap; - bool success = ucmap.addMissingMappings(20); - ASSERT_TRUE(success); + ASSERT_TRUE(ucmap.addMissingMappings(20)); ASSERT_EQ(ucmap.size(), 1); - check_range(ucmap, 1, 20, 1); + CHECK_RANGE(ucmap, 1, 20, 1); } @@ -43,18 +45,15 @@ TEST(ToUnicodeMapTest, addMissingMappings2) { ToUnicodeMap ucmap; ucmap.addRange(5, 8, 40); ASSERT_EQ(ucmap.size(), 1); - check_range(ucmap, 5, 8, 40); + CHECK_RANGE(ucmap, 5, 8, 40); ucmap.addRange(10, 15, 50); ASSERT_EQ(ucmap.size(), 2); - check_range(ucmap, 5, 8, 40); - check_range(ucmap, 10, 15, 50); + CHECK_RANGE(ucmap, 5, 8, 40); + CHECK_RANGE(ucmap, 10, 15, 50); - bool success = ucmap.addMissingMappings(20); - ASSERT_TRUE(success); + ASSERT_TRUE(ucmap.addMissingMappings(20)); ASSERT_EQ(ucmap.size(), 2); - check_range(ucmap, 1, 9, 36); - check_range(ucmap, 10, 20, 50); + CHECK_RANGE(ucmap, 1, 9, 36); + CHECK_RANGE(ucmap, 10, 20, 50); } - - |