[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/test/gzz/vob textvob.test
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz/test/gzz/vob textvob.test |
Date: |
Thu, 21 Nov 2002 09:59:44 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 02/11/21 09:59:43
Modified files:
test/gzz/vob : textvob.test
Log message:
Tests TextBox.getWidth(), getHeight() and getDepth() with different
scales, fails with AWT.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/vob/textvob.test.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
Patches:
Index: gzz/test/gzz/vob/textvob.test
diff -u gzz/test/gzz/vob/textvob.test:1.9 gzz/test/gzz/vob/textvob.test:1.10
--- gzz/test/gzz/vob/textvob.test:1.9 Thu Nov 21 09:24:52 2002
+++ gzz/test/gzz/vob/textvob.test Thu Nov 21 09:59:43 2002
@@ -38,46 +38,45 @@
"""Tests that TextVob is drawn with the width and height
that it claims with getWidth() and getHeight().
- fail: *
+ fail: AWT
"""
- vs = getvs()
- size = vs.getSize()
- vs.map.put(gzz.vob.vobs.SolidBgVob(Color.red))
+ for text_scale in range(1,5):
+ vs = getvs()
+ size = vs.getSize()
+ vs.map.put(gzz.vob.vobs.SolidBgVob(Color.red))
+ textvob = gzz.vob.vobs.TextVob(sty1, "XÄjÖgqÅypX")
- textvob = gzz.vob.vobs.TextVob(sty1, "XÄjÖgqÅypX")
- text_scale = 1
+ text_width = int(textvob.getWidth(text_scale))
+ text_height = int(textvob.getHeight(text_scale))
+ text_depth = int(textvob.getDepth(text_scale))
- text_width = int(textvob.getWidth(text_scale))
- text_height = int(textvob.getHeight(text_scale))
- text_depth = int(textvob.getDepth(text_scale))
+ cs = vs.orthoBoxCS(0, "window", 0, 100, 100, 1, 1, size.width,
size.height)
+ cs_text = vs.orthoCS(cs, "text", 0, 0, 0, text_height + text_depth,
text_height + text_depth)
+ vs.map.put(textvob, cs_text)
+ render(vs)
- cs = vs.orthoBoxCS(0, "window", 0, 100, 100, 1, 1, size.width,
size.height)
- cs_text = vs.orthoCS(cs, "text", 0, 0, 0, text_height + text_depth,
text_height + text_depth)
- vs.map.put(textvob, cs_text)
- render(vs)
+ """The top edge."""
+ checkNotAvgColor(100, 100, text_width, 10, (255, 0, 0), delta=1)
- """The top edge."""
- checkNotAvgColor(100, 100, text_width, 10, (255, 0, 0), delta=1)
+ """The left edge."""
+ checkNotAvgColor(100, 100, 10, text_height+text_depth, (255, 0, 0),
delta=1)
- """The left edge."""
- checkNotAvgColor(100, 100, 10, text_height+text_depth, (255, 0, 0),
delta=1)
+ """The right edge."""
+ checkNotAvgColor(100+text_width-10, 100, 10, text_height+text_depth,
(255, 0, 0), delta=1)
- """The right edge."""
- checkNotAvgColor(100+text_width-10, 100, 10, text_height+text_depth, (255,
0, 0), delta=1)
+ """The bottom edge."""
+ checkNotAvgColor(100, 100+text_height-1, text_width, text_depth+1,
(255, 0, 0), delta=1)
- """The bottom edge."""
- checkNotAvgColor(100, 100+text_height-1, text_width, text_depth+1, (255,
0, 0), delta=1)
+ """The top side."""
+ checkAvgColor(100, 100-10, text_width, 10, (255, 0, 0), delta=1)
- """The top side."""
- checkAvgColor(100, 100-10, text_width, 10, (255, 0, 0), delta=1)
+ """The left side."""
+ checkAvgColor(100-10, 100, 10, text_height+text_depth, (255, 0, 0),
delta=1)
- """The left side."""
- checkAvgColor(100-10, 100, 10, text_height+text_depth, (255, 0, 0),
delta=1)
+ """The right side."""
+ checkAvgColor(100+text_width+1, 100, 10, text_height+text_depth, (255,
0, 0), delta=1)
- """The right side."""
- checkAvgColor(100+text_width+1, 100, 10, text_height+text_depth, (255, 0,
0), delta=1)
-
- """The bottom side."""
- checkAvgColor(100, 100+text_height+text_depth+1, text_width, 10, (255, 0,
0), delta=1)
+ """The bottom side."""
+ checkAvgColor(100, 100+text_height+text_depth+1, text_width, 10, (255,
0, 0), delta=1)
# : vim: set syntax=python :