diff --git a/test/entt/core/algorithm.cpp b/test/entt/core/algorithm.cpp index 04ca1fbbc..a951559b3 100644 --- a/test/entt/core/algorithm.cpp +++ b/test/entt/core/algorithm.cpp @@ -12,7 +12,7 @@ TEST(Algorithm, StdSort) { sort(arr.begin(), arr.end()); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_LT(*it, *(it + 1u)); } } @@ -26,7 +26,7 @@ TEST(Algorithm, StdSortBoxedInt) { return lhs.value > rhs.value; }); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_GT(it->value, (it + 1u)->value); } } @@ -37,7 +37,7 @@ TEST(Algorithm, InsertionSort) { sort(arr.begin(), arr.end()); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_LT(*it, *(it + 1u)); } } @@ -50,7 +50,7 @@ TEST(Algorithm, InsertionSortBoxedInt) { return lhs.value > rhs.value; }); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_GT(it->value, (it + 1u)->value); } } @@ -70,7 +70,7 @@ TEST(Algorithm, RadixSort) { return value; }); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_LT(*it, *(it + 1u)); } } @@ -83,7 +83,7 @@ TEST(Algorithm, RadixSortBoxedInt) { return instance.value; }); - for(auto it = arr.begin(), last = --arr.end(); it != last; ++it) { + for(auto it = arr.begin(), last = (arr.end() - 1u); it != last; ++it) { ASSERT_GT(it->value, (it + 1u)->value); } }