|
@@ -293,6 +293,14 @@ static void testOutOfMemory() {
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+static void testOverflow() {
|
|
|
+ IntList list;
|
|
|
+ for(int i = 0; i < CORE_INT_MAX; i++) {
|
|
|
+ CORE_TEST_ERROR(list.add(i));
|
|
|
+ }
|
|
|
+ CORE_TEST_EQUAL(Core::Error::CAPACITY_REACHED, list.add(1));
|
|
|
+}
|
|
|
+
|
|
|
void Core::testLinkedList(bool light, bool outOfMemoryTest) {
|
|
|
testWithoutCopyOrMove();
|
|
|
testAdd();
|
|
@@ -311,4 +319,5 @@ void Core::testLinkedList(bool light, bool outOfMemoryTest) {
|
|
|
if(outOfMemoryTest) {
|
|
|
testOutOfMemory();
|
|
|
}
|
|
|
+ testOverflow();
|
|
|
}
|