diff options
Diffstat (limited to 'PerlQt/t')
-rw-r--r-- | PerlQt/t/Foo/SubCodec.pm | 14 | ||||
-rw-r--r-- | PerlQt/t/My/Codec.pm | 10 | ||||
-rw-r--r-- | PerlQt/t/My/SubCodec.pm | 15 | ||||
-rw-r--r-- | PerlQt/t/a_loading.t | 6 | ||||
-rw-r--r-- | PerlQt/t/b_nogui.t | 48 | ||||
-rw-r--r-- | PerlQt/t/c_qapp.t | 23 | ||||
-rw-r--r-- | PerlQt/t/ca_i18n.t | 23 | ||||
-rw-r--r-- | PerlQt/t/d_sigslot.t | 49 | ||||
-rw-r--r-- | PerlQt/t/e_sigslot_inherit.t | 72 | ||||
-rw-r--r-- | PerlQt/t/f_import.t | 19 | ||||
-rw-r--r-- | PerlQt/t/g_gui.t | 127 |
11 files changed, 0 insertions, 406 deletions
diff --git a/PerlQt/t/Foo/SubCodec.pm b/PerlQt/t/Foo/SubCodec.pm deleted file mode 100644 index 9d79fba..0000000 --- a/PerlQt/t/Foo/SubCodec.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Foo::SubCodec; -use TQt; -use My::Codec; -use TQt::isa qw( My::Codec ); - - -sub NEW -{ - shift->SUPER::NEW(@_); -} - -sub foo {} - -1; diff --git a/PerlQt/t/My/Codec.pm b/PerlQt/t/My/Codec.pm deleted file mode 100644 index f853f5d..0000000 --- a/PerlQt/t/My/Codec.pm +++ /dev/null @@ -1,10 +0,0 @@ -package My::Codec; -use TQt; -use TQt::isa qw( TQt::TextCodec ); - -sub NEW -{ - shift->SUPER::NEW(@_); -} - -1;
\ No newline at end of file diff --git a/PerlQt/t/My/SubCodec.pm b/PerlQt/t/My/SubCodec.pm deleted file mode 100644 index 35e2b0c..0000000 --- a/PerlQt/t/My/SubCodec.pm +++ /dev/null @@ -1,15 +0,0 @@ - -package My::SubCodec; -use TQt; -use My::Codec; -use TQt::isa qw( My::Codec ); - - -sub NEW -{ - shift->SUPER::NEW(@_); -} - -sub bar {} - -1;
\ No newline at end of file diff --git a/PerlQt/t/a_loading.t b/PerlQt/t/a_loading.t deleted file mode 100644 index 1cffc31..0000000 --- a/PerlQt/t/a_loading.t +++ /dev/null @@ -1,6 +0,0 @@ - -BEGIN { print "1..1\n" } - -use TQt; - -print "ok 1\n" diff --git a/PerlQt/t/b_nogui.t b/PerlQt/t/b_nogui.t deleted file mode 100644 index cd28260..0000000 --- a/PerlQt/t/b_nogui.t +++ /dev/null @@ -1,48 +0,0 @@ - -BEGIN { print "1..6\n" } - -use TQt; -use TQt::constants; - -eval {my $c = TQt::TextCodec::codecForLocale()}; - -print +$@ ? "not ok\n" : "ok 1\n"; - -eval {my $s = TQt::Variant( TQt::DateTime::currentDateTime() ) }; - -print +$@ ? "not ok\n" : "ok 2\n"; - -my $ret; -eval {$ret = TQt::Point(20,20); $ret += TQt::Point(10,10); $ret *= 2 ; $ret /= 3 }; - -print +$@ ? "not ok\n" : "ok 3\n"; - -eval { $ret = ($ret->x != 20 or $ret->y != 20) ? 1 : 0 }; - -print +($@ || $ret) ? "not ok\n" : "ok 4\n"; - -eval { my $z = TQt::GlobalSpace::qVersion() }; - -if( $@ ) -{ - print "ok 5 # skip Smoke version too old\n"; - print "ok 6 # skip Smoke version too old\n"; -} -else -{ - eval{ my $p = TQt::Point( 20, 20 ); - my $p2 = TQt::Point( 30, 30 ); - $p = $p + $p2 + $p; - $p2 = $p * 2; - $p2 = -$p2; - $ret = ($p2->x != -140 or $p2->y != -140) ? 1 : 0 - }; - print +($@ || $ret) ? "not ok\n" : "ok 5\n"; - - eval { - $str = "Fooooooooooo"; - $ts = TQt::TextStream( $str, IO_WriteOnly ); - $ts << "pi = " << 3.14; - }; - print +($str eq "pi = 3.14ooo") ? "ok 6\n":"not ok\n"; -} diff --git a/PerlQt/t/c_qapp.t b/PerlQt/t/c_qapp.t deleted file mode 100644 index 01d6b39..0000000 --- a/PerlQt/t/c_qapp.t +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN { print "1..3\n" } - -use TQt; - -$a=0; - -# testing if the TQt::Application ctor works - -eval { $a=TQt::Application(\@ARGV) }; - -print +$@ ? "not ok\n" : "ok 1\n"; - -# testing wether the global object is properly setup - -eval { TQt::app()->libraryPaths() }; - -print +$@ ? "not ok\n" : "ok 2\n"; - -# one second test of the event loop - -TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" ); - -print TQt::app()->exec ? "not ok\n" : "ok 3\n"; diff --git a/PerlQt/t/ca_i18n.t b/PerlQt/t/ca_i18n.t deleted file mode 100644 index 1e71c29..0000000 --- a/PerlQt/t/ca_i18n.t +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN { print "1..1\n" } - -use TQt; - -$a = TQt::Application(); -$pb=TQt::PushButton("Foooo", undef); - -{ - use bytes; - $pb->setText( "�l�gant" ); - - $b = $pb->text(); - $b2 = TQt::Widget::tr("�l�gant"); -} - - -$c = $pb->text(); -$c2= TQt::Widget::tr("�l�gant"); - -{ - use bytes; - print +($b ne $c and $b2 ne $c2) ? "ok 1\n":"not ok\n"; -} diff --git a/PerlQt/t/d_sigslot.t b/PerlQt/t/d_sigslot.t deleted file mode 100644 index acd3c4a..0000000 --- a/PerlQt/t/d_sigslot.t +++ /dev/null @@ -1,49 +0,0 @@ -BEGIN { print "1..3\n" } - -package MyApp; -use TQt; -use TQt::isa qw(TQt::Application); -use TQt::slots - foo => ['int'], - baz => []; -use TQt::signals - bar => ['int']; - -sub NEW { - shift->SUPER::NEW(@_); - - # 1) testing correct subclassing of TQt::Application and this pointer - print +(ref(this) eq " MyApp")? "ok 1\n" : "not ok\n"; - - this->connect(this, TQT_SIGNAL 'bar(int)', TQT_SLOT 'foo(int)'); - - # 3) automatic quitting will test TQt sig to custom slot - this->connect(this, TQT_SIGNAL 'aboutToQuit()', TQT_SLOT 'baz()'); - - # 2) testing custom sig to custom slot - emit bar(3); -} - -sub foo -{ - print +($_[0] == 3) ? "ok 2\n" : "not ok\n"; -} - -sub baz -{ - print "ok 3\n"; -} - -1; - -package main; - -use TQt; -use MyApp; - -$a = 0; -$a = MyApp(\@ARGV); - -TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" ); - -exit TQt::app()->exec; diff --git a/PerlQt/t/e_sigslot_inherit.t b/PerlQt/t/e_sigslot_inherit.t deleted file mode 100644 index 338a405..0000000 --- a/PerlQt/t/e_sigslot_inherit.t +++ /dev/null @@ -1,72 +0,0 @@ -BEGIN { print "1..6\n" } - -package MyApp; -use TQt; -use TQt::isa('TQt::Application'); -use TQt::slots - foo => ['int'], - baz => []; -use TQt::signals - bar => ['int']; - -sub NEW -{ - shift->SUPER::NEW(@_); - this->connect(this, TQT_SIGNAL 'bar(int)', TQT_SLOT 'foo(int)'); - this->connect(this, TQT_SIGNAL 'aboutToQuit()', TQT_SLOT 'baz()'); -} - -sub foo -{ - # 1) testing correct inheritance of sig/slots - print +($_[0] == 3) ? "ok 1\n" : "not ok\n"; -} - -sub baz -{ - print "ok 3\n"; -} - -sub coincoin -{ - print +(@_ == 2) ? "ok 5\n":"not ok\n"; - print +(ref(this) eq " MySubApp") ? "ok 6\n":"not ok\n"; -} - -1; - -package MySubApp; -use TQt; -use TQt::isa('MyApp'); - - -sub NEW -{ - shift->SUPER::NEW(@_); - emit foo(3); -} - -sub baz -{ - # 2) testing further inheritance of sig/slots - print "ok 2\n"; - # 3) testing Perl to Perl SUPER - SUPER->baz(); - # 4) 5) 6) testing non-qualified enum calls vs. Perl method/static calls - eval { &blue }; print !$@ ? "ok 4\n":"not ok\n"; - coincoin("a","b"); -} - -1; - -package main; - -use TQt; -use MySubApp; - -$a = 0; -$a = MySubApp(\@ARGV); - -TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" ); - -exit TQt::app()->exec; diff --git a/PerlQt/t/f_import.t b/PerlQt/t/f_import.t deleted file mode 100644 index 9f8977c..0000000 --- a/PerlQt/t/f_import.t +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN { push @INC, "./t" ; print "1..1\n" } - -package main; - -use TQt; -use My::SubCodec; -use Foo::SubCodec; - -$tc1 = My::SubCodec(); -$tc2 = Foo::SubCodec(); - -$tc1->bar(); -$tc2->foo(); - -$tc2->deleteAllCodecs; - -# all imports OK - -print "ok 1\n"; diff --git a/PerlQt/t/g_gui.t b/PerlQt/t/g_gui.t deleted file mode 100644 index f3a7d05..0000000 --- a/PerlQt/t/g_gui.t +++ /dev/null @@ -1,127 +0,0 @@ - -BEGIN { print "1..1\n" } - -package ButtonsGroups; -use strict; -use TQt; -use TQt::isa qw(TQt::Widget); -use TQt::slots - slotChangeGrp3State => []; -use TQt::attributes qw( - state - rb21 - rb22 - rb23 -); - -# -# Constructor -# -# Creates all child widgets of the ButtonGroups window -# - -sub NEW { - shift->SUPER::NEW(@_); - - # Create Widgets which allow easy layouting - my $vbox = TQt::VBoxLayout(this); - my $box1 = TQt::HBoxLayout($vbox); - my $box2 = TQt::HBoxLayout($vbox); - - # ------- first group - - # Create an exclusive button group - my $bgrp1 = TQt::ButtonGroup(1, &Horizontal, "Button Group &1 (exclusive)", this); - $box1->addWidget($bgrp1); - $bgrp1->setExclusive(1); - - # insert 3 radiobuttons - TQt::RadioButton("R&adiobutton 2", $bgrp1); - TQt::RadioButton("Ra&diobutton 3", $bgrp1); - - # ------- second group - - # Create a non-exclusive buttongroup - my $bgrp2 = TQt::ButtonGroup(1, &Horizontal, "Button Group &2 (non-exclusive)", this); - $box1->addWidget($bgrp2); - $bgrp2->setExclusive(0); - - # insert 3 checkboxes - TQt::CheckBox("&Checkbox 1", $bgrp2); - my $cb12 = TQt::CheckBox("C&heckbox 2", $bgrp2); - $cb12->setChecked(1); - my $cb13 = TQt::CheckBox("Triple &State Button", $bgrp2); - $cb13->setTristate(1); - $cb13->setChecked(1); - - # ----------- third group - - # create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons - my $bgrp3 = TQt::ButtonGroup(1, &Horizontal, "Button Group &3 (Radiobutton-exclusive)", this); - $box2->addWidget($bgrp3); - $bgrp3->setRadioButtonExclusive(1); - - # insert three radiobuttons - rb21 = TQt::RadioButton("Rad&iobutton 1", $bgrp3); - rb22 = TQt::RadioButton("Radi&obutton 2", $bgrp3); - rb23 = TQt::RadioButton("Radio&button 3", $bgrp3); - rb23->setChecked(1); - - # insert a checkbox - state = TQt::CheckBox("E&nable Radiobuttons", $bgrp3); - state->setChecked(1); - # ...and connect its TQT_SIGNAL clicked() with the TQT_SLOT slotChangeGrp3State() - this->connect(state, TQT_SIGNAL('clicked()'), TQT_SLOT('slotChangeGrp3State()')); - - # ----------- fourth group - - # create a groupbox which layouts its childs in a columns - my $bgrp4 = TQt::ButtonGroup(1, &Horizontal, "Groupbox with &normal buttons", this); - $box2->addWidget($bgrp4); - - # insert three pushbuttons... - TQt::PushButton("&Push Button", $bgrp4); - my $tb2 = TQt::PushButton("&Toggle Button", $bgrp4); - my $tb3 = TQt::PushButton("&Flat Button", $bgrp4); - - # ... and make the second one a toggle button - $tb2->setToggleButton(1); - $tb2->setOn(1); - - # ... and make the third one a flat button - $tb3->setFlat(1); -} - -# -# TQT_SLOT slotChangeGrp3State() -# -# enables/disables the radiobuttons of the third buttongroup -# - -sub slotChangeGrp3State { - rb21->setEnabled(state->isChecked); - rb22->setEnabled(state->isChecked); - rb23->setEnabled(state->isChecked); -} - -1; - -package main; - -use TQt; -use ButtonsGroups; - -TQt::StyleFactory::keys(); # disable style plugins (hacky) - -my $a = TQt::Application(\@ARGV); - -my $buttonsgroups = ButtonsGroups; -$buttonsgroups->resize(500, 250); -$buttonsgroups->setCaption("PerlTQt Test - Please wait"); -$a->setMainWidget($buttonsgroups); -$buttonsgroups->show; - -TQt::Timer::singleShot( 2000, TQt::app(), TQT_SLOT "quit()" ); -my $r = $a->exec; -print +$r?"not ok\n" : "ok 1\n"; -exit $r; |