Skip to content

Commit

Permalink
add some tests for ComplexMatrix2D.tranpose and .mem_transpose so we …
Browse files Browse the repository at this point in the history
…don't regress on those things
  • Loading branch information
andrew authored and andrew committed Nov 29, 2009
1 parent ceba80e commit 8ae9618
Showing 1 changed file with 60 additions and 3 deletions.
63 changes: 60 additions & 3 deletions t/pmc/complexmatrix2d.t
Expand Up @@ -17,7 +17,7 @@ sub MAIN () {
pla_library_loaded:
};

plan(4);
plan(6);

create_complexmatrix2d();
op_does_matrix();
Expand Down Expand Up @@ -73,8 +73,65 @@ sub vtable_clone() {}
sub vtable_is_equal() {}
sub method_resize() {}
sub method_fill() {}
sub method_transpose() {}
sub method_mem_transpose() {}
sub method_transpose() {
Q:PIR {
$P0 = new ['ComplexMatrix2D']
$P1 = new ['Complex']
$P1 = "1+1i"
$P0[0;0] = $P1
$P1 = "2+2i"
$P0[0;1] = $P1
$P1 = "3+3i"
$P0[1;0] = $P1
$P1 = "4+4i"
$P0[1;1] = $P1

$P2 = new ['ComplexMatrix2D']
$P1 = "1+1i"
$P2[0;0] = $P1
$P1 = "3+3i"
$P2[0;1] = $P1
$P1 = "2+2i"
$P2[1;0] = $P1
$P1 = "4+4i"
$P2[1;1] = $P1

$P0.'transpose'()
$I0 = $P0 == $P2
ok($I0, "can transpose a ComplexMatrix2D")
}
}

sub method_mem_transpose() {
Q:PIR {
$P0 = new ['ComplexMatrix2D']
$P1 = new ['Complex']
$P1 = "1+1i"
$P0[0;0] = $P1
$P1 = "2+2i"
$P0[0;1] = $P1
$P1 = "3+3i"
$P0[1;0] = $P1
$P1 = "4+4i"
$P0[1;1] = $P1
$P2 = new ['ComplexMatrix2D']
$P1 = "1+1i"
$P2[0;0] = $P1
$P1 = "3+3i"
$P2[0;1] = $P1
$P1 = "2+2i"
$P2[1;0] = $P1
$P1 = "4+4i"
$P2[1;1] = $P1
$P0.'mem_transpose'()
$I0 = $P0 == $P2
ok($I0, "can transpose a ComplexMatrix2D")
}
}
sub method_iterate_function_inplace() {
Q:PIR {
$P0 = new ['ComplexMatrix2D']
Expand Down

0 comments on commit 8ae9618

Please sign in to comment.