* Benchmarking suite for the PHP-XMLRPC lib.
*
* @author Gaetano Giunta
- * @copyright (c) 2005-2014 G. Giunta
- * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
+ * @copyright (c) 2005-2015 G. Giunta
+ * @license code licensed under the BSD License: see file license.txt
*
* @todo add a test for response ok in call testing
* @todo add support for --help option to give users the list of supported parameters
}
}
-// test 'old style' data encoding vs. 'automatic style' encoding
+// test 'manual style' data encoding vs. 'automatic style' encoding
begin_test('Data encoding (large array)', 'manual encoding');
for ($i = 0; $i < $num_tests; $i++) {
$vals = array();
$response = $dummy->ParseResponse($in, true);
$value = $response->value();
$result = array();
- for ($k = 0; $k < $value->arraysize(); $k++) {
+ foreach($value as $val1) {
+ $out = array();
+ foreach($val1 as $name => $val) {
+ $out[$name] = array();
+ foreach($val as $data) {
+ $out[$name][] = $data->scalarval();
+ }
+ }
+ $result[] = $out;
+ }
+}
+end_test('Data decoding (large array)', 'manual decoding', $result);
+
+begin_test('Data decoding (large array)', 'manual decoding deprecated');
+for ($i = 0; $i < $num_tests; $i++) {
+ $response = $dummy->ParseResponse($in, true);
+ $value = $response->value();
+ $result = array();
+ $l = $value->arraysize();
+ for ($k = 0; $k < $l; $k++) {
$val1 = $value->arraymem($k);
$out = array();
while (list($name, $val) = $val1->structeach()) {
$out[$name] = array();
- for ($j = 0; $j < $val->arraysize(); $j++) {
+ $m = $val->arraysize();
+ for ($j = 0; $j < $m; $j++) {
$data = $val->arraymem($j);
$out[$name][] = $data->scalarval();
}
$result[] = $out;
}
}
-end_test('Data decoding (large array)', 'manual decoding', $result);
+end_test('Data decoding (large array)', 'manual decoding deprecated', $result);
begin_test('Data decoding (large array)', 'automatic decoding');
for ($i = 0; $i < $num_tests; $i++) {