Test case for the [NSRegularExpression pattern] bug

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39961 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
thebeing 2016-07-06 14:59:08 +00:00
parent 3f840271a2
commit e2b8821ef4
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2016-07-06 Niels Grewe <niels.grewe@halbordnung.de>
* Tests/base/NSRegularExpression/basic.m: Test for -pattern
double free.
2016-07-06 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSRegularExpression.m (-pattern): Fix bug where a UText

View file

@ -73,6 +73,14 @@ int main()
test_NSCopying(@"NSRegularExpression",@"NSRegularExpression",
[NSArray arrayWithObject:testObj],NO,NO);
NSAutoreleasePool *iPool = [NSAutoreleasePool new];
{
PASS_EQUAL([testObj pattern], @"^a", "Correct pattern returned");
}
DESTROY(iPool);
/* Regression test: We had a double-free bug on retrieving pattern,
* which is also the reason for wrapping the previous one in an ARP */
PASS_RUNS([testObj pattern], "Calling -pattern twice runs");
/* To test whether we correctly bail out of processing degenerate patterns,
* we spin up a new thread and evaluate an expression there. The expectation