Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43854 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66549 invoked from network); 5 May 2009 23:45:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2009 23:45:25 -0000 Received: from [127.0.0.1] ([127.0.0.1:28260]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 63/2A-54546-49FC00A4 for ; Tue, 05 May 2009 19:45:24 -0400 X-Host-Fingerprint: 86.158.141.169 host86-158-141-169.range86-158.btcentralplus.com Received: from [86.158.141.169] ([86.158.141.169:26503] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/2A-54546-ECEC00A4 for ; Tue, 05 May 2009 19:42:07 -0400 Message-ID: <10.2A.54546.ECEC00A4@pb1.pair.com> To: internals@lists.php.net Date: Wed, 06 May 2009 00:41:59 +0100 User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 86.158.141.169 Subject: First test submission and comment correction From: swestcott@gmail.com (Simon Westcott) Hi, I've just started to explore PHP's tests, reading through the docs on qa.php.net, the wiki and a few blogs. Having gotten to a position where I can run the tests and produce coverage reports I have my first (simple) submission. It covers an edge case for array_multisort when an empty array is provided. Test: $ cat ext/standard/tests/array/array_multisort_variation11.phpt --TEST-- Test array_multisort() function : usage variation - testing with empty array --FILE-- ===DONE=== --EXPECTF-- *** Testing array_multisort() : Testing with empty array *** bool(true) ===DONE=== Whilst producing this simple test I spotted a mistake in a related comment which appears to originate from bug 24897. A patch against PHP-5.3 follows, Index: ext/standard/array.c =================================================================== RCS file: /repository/php-src/ext/standard/array.c,v retrieving revision 1.308.2.21.2.37.2.53 diff -u -r1.308.2.21.2.37.2.53 array.c --- ext/standard/array.c 13 Feb 2009 22:34:15 -0000 1.308.2.21.2.37.2.53 +++ ext/standard/array.c 5 May 2009 22:56:53 -0000 @@ -3789,7 +3789,7 @@ } } - /* If all arrays are empty or have only one entry, we don't need to do anything. */ + /* If all arrays are empty we don't need to do anything. */ if (array_size < 1) { for (k = 0; k < MULTISORT_LAST; k++) { efree(ARRAYG(multisort_flags)[k]); I appreciate this a trivial stuff, but any constructive feedback is welcome. Regards, Simon Westcott