Negative test cases

Ian Hickson ian at hixie.ch
Sat Feb 4 11:31:19 EST 2006


On Thu, 2 Feb 2006, Cameron McCormack wrote:
>
> Due to this[1], I think constructing test cases for when the document 
> should be in error is more difficult than it otherwise would have been 
> (assuming correct error processing).  For example, it would have been 
> good if a circle with an invalid 'r' attribute could be tested like 
> this:
> 
>   <svg ...>
>     <rect width="100" height="100" fill="green"/>
>     <circle cx="0" cy="0" r="-1" fill="red"/>
>     <rect width="100" height="100" fill="red"/>
>   </svg>

This document isn't in error. There is only one correct rendering of this 
document according to SVG Tiny 1.2, and it is the same as this one:

   <svg ...>
     <rect width="100" height="100" fill="green"/>
     <circle cx="0" cy="0"        fill="red"/>
     <rect width="100" height="100" fill="red"/>
   </svg>


> So because the rendering could actually be anything, I want to ask for 
> opinions on the best way to handle "in error" tests, both from an 
> automated and manual testing point of view.  Manually, I'm not sure that 
> anything other than specifying in the documentation that "you should see 
> the error reported by the UA".  Automated testing could be ok, as long 
> as the test specified that it was one that is passed if the document 
> becomes "in error" (so the test engine would need to instrument the UA 
> to determine this), rather than by rendering comparisons or script 
> informing a test engine that it passed.

To be honest I can't find any way to make an SVG Tiny 1.2 document be "in 
error" according to the spec, so this may be a moot point.

What cases have you found where an SVG Tiny 1.2 document is in error?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the discussion mailing list