svnno****@sourc*****
svnno****@sourc*****
2011年 1月 17日 (月) 23:41:02 JST
Revision: 2308 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2308 Author: dhrname Date: 2011-01-17 23:41:02 +0900 (Mon, 17 Jan 2011) Log Message: ----------- SVGMatrixに関するスペックを追加 Modified Paths: -------------- trunk/Spec/SvgDomSpec.js Modified: trunk/Spec/SvgDomSpec.js =================================================================== --- trunk/Spec/SvgDomSpec.js 2011-01-17 11:41:59 UTC (rev 2307) +++ trunk/Spec/SvgDomSpec.js 2011-01-17 14:41:02 UTC (rev 2308) @@ -165,5 +165,36 @@ } t = null; }); + describe("SVG Unit :: SVG Matrix", function() { + var s; + beforeEach(function() { + s = svg.createSVGMatrix(); + }); + it("for the default value on the property of SVGMtrix", function() { + /*See http://www.w3.org/TR/SVG/struct.html#InterfaceSVGSVGElement + * The object is initialized to the identity matrix. + */ + expect(s.a).toEqual(1); + expect(s.b).toEqual(0); + expect(s.c).toEqual(0); + expect(s.d).toEqual(1); + expect(s.e).toEqual(0); + expect(s.f).toEqual(0); + }); + /*境界条件を調べておく (limit value analysis)*/ + it("should be this for the value, when it calls a 'multiply' method", function() { + var t = [Number.MAX_VALUE, Number.MIN_VALUE, 0, Number.MAX_VALUE/2, Number.MIN_VALUE/2]; + for (var i=0,tli=t.length;i<tli;++i) { + var n = svg.createSVGMatrix(); + n.a = t[i]; + n.b = t[i]; + n.c = t[i]; + n.d = t[i]; + n.e = t[i]; + s.multiply(n); + } + t = null; + }); + }); }); }); \ No newline at end of file