summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-05-10 07:11:36 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-05-10 07:11:36 +0000
commit50fc778f7a535b7346cc465df50cb53e1fecdccb (patch)
tree655a730f3695fdfa067dccbb2c3a0f2f59e0bb92 /tests
parente7468243a48438ce202ef4b365dd44eaecf90e43 (diff)
downloadzetacomponents-graph-50fc778f7a535b7346cc465df50cb53e1fecdccb.zip
zetacomponents-graph-50fc778f7a535b7346cc465df50cb53e1fecdccb.tar.gz
- Added one more test for invalid matrix multiplication
Diffstat (limited to 'tests')
-rw-r--r--tests/matrix_test.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/matrix_test.php b/tests/matrix_test.php
index 53848de..7c9ad55 100644
--- a/tests/matrix_test.php
+++ b/tests/matrix_test.php
@@ -256,6 +256,30 @@ class ezcGraphMatrixTest extends ezcTestCase
$this->fail( 'Expected ezcGraphMatrixInvalidDimensionsException.' );
}
+ public function testMatrixMultiplicationInvalidDimensions2()
+ {
+ $a = new ezcGraphMatrix( 3, 2, array(
+ array( 6, -1 ),
+ array( 3, 2 ),
+ array( 0, -3 ),
+ ) );
+ $b = new ezcGraphMatrix( 3, 3, array(
+ array( 1, 2, 3 ),
+ array( 4, 5, 6 ),
+ ) );
+
+ try
+ {
+ $a->multiply( $b );
+ }
+ catch ( ezcGraphMatrixInvalidDimensionsException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcGraphMatrixInvalidDimensionsException.' );
+ }
+
public function testTransposeMatrix()
{
$matrix = new ezcGraphMatrix( 2, 3, array(
OpenPOWER on IntegriCloud