cvs: php4 /ext/satellite/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt random.idl
| From: | David Eriksson | Date: | Sun, 12 Aug 2001 09:23:18 +0000 |
| Subject: | cvs: php4 /ext/satellite/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt random.idl | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6753@lists.php.net to get a copy of this message | ||
eriksson Sun Aug 12 05:23:18 2001 EDT
Added files:
/php4/ext/satellite/tests 001.phpt 002.phpt 003.phpt 004.phpt
005.phpt random.idl
Log:
wrote some tests for satellite
Index: php4/ext/satellite/tests/001.phpt
+++ php4/ext/satellite/tests/001.phpt
--TEST--
See if the satellite extension is loaded
--SKIPIF--
<?php if (!extension_loaded("satellite")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
echo "satellite extension is available";
/*
you can add regression tests for your extension here
the output of your test code has to be equal to the
text in the --EXPECT-- section below for the tests
to pass, differences between the output and the
expected text are interpreted as failure
see php4/tests/README for further information on
writing regression tests
*/
?>
--EXPECT--
satellite extension is available
Index: php4/ext/satellite/tests/002.phpt
+++ php4/ext/satellite/tests/002.phpt
--TEST--
Create object of type Random from IOR
--SKIPIF--
<?php if (!extension_loaded("satellite")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
satellite_load_idl("random.idl");
$ior =
"IOR:000000000000000f49444c3a52616e646f6d3a312e3000000000000100000000000000500001000000000016706c616e7874792e6473672e63732e7463642e69650006220000002c3a5c706c616e7874792e6473672e63732e7463642e69653a52616e646f6d3a303a3a49523a52616e646f6d00";
$obj = new OrbitObject($ior);
echo "Random object created";
?>
--EXPECT--
Random object created
Index: php4/ext/satellite/tests/003.phpt
+++ php4/ext/satellite/tests/003.phpt
--TEST--
Get a value from an object of type Random
--SKIPIF--
<?php if (!extension_loaded("satellite")) print "skip";
// internet connection needed, try to lookup www.php.net
exec("host www.php.net 2>/dev/null", $output, &$rv);
if ($rv) print "skip";
?>
--POST--
--GET--
--FILE--
<?php
//vim: syntax=php
satellite_load_idl("random.idl");
$ior =
"IOR:000000000000000f49444c3a52616e646f6d3a312e3000000000000100000000000000500001000000000016706c616e7874792e6473672e63732e7463642e69650006220000002c3a5c706c616e7874792e6473672e63732e7463642e69653a52616e646f6d3a303a3a49523a52616e646f6d00";
$obj = new OrbitObject($ior);
$value = $obj->lrand48();
echo "Random value retrieved";
?>
--EXPECT--
Random value retrieved
Index: php4/ext/satellite/tests/004.phpt
+++ php4/ext/satellite/tests/004.phpt
--TEST--
Get the IOR of an object
--SKIPIF--
<?php if (!extension_loaded("satellite")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
satellite_load_idl("random.idl");
$ior =
"IOR:01a917080f00000049444c3a52616e646f6d3a312e3000000100000000000000500000000101004016000000706c616e7874792e6473672e63732e7463642e69650022062c0000003a5c706c616e7874792e6473672e63732e7463642e69653a52616e646f6d3a303a3a49523a52616e646f6d00";
$obj = new OrbitObject($ior);
$ior2 = satellite_object_to_string($obj);
echo ">$ior2<";
?>
--EXPECT--
>IOR:01a917080f00000049444c3a52616e646f6d3a312e3000000100000000000000500000000101004016000000706c616e7874792e6473672e63732e7463642e69650022062c0000003a5c706c616e7874792e6473672e63732e7463642e69653a52616e646f6d3a303a3a49523a52616e646f6d00<
Index: php4/ext/satellite/tests/005.phpt
+++ php4/ext/satellite/tests/005.phpt
--TEST--
Satellite compatibility: Create object of type Random
--SKIPIF--
<?php if (!extension_loaded("satellite")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
satellite_load_idl("random.idl");
$ior =
"IOR:000000000000000f49444c3a52616e646f6d3a312e3000000000000100000000000000500001000000000016706c616e7874792e6473672e63732e7463642e69650006220000002c3a5c706c616e7874792e6473672e63732e7463642e69653a52616e646f6d3a303a3a49523a52616e646f6d00";
$obj = new OrbitObject($ior);
echo "Random object created";
?>
--EXPECT--
Random object created
Index: php4/ext/satellite/tests/random.idl
+++ php4/ext/satellite/tests/random.idl
// This interface was copied from http://random.org/corba.html, where you can
// also find the current IOR of the server.
// See client.cc for details.
// IDL
interface Random {
// return non-negative long integer in the interval [0, 2^31)
long lrand48();
// return signed long integer in the interval [-2^31, 2^31)
long mrand48();
};