use
SPVM
'TestCase::Array'
;
my
$start_memory_blocks_count
= SPVM::get_memory_blocks_count();
{
ok(SPVM::TestCase::Array->array_init_fatcamma);
}
{
ok(SPVM::TestCase::Array->array());
ok(SPVM::TestCase::Array->array_store_undef());
}
{
ok(SPVM::TestCase::Array->array_length_atmark());
ok(SPVM::TestCase::Array->array_length_atmark_brace());
ok(SPVM::TestCase::Array->array_length_scalar_atmark());
ok(SPVM::TestCase::Array->array_length_scalar_atmark_brace());
ok(SPVM::TestCase::Array->array_length_undef());
}
{
ok(SPVM::TestCase::Array->array_init_empty());
ok(SPVM::TestCase::Array->array_init_byte());
ok(SPVM::TestCase::Array->array_init_short());
ok(SPVM::TestCase::Array->array_init_int());
ok(SPVM::TestCase::Array->array_init_long());
ok(SPVM::TestCase::Array->array_init_float());
ok(SPVM::TestCase::Array->array_init_double());
ok(SPVM::TestCase::Array->array_init_object());
}
{
ok(SPVM::TestCase::Array->array_init_key_values_empty());
ok(SPVM::TestCase::Array->array_init_key_values());
}
{
ok(SPVM::TestCase::Array->array_default_zero_memory_pool());
ok(SPVM::TestCase::Array->array_default_zero_not_memory_pool());
}
{
my
$element
= SPVM::TestCase::Array->array_set_and_get_array_element_first();
is(
$element
, 345);
}
{
my
$element
= SPVM::TestCase::Array->array_set_and_get_array_element_last();
is(
$element
, 298);
}
{
my
$total
= SPVM::TestCase::Array->array_culcurate_sum_by_for();
is(
$total
, 6);
}
SPVM::set_exception(
undef
);
my
$end_memory_blocks_count
= SPVM::get_memory_blocks_count();
is(
$end_memory_blocks_count
,
$start_memory_blocks_count
);
done_testing;