Author: thebeing
Date: Wed Jul  6 16:59:08 2016
New Revision: 39961

URL: http://svn.gna.org/viewcvs/gnustep?rev=39961&view=rev
Log:
Test case for the [NSRegularExpression pattern] bug

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Tests/base/NSRegularExpression/basic.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39961&r1=39960&r2=39961&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Wed Jul  6 16:59:08 2016
@@ -1,3 +1,8 @@
+2016-07-06  Niels Grewe <[email protected]>
+
+       * Tests/base/NSRegularExpression/basic.m: Test for -pattern
+       double free.
+
 2016-07-06  Wolfgang Lux  <[email protected]>
 
        * Source/NSRegularExpression.m (-pattern): Fix bug where a UText

Modified: libs/base/trunk/Tests/base/NSRegularExpression/basic.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tests/base/NSRegularExpression/basic.m?rev=39961&r1=39960&r2=39961&view=diff
==============================================================================
--- libs/base/trunk/Tests/base/NSRegularExpression/basic.m      (original)
+++ libs/base/trunk/Tests/base/NSRegularExpression/basic.m      Wed Jul  6 
16:59:08 2016
@@ -73,6 +73,14 @@
   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


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to