File: weakref.t

package info (click to toggle)
libtangram-perl 2.04-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 572 kB
  • ctags: 495
  • sloc: perl: 5,061; makefile: 36
file content (36 lines) | stat: -rw-r--r-- 615 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# (c) Sound Object Logic 2000-2001

use strict;
use lib 't';
use Springfield;

# $Tangram::TRACE = \*STDOUT;

my $tests = 3;
Springfield::begin_tests($tests);

Springfield::optional_tests('weakrefs', !$Tangram::no_weakrefs, $tests)
  or exit;

{
  my $storage = Springfield::connect_empty;

  $storage->insert( NaturalPerson->new( firstName => 'Homer' ));

  Springfield::leaktest;

  $storage->disconnect();
}

{
  my $storage = Springfield::connect;

  {
    my ($homer) = $storage->select('Person');
    Springfield::test($SpringfieldObject::pop == 1);
  }

  Springfield::leaktest;

  $storage->disconnect();
}