From: Robert Nicholson Date: Fri, 26 Oct 2007 10:57:59 +0000 (+0000) Subject: new testcases for max and min X-Git-Tag: RELEASE_2_0_0a1~1542 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eea1a4458c7c3acc1ec2442039d6cb37507de4d5;p=php new testcases for max and min --- diff --git a/ext/standard/tests/array/max_basic.phpt b/ext/standard/tests/array/max_basic.phpt new file mode 100644 index 0000000000..3eff3a2ecb --- /dev/null +++ b/ext/standard/tests/array/max_basic.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test return type and value for expected input max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing sequences of numbers *** +int(2) +int(2) +float(2.11) +string(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} + +Done +--UEXPECT-- + +*** Testing sequences of numbers *** +int(2) +int(2) +float(2.11) +unicode(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/max_error.phpt b/ext/standard/tests/array/max_error.phpt new file mode 100644 index 0000000000..3c1d5678aa --- /dev/null +++ b/ext/standard/tests/array/max_error.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test wrong number of arguments for min() +--INI-- +--FILE-- + +--EXPECTF-- + +*** Testing Error Conditions *** + +Warning: max(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for max() in %s on line %d +NULL + +Warning: max(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for max() in %s on line %d +NULL +--UEXPECTF-- + +*** Testing Error Conditions *** + +Warning: max(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for max() in %s on line %d +NULL + +Warning: max(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for max() in %s on line %d +NULL diff --git a/ext/standard/tests/array/max_variation1.phpt b/ext/standard/tests/array/max_variation1.phpt new file mode 100644 index 0000000000..43824ee650 --- /dev/null +++ b/ext/standard/tests/array/max_variation1.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing boundary conditions *** +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +*** Testing large number of arguments *** +int(21) + +Done +--UEXPECT-- + +*** Testing boundary conditions *** +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +*** Testing large number of arguments *** +int(21) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/max_variation2.phpt b/ext/standard/tests/array/max_variation2.phpt new file mode 100644 index 0000000000..d09025e57b --- /dev/null +++ b/ext/standard/tests/array/max_variation2.phpt @@ -0,0 +1,81 @@ +--TEST-- +Test variations in usage of max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing arrays *** +int(2) +int(2) +float(2.11) +string(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +Done +--UEXPECT-- + +*** Testing arrays *** +int(2) +int(2) +float(2.11) +unicode(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_basic.phpt b/ext/standard/tests/array/min_basic.phpt new file mode 100644 index 0000000000..487666ee40 --- /dev/null +++ b/ext/standard/tests/array/min_basic.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test return type and value for expected input min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing sequences of numbers *** +int(1) +int(-2) +float(2.09) +string(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) + +Done +--UEXPECT-- + +*** Testing sequences of numbers *** +int(1) +int(-2) +float(2.09) +unicode(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_error.phpt b/ext/standard/tests/array/min_error.phpt new file mode 100644 index 0000000000..6f16eddfe0 --- /dev/null +++ b/ext/standard/tests/array/min_error.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test wrong number of arguments for min() +--INI-- +--FILE-- + +--EXPECTF-- + +*** Testing Error Conditions *** + +Warning: min(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for min() in %s on line %d +NULL + +Warning: min(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for min() in %s on line %d +NULL +--UEXPECTF-- + +*** Testing Error Conditions *** + +Warning: min(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for min() in %s on line %d +NULL + +Warning: min(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for min() in %s on line %d +NULL + diff --git a/ext/standard/tests/array/min_variation1.phpt b/ext/standard/tests/array/min_variation1.phpt new file mode 100644 index 0000000000..a985578cec --- /dev/null +++ b/ext/standard/tests/array/min_variation1.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing boundary conditions *** +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +*** Testing large number of arguments *** +int(0) + +Done +--UEXPECT-- + +*** Testing boundary conditions *** +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +*** Testing large number of arguments *** +int(0) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_variation2.phpt b/ext/standard/tests/array/min_variation2.phpt new file mode 100644 index 0000000000..01bb78d7c6 --- /dev/null +++ b/ext/standard/tests/array/min_variation2.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test variations in usage of min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing arrays *** +int(1) +int(-2) +float(2.09) +string(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +Done +--UEXPECT-- + +*** Testing arrays *** +int(1) +int(-2) +float(2.09) +unicode(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +Done \ No newline at end of file