Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'util/integer_to_string_test.cc')
-rw-r--r--util/integer_to_string_test.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/util/integer_to_string_test.cc b/util/integer_to_string_test.cc
index ded1ecec7..d090f64a8 100644
--- a/util/integer_to_string_test.cc
+++ b/util/integer_to_string_test.cc
@@ -21,9 +21,9 @@ template <class T> void TestValue(const T value) {
template <class T> void TestCorners() {
TestValue(std::numeric_limits<T>::min());
TestValue(std::numeric_limits<T>::max());
- TestValue(static_cast<T>(0));
- TestValue(static_cast<T>(-1));
- TestValue(static_cast<T>(1));
+ TestValue((T)0);
+ TestValue((T)-1);
+ TestValue((T)1);
}
BOOST_AUTO_TEST_CASE(Corners) {
@@ -33,6 +33,7 @@ BOOST_AUTO_TEST_CASE(Corners) {
TestCorners<int16_t>();
TestCorners<int32_t>();
TestCorners<int64_t>();
+ TestCorners<const void*>();
}
template <class T> void TestAll() {
@@ -62,4 +63,14 @@ BOOST_AUTO_TEST_CASE(Tens) {
Test10s<int32_t>();
}
+BOOST_AUTO_TEST_CASE(Pointers) {
+ for (uintptr_t i = 1; i < std::numeric_limits<uintptr_t>::max() / 10; i *= 10) {
+ TestValue((const void*)i);
+ }
+ for (uintptr_t i = 0; i < 256; ++i) {
+ TestValue((const void*)i);
+ TestValue((const void*)(i + 0xf00));
+ }
+}
+
}} // namespaces