1--TEST--
2Maths test for xapic versions of lcg_value()
3--FILE--
4<?php
5
6echo "MATHS test script started\n";
7
8
9echo "\n lcg_value tests...\n";
10for ($i = 0; $i < 100; $i++) {
11	$res = lcg_value();
12
13	if (!is_float($res) || $res < 0 || $res > 1) {
14		break;
15	}
16}
17
18if ($i != 100) {
19	echo "FAILED\n";
20} else {
21	echo "PASSED\n";
22}
23
24echo "\n lcg_value error cases..spurious args get ignored\n";
25$res = lcg_value(23);
26
27if (!is_float($res) || $res < 0 || $res > 1) {
28	echo "FAILED\n";
29} else {
30	echo "PASSED\n";
31}
32
33$res = lcg_value(10,false);
34if (!is_float($res) || $res < 0 || $res > 1) {
35	echo "FAILED\n";
36} else {
37	echo "PASSED\n";
38}
39
40echo "MATHS test script completed\n";
41
42?>
43
44--EXPECT--
45MATHS test script started
46
47 lcg_value tests...
48PASSED
49
50 lcg_value error cases..spurious args get ignored
51PASSED
52PASSED
53MATHS test script completed
54
55
56
57