summaryrefslogtreecommitdiffstats
path: root/PerlQt/t/b_nogui.t
blob: cd28260c1c31493ce15d4f3c1bb95e2a2984f425 (plain)
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
44
45
46
47
48

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";
}