Annotation of embedaddon/php/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test vfprintf() function : basic functionality - unsigned format
3: --SKIPIF--
4: <?php
5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6: ?>
7: --FILE--
8: <?php
9: /* Prototype : int vfprintf ( resource $handle , string $format , array $args )
10: * Description: Write a formatted string to a stream
11: * Source code: ext/standard/formatted_print.c
12: */
13:
14: echo "*** Testing vfprintf() : basic functionality - using unsigned format ***\n";
15:
16: // Initialise all required variables
17: $format = "format";
18: $format1 = "%u";
19: $format2 = "%u %u";
20: $format3 = "%u %u %u";
21: $arg1 = array(-1111);
22: $arg2 = array(-1111,-1234567);
23: $arg3 = array(-1111,-1234567,-2345432);
24:
25: /* creating dumping file */
26: $data_file = dirname(__FILE__) . '/dump.txt';
27: if (!($fp = fopen($data_file, 'wt')))
28: return;
29:
30: vfprintf($fp, $format1,$arg1);
31: fprintf($fp, "\n");
32:
33: vfprintf($fp, $format2,$arg2);
34: fprintf($fp, "\n");
35:
36: vfprintf($fp, $format3,$arg3);
37: fprintf($fp, "\n");
38:
39: fclose($fp);
40: print_r(file_get_contents($data_file));
41:
42: unlink($data_file);
43:
44: ?>
45: ===DONE===
46: --EXPECT--
47: *** Testing vfprintf() : basic functionality - using unsigned format ***
48: 18446744073709550505
49: 18446744073709550505 18446744073708317049
50: 18446744073709550505 18446744073708317049 18446744073707206184
51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>