r4117 - in trunk: . test test/main test/main/data/urls

From: <aelAT@ATshadanakar.org>
Date: Tue, 21 Aug 2007 12:13:33 +0400 (MSD)

Author: ael
Date: 2007-08-21 12:13:33 +0400 (Tue, 21 Aug 2007)
New Revision: 4117

Removed:
   trunk/test/main/MathTest.class.php
Modified:
   trunk/global.inc.php.tpl
   trunk/test/config.inc.php.tpl
   trunk/test/main/data/urls/
   trunk/test/runme.php
Log:
4116 from 0.10 merged (ability to test incubator)
forgotten incubator test removed
BEWARE: ONPHP_INCUBATOR_PATH changed

Modified: trunk/global.inc.php.tpl
===================================================================
--- trunk/global.inc.php.tpl 2007-08-21 08:01:30 UTC (rev 4116)
+++ trunk/global.inc.php.tpl 2007-08-21 08:13:33 UTC (rev 4117)
@@ -152,11 +152,7 @@
         
         define(
                 'ONPHP_INCUBATOR_PATH',
- ONPHP_ROOT_PATH
- .'incubator'
- .DIRECTORY_SEPARATOR
- .'classes'
- .DIRECTORY_SEPARATOR
+ ONPHP_ROOT_PATH.'incubator'.DIRECTORY_SEPARATOR
         );
         
         set_include_path(

Modified: trunk/test/config.inc.php.tpl
===================================================================
--- trunk/test/config.inc.php.tpl 2007-08-21 08:01:30 UTC (rev 4116)
+++ trunk/test/config.inc.php.tpl 2007-08-21 08:13:33 UTC (rev 4117)
@@ -8,13 +8,15 @@
         error_reporting(E_ALL); // & ~E_STRICT due to simpletest limitations
         
         set_include_path(
- // current path
                 get_include_path().PATH_SEPARATOR
- .ONPHP_TEST_PATH.'core'.PATH_SEPARATOR
- .ONPHP_TEST_PATH.'base'.PATH_SEPARATOR
                 .ONPHP_TEST_PATH.'misc'.PATH_SEPARATOR
         );
         
+ $testPathes = array(
+ ONPHP_TEST_PATH.'core'.DIRECTORY_SEPARATOR,
+ ONPHP_TEST_PATH.'main'.DIRECTORY_SEPARATOR
+ );
+
         $dbs = array(
 /*
                 'PgSQL' => array(
@@ -41,4 +43,4 @@
         ini_set('html_errors', false);
         
         require SIMPLETEST_PATH.'unit_tester.php';
-?>
\ No newline at end of file
+?>

Deleted: trunk/test/main/MathTest.class.php
===================================================================
--- trunk/test/main/MathTest.class.php 2007-08-21 08:01:30 UTC (rev 4116)
+++ trunk/test/main/MathTest.class.php 2007-08-21 08:13:33 UTC (rev 4117)
@@ -1,117 +0,0 @@
-<?php
-/***************************************************************************
- * Copyright (C) 2007 by Anton E. Lebedevich *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 3 of the *
- * License, or (at your option) any later version. *
- * *
- ***************************************************************************/
-/* $Id$ */
-
- final class MathTest extends UnitTestCase
- {
- public function runMathTest(BigNumberFactory $factory)
- {
- $this->assertEqual(
- '4',
- $factory->
- makeNumber(2)->
- add($factory->makeNumber(2))->
- toString()
- );
-
- $this->assertEqual(
- '281470681743360',
- $factory->
- makeNumber('281474976710656')->
- subtract($factory->makeNumber('4294967296'))->
- toString()
- );
-
- $this->assertEqual(
- '281470681743360',
- $factory->
- makeNumber(2)->
- pow($factory->makeNumber(48))->
- subtract(
- $factory->
- makeNumber(2)->
- pow($factory->makeNumber(32))
- )->
- toString()
- );
-
- $binaryConversions = array(
- "\x00" => '0',
- "\x01" => '1',
- "\x7F" => '127',
- "\x00\x80" => '128',
- "\x00\x81" => '129',
- "\x00\xFF" => '255',
- "\x00\x80\x00" => '32768'
- );
-
- foreach ($binaryConversions as $binary => $string) {
- $this->assertEqual(
- $factory->makeFromBinary($binary)->toString(),
- $string
- );
- $this->assertEqual(
- $factory->makeNumber($string)->toBinary(),
- $binary
- );
- }
- }
-
- public function runRandomTest(BigNumberFactory $factory, RandomSource $source)
- {
- $this->assertNotEqual(
- $factory->
- makeRandom(100, $source)->
- cmp($factory->makeRandom(100, $source)),
- 0
- );
-
- $this->assertNotEqual(
- $factory->
- makeRandom('123456789012345678901234567890', $source)->
- cmp(
- $factory->makeRandom(
- '123456789012345678901234567890',
- $source
- )
- ),
- 0
- );
- }
-
- /* void */ public function testGmp()
- {
- if (!extension_loaded('gmp')) {
- if (!@dl('gmp.so')) {
- return;
- }
- }
-
- $this->runMathTest(GmpBigIntegerFactory::me());
- }
-
- public function runRandomSourceTest(RandomSource $source)
- {
- $this->assertNotEqual($source->getBytes(1), $source->getBytes(1));
- $this->assertNotEqual($source->getBytes(2), $source->getBytes(2));
- $this->assertNotEqual($source->getBytes(10), $source->getBytes(10));
- $this->assertNotEqual($source->getBytes(256), $source->getBytes(256));
- }
-
- public function testRandomSource()
- {
- $this->runRandomSourceTest(MtRandomSource::me());
-
- if (file_exists('/dev/urandom') && is_readable('/dev/urandom'))
- $this->runRandomSourceTest(new FileRandomSource('/dev/urandom'));
- }
- }
-?>
\ No newline at end of file

Property changes on: trunk/test/main/data/urls
___________________________________________________________________
Name: svn:ignore
   + parser.dump.new

Modified: trunk/test/runme.php
===================================================================
--- trunk/test/runme.php 2007-08-21 08:01:30 UTC (rev 4116)
+++ trunk/test/runme.php 2007-08-21 08:13:33 UTC (rev 4117)
@@ -19,8 +19,9 @@
         
         $test = new GroupTest('onPHP-'.ONPHP_VERSION);
         
- foreach (glob(ONPHP_TEST_PATH.'{core,main}/*.class.php', GLOB_BRACE) as $file)
- $test->addTestFile($file);
+ foreach ($testPathes as $testPath)
+ foreach (glob($testPath.'*Test.class.php', GLOB_BRACE) as $file)
+ $test->addTestFile($file);
         
         // meta, DB and DAOs ordered tests portion
         if (isset($dbs) && $dbs) {
Received on Tue Aug 21 2007 - 12:13:33 MSD

This archive was generated by hypermail 2.2.0 : Sun Oct 28 2007 - 00:25:45 MSD