From 50fc778f7a535b7346cc465df50cb53e1fecdccb Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Thu, 10 May 2007 07:11:36 +0000 Subject: - Added one more test for invalid matrix multiplication --- tests/matrix_test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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( -- cgit v1.1