Re: [PHP-DEV] First test submission and comment correction

2009-05-17 Thread Christopher Jones



Simon Westcott wrote:

Thanks for accepting and the feedback.

Following on from the successful NorthWestUG testfest, I'm continuing to 
focus on SPL and currently have 24 tests  awaiting review in the 
testfest SVN repo (with the CREDITS section :) ).  Once this repo is 
shutdown (in June?) I'd like to find out more about test review process 
with the view to applying for a CVS account.


That's really excellent.

Do you think you'll start to look at PHP bugs too?

Chris



Also, thanks to Pierre for answering some zend_parse_parameters 
questions the other night.



--
Email: christopher.jo...@oracle.com
Twitter:  http://twitter.com/ghrd

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] First test submission and comment correction

2009-05-16 Thread Simon Westcott


Christopher Jones wrote:

Hi Simon,

Welcome!

I've merged these for you.  I added an exit() block to the test.  See
the Last bit section in http://qa.php.net/write-test.php

Let us know if you have any questions or if there's anyway we can help
you.  What parts of PHP are you looking at now?

Chris


Hi Chris,

Thanks for accepting and the feedback.

Following on from the successful NorthWestUG testfest, I'm continuing to 
focus on SPL and currently have 24 tests  awaiting review in the 
testfest SVN repo (with the CREDITS section :) ).  Once this repo is 
shutdown (in June?) I'd like to find out more about test review process 
with the view to applying for a CVS account.


Also, thanks to Pierre for answering some zend_parse_parameters 
questions the other night.


Regards,
Simon Westcott

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] First test submission and comment correction

2009-05-15 Thread Christopher Jones



Simon Westcott wrote:

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.



Hi Simon,

Welcome!

I've merged these for you.  I added an exit() block to the test.  See
the Last bit section in http://qa.php.net/write-test.php

Let us know if you have any questions or if there's anyway we can help
you.  What parts of PHP are you looking at now?

Chris




Test:

$ cat ext/standard/tests/array/array_multisort_variation11.phpt
--TEST--
Test array_multisort() function : usage variation - testing with empty 
array

--FILE--
?php
/* Prototype  : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, 
SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, 
SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...])
 * Description: Sort multiple arrays at once similar to how ORDER BY 
clause works in SQL

 * Source code: ext/standard/array.c
 * Alias to functions:
 */

echo *** Testing array_multisort() : Testing with empty array ***\n;

var_dump(array_multisort(array()));

?
===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.c13 Feb 2009 22:34:15 - 
1.308.2.21.2.37.2.53

+++ ext/standard/array.c5 May 2009 22:56:53 -
@@ -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



--
Email: christopher.jo...@oracle.com
Twitter:  http://twitter.com/ghrd

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php