POV-Ray : Newsgroups : povray.off-topic : Unit testing - simple question with long explanation for discussion... : Re: Unit testing - simple question with long explanation for discussion... Server Time
9 Oct 2024 14:32:26 EDT (-0400)
  Re: Unit testing - simple question with long explanation for discussion...  
From: Invisible
Date: 9 Jan 2009 04:25:09
Message: <496717f5$1@news.povray.org>
Darren New wrote:
> Orchid XP v8 wrote:
>>> Look, you have to figure out every possible case to *write* the code, 
>>> yes?
>>
>> Yeah. But you sit down and write some code which you think should 
>> work, and then you have to write lots of test cases for
>>
>> - Does it fail on a zero-length literal name. [The spec explicitly 
>> *allows* such names.]
>> - Does it correctly handle [what would otherwise be] comments inside a 
>> literal string?
>> - Does it choke if the input contains a comment [and so is non-empty] 
>> but no further actual tokens?
>> - Does it parse all possible reals, but not invalid ones such as "." 
>> and "e1"?
>> - Does it handle balanced brackets and escaped brackets in strings?
> 
> There's a good start. Why do you think it's hard?

Because the list is wildly incomplete. Figuring out how to make a 
*complete* list is absurdly hard.

> Testing doesn't prove the absence of bugs, only the presence of bugs.

Sure. But I'd like to reveal as many bugs as possible, so...

>> I'm not aware of any Adobe implementation that's freely available. 
> 
> Ghostscript would probably do pretty close, then. :-)

Yeah, that's what I'm ending up using. (Ghostscript seems to correctly 
process just about every *real* page description I've ever come across, 
so I guess it's not too bad a comparison.)

>> (Except perhaps for the one inside the nearest laser printer. 
> 
> That one was far from free. :-)

Ah, but for me? ;-) I didn't pay...

>> already tried to get that to parse stuff; it didn't seem to want to do 
>> it for some reason.)
> 
> Sometimes you need to wrap it up in actual page description stuff, by 
> which I mean the magic comments that mark the start and end of pages and 
> such.

Nope. If I send it a PostScript program that draws some coloured lines 
and stuff, it spits out a piece of paper with lines drawn on it. If I 
send it another PostScript program [which also works fine in 
Ghostscript] that parses a string and writes the results onto the 
page... the printer appears to not receive the data. Really weird.

(And if I send a PostScript program containing deliberate errors, the 
printer prints out a page with an error message on it.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.