Sfoglia il codice sorgente

test: make all compilers happy again

Michele Caini 2 anni fa
parent
commit
9fbd167bd0
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      test/entt/core/algorithm.cpp

+ 6 - 6
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);
     }
 }