[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/test/gzz gfx/gl/glvobcoorder.test vob/textv...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/test/gzz gfx/gl/glvobcoorder.test vob/textv... |
Date: |
Sat, 19 Oct 2002 10:29:54 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/19 10:29:54
Modified files:
test/gzz/gfx/gl: glvobcoorder.test
test/gzz/vob : textvob.test
Log message:
Some unit tests that were failing before the changes I just committed
(oops, wrong order)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/vob/textvob.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -c gzz/test/gzz/gfx/gl/glvobcoorder.test:1.10
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.11
*** gzz/test/gzz/gfx/gl/glvobcoorder.test:1.10 Tue Oct 15 11:00:38 2002
--- gzz/test/gzz/gfx/gl/glvobcoorder.test Sat Oct 19 10:29:54 2002
***************
*** 10,15 ****
--- 10,22 ----
for i in range(0, len(src)):
failIf(abs(dst[i]-dstlist[i]) > delta, str([srclist, dstlist, dst, i,
dst[i], dstlist[i]]))
+ def checkInterp(c1, c2, i, fract, cs, srclist, dstlist, delta=0):
+ src = array(srclist, 'f')
+ dst = zeros(len(src), 'f')
+ failUnless(c1.transformPoints3_interp(i, c2, fract, 0, cs, src, dst))
+ for i in range(0, len(src)):
+ failIf(abs(dst[i]-dstlist[i]) > delta, str([srclist, dstlist, dst, i,
dst[i], dstlist[i]]))
+
def testTransform():
c = GLVobCoorder()
***************
*** 84,86 ****
--- 91,126 ----
checkInverse(c, cs_dist)
+ interp = zeros(1000, 'i')
+ interp[0] = 999
+ c1 = GLVobCoorder()
+ c2 = GLVobCoorder()
+
+ def testInterpolateTranslation():
+
+ cs_trans1 = c1.translate(0, 10, 10)
+ cs_trans2 = c2.translate(0, 100, 20)
+
+ interp[cs_trans1] = cs_trans2
+ checkInterp(c1, c2, interp, .5, cs_trans1,
+ [0, 0, 0],
+ [55, 15, 0]
+ )
+
+ def testInterpolateBuoy():
+
+ cs_anchor = c1.translate(0, 10, 0)
+ cs_b1 = c1.buoyOnCircle(0, cs_anchor, 0, 0, 20, -20, 0, 1)
+
+ checkTrans(c1, cs_b1,
+ [0, 0, 0],
+ [20, 0, 0],
+ .1)
+
+ cs_b2t = c2.affineCoordsys(0, 0, 200, 200, 1, 0, 0, 1)
+ interp[cs_b1] = cs_b2t
+
+ checkInterp(c1, c2, interp, .5, cs_b1,
+ [0, 0, 0],
+ [110, 100, 0],
+ .1)
Index: gzz/test/gzz/vob/textvob.test
diff -c gzz/test/gzz/vob/textvob.test:1.1 gzz/test/gzz/vob/textvob.test:1.2
*** gzz/test/gzz/vob/textvob.test:1.1 Wed Oct 16 03:46:39 2002
--- gzz/test/gzz/vob/textvob.test Sat Oct 19 10:29:54 2002
***************
*** 7,12 ****
--- 7,28 ----
from java.awt import Color
sty1 = win.getGraphicsAPI().getTextStyle("SansSerif", 0, 20)
+ sty2 = win.getGraphicsAPI().getTextStyle("SansSerif", 0, 50)
+ sty3 = win.getGraphicsAPI().getTextStyle("SansSerif", 0, 10)
+
+ def testStyleSize():
+ """Test that the different styles give out suitable heights.
+ """
+ failUnlessApprox(4, sty1.getHeight(1), 20)
+ failUnlessApprox(15, sty2.getHeight(1), 50)
+ failUnlessApprox(4, sty3.getHeight(1), 10)
+
+ failUnlessApprox(10, sty1.getHeight(2), 40)
+ failUnlessApprox(25, sty2.getHeight(2), 100)
+ failUnlessApprox(8, sty3.getHeight(2), 20)
+
+ failUnlessApprox(20, sty2.getWidth("xx", 1), 50)
+ failUnlessApprox(4, sty3.getWidth("xx", 1), 10)
def testSize():
"""Test, for various box sizes, that text consisting of
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/test/gzz gfx/gl/glvobcoorder.test vob/textv...,
Tuomas J. Lukka <=