Kajetan Johannes Hammerle 7 місяців тому
батько
коміт
62fb3363c9
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      test/modules/ArrayListTests.cpp

+ 6 - 0
test/modules/ArrayListTests.cpp

@@ -136,6 +136,12 @@ static void testRemove() {
     CORE_TEST_EQUAL(2, list[0]);
     CORE_TEST_EQUAL(3, list[1]);
     CORE_TEST_EQUAL(2, list.getLength());
+    CORE_TEST_EQUAL(Core::Error::INVALID_INDEX, list.removeBySwap(4));
+    CORE_TEST_EQUAL(Core::Error::INVALID_INDEX, list.removeBySwap(-1));
+    CORE_TEST_EQUAL(Core::Error::INVALID_INDEX, list.removeBySwap(-5));
+    CORE_TEST_EQUAL(2, list[0]);
+    CORE_TEST_EQUAL(3, list[1]);
+    CORE_TEST_EQUAL(2, list.getLength());
     CORE_TEST_ERROR(list.removeBySwap(1));
     CORE_TEST_EQUAL(2, list[0]);
     CORE_TEST_EQUAL(1, list.getLength());