On 2/13/07, Paul Alfille <[EMAIL PROTECTED]> wrote:
>  Pedro, your note suggests the answer!
>
>  While --fake is good for random responses, we want predictable responses to
> test against.
>
>  How about --tester as a simulated adapter.
>  1. It would return known devices
>  2. It would return known values for device properties
>  3. There would be a predicatable algorithm for repeated invocations.

This seems about perfect. I was going to hack together a mock server
but this is much better.

>  Something like:
>  --tester=10
>  would give device 10.NNNNXXMMMMCC where
>    NNNN is the bus number (in hex)
>    CC is the XOR of the family code (EF in this case)
>    MMMM is the index of this device on this bus (0000 for first device, 0001
> for second device,...
>    CC is the CRC8
>
>  Values returned would be:
>   Integers: family_code+MMMM+NNNN (All converted to decimal)
>   Yes-No: (family_code+MMMM+NNNN) is odd (true) or even (false)
>    Foating point: family_code+MMMM+NNNN / 10
>    Binary: MMMMNNNNMMMMNNNN....

These details I'm not fit to judge. I haven't studied enough of the
owfs architecture and the hardware details to know.

>  This would have all the advantages of --fake and allow rather intricate
> unit testing.
>
>  Any suggestions before I start coding?

Have you thought about writable atributes? For full testing the --test
device must actually save the value and return it if it's read.

Pedro.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to