diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-05-10 07:11:36 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-05-10 07:11:36 +0000 |
commit | 50fc778f7a535b7346cc465df50cb53e1fecdccb (patch) | |
tree | 655a730f3695fdfa067dccbb2c3a0f2f59e0bb92 | |
parent | e7468243a48438ce202ef4b365dd44eaecf90e43 (diff) | |
download | zetacomponents-graph-50fc778f7a535b7346cc465df50cb53e1fecdccb.zip zetacomponents-graph-50fc778f7a535b7346cc465df50cb53e1fecdccb.tar.gz |
- Added one more test for invalid matrix multiplication
-rw-r--r-- | tests/matrix_test.php | 24 |
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( |