Annotation of embedaddon/php/ext/standard/tests/strings/crc32_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test crc32() function : error conditions
3: --SKIPIF--
4: <?php
5: if (PHP_INT_SIZE != 4)
6: die("skip this test is for 32bit platform only");
7: ?>
8:
9: --FILE--
10: <?php
11: /* Prototype : string crc32(string $str)
12: * Description: Calculate the crc32 polynomial of a string
13: * Source code: ext/standard/crc32.c
14: * Alias to functions: none
15: */
16:
17: /*
18: * Testing crc32() : error conditions
19: */
20:
21: echo "*** Testing crc32() : error conditions ***\n";
22:
23: // Zero arguments
24: echo "\n-- Testing crc32() function with Zero arguments --\n";
25: var_dump( crc32() );
26:
27: //Test crc32 with one more than the expected number of arguments
28: echo "\n-- Testing crc32() function with more than expected no. of arguments --\n";
29: $str = 'string_val';
30: $extra_arg = 10;
31: var_dump( crc32($str, $extra_arg) );
32:
33: echo "Done";
34: ?>
35: --EXPECTF--
36: *** Testing crc32() : error conditions ***
37:
38: -- Testing crc32() function with Zero arguments --
39:
40: Warning: crc32() expects exactly 1 parameter, 0 given in %s on line %d
41: NULL
42:
43: -- Testing crc32() function with more than expected no. of arguments --
44:
45: Warning: crc32() expects exactly 1 parameter, 2 given in %s on line %d
46: NULL
47: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>