File: 09_create_delete.t

package info (click to toggle)
libwx-perl 1%3A0.9932-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,300 kB
  • sloc: cpp: 11,064; perl: 8,603; ansic: 711; makefile: 53
file content (43 lines) | stat: -rwxr-xr-x 908 bytes parent folder | download | duplicates (6)
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
37
38
39
40
41
42
43
#!/usr/bin/perl -w

use strict;
use Wx;
use lib './t';
use Tests_Helper 'test_frame';

package MyFrame;

use base 'Wx::Frame';
use Test::More 'tests' => 8;

sub new {
my $this = shift->SUPER::new( undef, -1, 'a' );
# $class, @args
my( @tests ) = ( [ 'Wx::MessageDialog', [ $this, 'dummy' ] ],
                 [ 'Wx::Wizard',        [ $this ] ],
                 [ 'Wx::WizardPage',    [ Wx::Wizard->new( $this ) ] ],
                 [ 'Wx::WizardPageSimple', [ Wx::Wizard->new( $this ) ] ],
                );

foreach my $t ( @tests ) {
  my $class = ${$t}[0];
  my @args = @{${$t}[1]};

  my $obj = $class->new( @args );
  isa_ok( $obj, $class, "$class: new returns an object of the correct class" );

  $obj->Destroy();
  ok( 1, "    got there after $class->Destroy" );
}

return $this;
};

package main;

test_frame( 'MyFrame', 1 );
Wx::wxTheApp()->MainLoop();

# local variables:
# mode: cperl
# end: