summaryrefslogtreecommitdiffstats
path: root/PerlTQt/t/b_nogui.t
diff options
context:
space:
mode:
Diffstat (limited to 'PerlTQt/t/b_nogui.t')
-rw-r--r--PerlTQt/t/b_nogui.t48
1 files changed, 48 insertions, 0 deletions
diff --git a/PerlTQt/t/b_nogui.t b/PerlTQt/t/b_nogui.t
new file mode 100644
index 0000000..cd28260
--- /dev/null
+++ b/PerlTQt/t/b_nogui.t
@@ -0,0 +1,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";
+}