NSPointerArray: Implement fast enumeration (#477)

* NSPointerArray: Implement NSFastEnumeration

* NSPointerArray: Test for duplicate values in array

* NSPointerArray: Fast enumeration tests
This commit is contained in:
Hugo Melder 2024-12-13 03:01:07 -08:00 committed by GitHub
parent 4a4a802060
commit 4b3bd1aa90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 89 additions and 2 deletions

View file

@ -27,11 +27,13 @@ int main()
PASS([obj count] == 1, "+addPointer: increments count");
[obj addPointer: nil];
PASS([obj count] == 2, "+addPointer: works with nil");
[obj addPointer: nil];
PASS([obj count] == 3, "+addPointer: respects duplicate values");
[obj insertPointer: (void*)vals[0] atIndex: 0];
[obj insertPointer: (void*)vals[1] atIndex: 0];
[obj insertPointer: (void*)vals[2] atIndex: 0];
PASS([obj count] == 5 && [obj pointerAtIndex: 2] == (void*)vals[0],
PASS([obj count] == 6 && [obj pointerAtIndex: 2] == (void*)vals[0],
"+insertPointer:atIndex: works");
LEAVE_POOL