Annotation of embedaddon/php/ext/standard/tests/strings/crc32_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test crc32() function : basic functionality
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() : basic functionality
19: */
20:
21: echo "*** Testing crc32() : basic functionality ***\n";
22:
23:
24: // Initialise all required variables
25: $str = 'string_val1234';
26:
27: // Calling crc32() with all possible arguments
28:
29: // checking for the return type of the function
30: var_dump( is_int(crc32($str)) );
31:
32: // Printing the returned value from the function
33: printf("%u\n", crc32($str) );
34:
35: echo "Done";
36: ?>
37: --EXPECTF--
38: *** Testing crc32() : basic functionality ***
39: bool(true)
40: 256895812
41: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>