~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/test-suite/perl5/array_member_runme.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
use strict;
 
3
use warnings;
 
4
use Test::More tests => 18;
 
5
BEGIN { use_ok('array_member') }
 
6
require_ok('array_member');
 
7
 
 
8
my $f = array_member::Foo->new();
 
9
$f->{data} = $array_member::global_data;
 
10
 
 
11
for(my $i=0; $i<8; $i++) {
 
12
        is( array_member::get_value($f->{data},$i),
 
13
                array_member::get_value($array_member::global_data,$i),
 
14
                "array assignment");
 
15
}
 
16
 
 
17
for(my $i=0; $i<8; $i++) {
 
18
        array_member::set_value($f->{data},$i,-$i);
 
19
}
 
20
 
 
21
$array_member::global_data = $f->{data};
 
22
 
 
23
for(my $i=0; $i<8; $i++) {
 
24
        is(array_member::get_value($f->{data},$i),
 
25
                array_member::get_value($array_member::global_data,$i),
 
26
                "array assignment");
 
27
}
 
28