diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-10-17 15:56:55 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-10-22 11:53:45 +0200 |
commit | ed31cf9d14ccec13c8956545de03fa3390d74bc8 (patch) | |
tree | e44d1512b892ec88064fdfd4865cc61252018123 /test/util | |
parent | f81f75e4f329e4f24ef3e9339c7ab84921bb6091 (diff) | |
download | qtlocation-mapboxgl-ed31cf9d14ccec13c8956545de03fa3390d74bc8.tar.gz |
[core] add the ability to stringy numbers as hex
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/string.test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/util/string.test.cpp b/test/util/string.test.cpp index 08e8e9f759..91e1b93685 100644 --- a/test/util/string.test.cpp +++ b/test/util/string.test.cpp @@ -2,6 +2,8 @@ #include <mbgl/util/string.hpp> +#include <cstdint> + using namespace mbgl; TEST(ToString, FloatingPoint) { @@ -16,3 +18,12 @@ TEST(ToString, FloatingPoint) { EXPECT_EQ("12340000000", util::toString(12340000000.0)); EXPECT_EQ("12340000000.0", util::toString(12340000000.0, true)); } + +TEST(ToHex, SIZE_T) { +#if INTPTR_MAX == INT32_MAX + EXPECT_EQ("a715b247", util::toHex((size_t)0xa715b247)); +#elif INTPTR_MAX == INT64_MAX + EXPECT_EQ("a715b247df38cc29", util::toHex((size_t)0xa715b247df38cc29)); +#endif + +} |