[libgee] Skip first and last element during counting down indices in remove test



commit 0646669c592a9d31534c813578bf36aed2681f38
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Fri Feb 21 02:41:48 2014 +0100

    Skip first and last element during counting down indices in remove test

 tests/testlist.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/tests/testlist.vala b/tests/testlist.vala
index 54a7503..1873dfc 100644
--- a/tests/testlist.vala
+++ b/tests/testlist.vala
@@ -349,11 +349,15 @@ public abstract class ListTests : CollectionTests {
                for (uint i = 0; i < idx.length; i++) {
                        int to_remove = (int)idx[i] - 1;
                        if (idx[i] == data.length - 1 || idx[i] == 0) {
-                               // Removing last or first element, which was already removed
+                               // Skip last or first element, which was already removed
                                continue;
                        }
                        for (uint j = 0; j < i; j++) {
                                if (idx[j] < idx[i]) {
+                                       if (idx[j] == data.length - 1 || idx[j] == 0) {
+                                               // Last and first element were not removed
+                                               continue;
+                                       }
                                        to_remove--;
                                }
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]