aboutsummaryrefslogtreecommitdiff
path: root/Perl/t
diff options
context:
space:
mode:
authormertz2004-09-01 08:57:32 +0000
committermertz2004-09-01 08:57:32 +0000
commit68c6677d32eccb922b1252bcae224e503d766f0e (patch)
treece670dde1a75f042150e4d667d3019f93cd9104c /Perl/t
parentc34f18dac972708b1d3ef3249c8528845ab837e4 (diff)
downloadtkzinc-68c6677d32eccb922b1252bcae224e503d766f0e.zip
tkzinc-68c6677d32eccb922b1252bcae224e503d766f0e.tar.gz
tkzinc-68c6677d32eccb922b1252bcae224e503d766f0e.tar.bz2
tkzinc-68c6677d32eccb922b1252bcae224e503d766f0e.tar.xz
adding/correcting some tests for flight/waypoint/tabular label or fields bbox
Diffstat (limited to 'Perl/t')
-rw-r--r--Perl/t/Bbox.t54
1 files changed, 39 insertions, 15 deletions
diff --git a/Perl/t/Bbox.t b/Perl/t/Bbox.t
index b6f5419..9faaf28 100644
--- a/Perl/t/Bbox.t
+++ b/Perl/t/Bbox.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# $Id: Bbox.t,v 1.3 2004-05-26 20:32:45 mertz Exp $
+# $Id: Bbox.t,v 1.4 2004-09-01 08:57:32 mertz Exp $
# Author: Christophe Mertz
#
@@ -9,7 +9,7 @@
BEGIN {
if (!eval q{
- use Test::More tests => 8;
+ use Test::More tests => 12;
1;
}) {
print "# tests only work properly with installed Test::More module\n";
@@ -112,16 +112,21 @@ ok(&similarFlatArray ([$zinc->bbox($txt4)],
### testing bbox of fields or labels of track/waypoint and tabular items
my $track = $zinc->add('track', 1, 4, -position => [56, 78]);
-print "bbox=(", join(',', $zinc->bbox(-label, $track)),")\n";
-is_deeply ([ $zinc->bbox(-label, $track) ],
- [ ],
- "bbox of a track label without labelformat");
+#print "bbox1=(", join(',', $zinc->bbox(-label, $track)),")\n";
+
+TODO: {
+ local $TODO = "bbox apparently still not correct in this case";
+ is_deeply([ $zinc->bbox(-label, $track) ],
+ [ ],
+ "bbox of a track label without labelformat");
+}
#print "bbox=(", join(',', $zinc->bbox(-field, 2, $track)),")\n";
is_deeply ([ $zinc->bbox(-field, 2, $track) ],
[ ],
"bbox of a track field without labelformat");
+
$zinc->itemconfigure($track, -labelformat => 'x20x18+0+0');
#print "bbox=(", join(',', $zinc->bbox(-label, $track)),")\n";
@@ -129,17 +134,36 @@ $zinc->itemconfigure($track, -labelformat => 'x20x18+0+0');
#print "bbox=(", join(',', $zinc->bbox(-field, 4, $track)),")\n";
is_deeply ([ $zinc->bbox(-field, 4, $track) ],
[ ],
- "bbox of a empty track field");
+ "bbox of an empty track field");
+
+my $wpt = $zinc->add('waypoint', 1, 0, -position => [561, 781]);
+#print "wpt bbox=(", join(',', $zinc->bbox($wpt)),")\n";
+ok(&similarFlatArray ([ $zinc->bbox($wpt) ],
+ [ 561,781, 561,781],
+ [4,4, 4,4],
+ ),
+ "coords of a waypoint without label");
+
+
+my $tab = $zinc->add('tabular', 1, 1, -position => [61, 81]);
+is_deeply([ $zinc->bbox($tab) ],
+ [ ],
+ "bbox of a tabular without labelformat");
+
+TODO: {
+ local $TODO = "bbox apparently still not correct in this case";
+#print "tab bbox=(", join(',', $zinc->bbox(-label, $tab)),")\n";
+is_deeply([ $zinc->bbox(-label, $tab) ],
+ [ ],
+ "bbox of a tabular without labelformat");
+}
+
+#print "tab bbox=(", join(',', $zinc->bbox(-field, 0, $tab)),")\n";
+is_deeply([ $zinc->bbox(-field, 0, $tab) ],
+ [ ],
+ "bbox of a tabular field without labelformat");
-# my $wpt = $zinc->add('waypoint', 1, 0, -position => [561, 781]);
-# is_deeply([ $zinc->coords($wpt) ],
-# [ 561,781 ],
-# "coords of a waypoint");
-# my $tab = $zinc->add('tabular', 1, 1, -position => [61, 81]);
-# is_deeply([ $zinc->coords($tab) ],
-# [ 61,81 ],
-# "coords of a empty tabular");
# $zinc->itemconfigure($tab, -labelformat => 'x20x18+0+0');
# is_deeply([ $zinc->coords($tab) ],
# [ 61,81 ],