Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add some tests
  • Loading branch information
Whiteknight committed Nov 6, 2009
1 parent 650ccbb commit 3edbb8a
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions t/10-nummatrix.t
Expand Up @@ -18,7 +18,7 @@ sub MAIN () {
pla_library_loaded:
};

plan(73);
plan(74);

create_nummatrix2d();
vtable_set_number_keyed();
Expand All @@ -31,15 +31,12 @@ sub MAIN () {
vtable_get_pmc_keyed();
vtable_set_pmc_keyed();
vtable_get_number_keyed_int();
vtable_set_number_keyed_int();
vtable_get_integer_keyed_int();
vtable_set_integer_keyed_int();
vtable_get_string_keyed_int();
vtable_get_pmc_keyed_int();
vtable_set_pmc_keyed_int();
vtable_is_equal();
vtable_add_nummatrix2d();
vtable_multiply_nummatrix2d();
vtable_is_equal();
vtable_clone();
method_resize();
method_fill();
Expand Down Expand Up @@ -264,8 +261,6 @@ sub vtable_get_number_keyed_int() {
}
}
sub vtable_set_number_keyed_int() {}
sub vtable_get_integer_keyed_int() {
Q:PIR {
$P0 = new 'NumMatrix2D'
Expand All @@ -288,12 +283,11 @@ sub vtable_get_integer_keyed_int() {
}
}

sub vtable_set_integer_keyed_int() {}
sub vtable_get_string_keyed_int() {}

sub vtable_get_pmc_keyed_int() {
Q:PIR {
$P0 = new 'NumMatrix2D'
$P0 = new ['NumMatrix2D']
$P0[1;1] = 1.0
$P0[0;1] = 2.0
$P0[1;0] = 3.0
Expand All @@ -319,15 +313,10 @@ sub vtable_get_pmc_keyed_int() {
}
}
sub vtable_set_pmc_keyed_int() {}
sub vtable_add_nummatrix2d() {}
sub vtable_multiply_nummatrix2d() {}
sub vtable_is_equal() {
Q:PIR {
$P0 = new 'NumMatrix2D'
$P1 = new 'NumMatrix2D'
$P0 = new ['NumMatrix2D']
$P1 = new ['NumMatrix2D']

$I0 = $P0 == $P1
ok($I0, "empty matrices are equal")
Expand Down Expand Up @@ -355,6 +344,34 @@ sub vtable_is_equal() {
}
}

sub vtable_add_nummatrix2d() {
Q:PIR {
$P0 = new ['NumMatrix2D']
$P0[0;0] = 1.0
$P0[1;0] = 2.0
$P0[0;1] = 3.0
$P0[1;1] = 4.0
$P1 = new ['NumMatrix2D']
$P1[0;0] = 5.0
$P1[1;0] = 6.0
$P1[0;1] = 7.0
$P1[1;1] = 8.0
$P2 = new ['NumMatrix2D']
$P2[0;0] = 6.0
$P2[1;0] = 8.0
$P2[0;1] = 10.0
$P2[1;1] = 12.0
$P3 = $P0 + $P1
$I0 = $P3 == $P2
ok($I0, "can add two matrices together of the same size")
}
}
sub vtable_multiply_nummatrix2d() {}
sub vtable_clone() {
Q:PIR {
$P0 = new 'NumMatrix2D'
Expand Down

0 comments on commit 3edbb8a

Please sign in to comment.