mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
New file from test13.m.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1374 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ed3e2f3564
commit
4cba542cb1
1 changed files with 45 additions and 0 deletions
45
Testing/prepend.m
Normal file
45
Testing/prepend.m
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
From: Matthias Klose <doko@cs.tu-berlin.de>
|
||||
Date: Mon, 1 Aug 1994 21:17:20 +0200
|
||||
To: mccallum@cs.rochester.edu
|
||||
Subject: bug in libcoll-940725
|
||||
Reply-to: doko@cs.tu-berlin.de
|
||||
|
||||
Hello, the following code core dumps on Solaris 2.3 (compiled with gcc
|
||||
2.5.8 -g -O and with -g) and on NeXTstep 3.2 (gcc 2.5.8).
|
||||
Any hints?
|
||||
*/
|
||||
|
||||
#include <objects/Queue.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
Array *a;
|
||||
CircularArray *c;
|
||||
Queue *q;
|
||||
|
||||
a = [Array new];
|
||||
|
||||
[a prependObject: [NSObject new]];
|
||||
[a prependObject: [NSObject new]];
|
||||
[a prependObject: [NSObject new]];
|
||||
printf("count: %d\n", [a count]);
|
||||
[a insertObject: [NSObject new] atIndex: 2]; // ok!
|
||||
printf("count: %d\n", [a count]);
|
||||
|
||||
c = [CircularArray new];
|
||||
[c prependObject: [NSNumber numberWithInt:3]];
|
||||
[c prependObject: [NSNumber numberWithInt:2]];
|
||||
[c prependObject: [NSNumber numberWithInt:1]];
|
||||
[c insertObject:[NSNumber numberWithInt:0] atIndex:2]; // core dump!
|
||||
|
||||
q = [Queue new];
|
||||
[q enqueueObject: [NSObject new]];
|
||||
[q enqueueObject: [NSObject new]];
|
||||
[q enqueueObject: [NSObject new]];
|
||||
printf("count: %d\n", [q count]);
|
||||
[q insertObject: [NSObject new] atIndex: 2]; // core dump!
|
||||
printf("count: %d\n", [q count]);
|
||||
|
||||
exit (0);
|
||||
}
|
Loading…
Reference in a new issue