InitiallyI thought I'd start with writing a test in Perl, and I got some basic stuff working. But then I needed to access structures, constants, etc, and had no idea how to do this, so I am now rewriting my test in C. My understanding was that for the most part, the C and Perl testing infrastructure were supposed to be comparable, but I haven't seen any examples of how I can do the things I mentioined (specifically, access constants (flags for functions), or create/read structures required by functions.
Is this possible to do, and if so could someone give me an example of each? The constants are obviously less difficult, in that I could always redefine them in the test, but being able to manipulate structures seems like it would be a requirement for the framework.
Sorry if this is all really straight forward.
Thanks, .Geoff
----------------------------------------------------- Protect yourself from spam, use http://sneakemail.com
On 23 Mar 2002, Geoffrey Hausheer wrote:
InitiallyI thought I'd start with writing a test in Perl, and I got some basic stuff working. But then I needed to access structures, constants, etc, and had no idea how to do this, so I am now rewriting my test in C. My understanding was that for the most part, the C and Perl testing infrastructure were supposed to be comparable, but I haven't seen any examples of how I can do the things I mentioined (specifically, access constants (flags for functions), or create/read structures required by functions.
You can get the constants by doing 'use xxx;' where xxx is the name of the C header that would contain the constants in C. Dor instance:
use winbase; use winuser;
For structures... there was a perl sample that created a Windows that was floating around. But I cannot find it anymore. Does anyone know where it is?
If I remember correctly you are supposed to 'pack' the data so that its layout matches the C structure (and unpack it to get the data). I am not certain if there were plans to provide macros to do this.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Demander si un ordinateur peut penser revient à demander si un sous-marin peut nager.
On Sat, 23 Mar 2002, Francois Gouget wrote: [...]
For structures... there was a perl sample that created a Windows that was floating around. But I cannot find it anymore.
Found it again. I attached it so you can have a look at it. But note that it is based on a very old version of the framework. For instance: * it should not worry about wine::declare and define all the constants itself but instead do: use winuser; use user32; * it should not use printf but ok and trace.
Still, it shows how to 'pack data into a structure' and how to declare callback procedures in perl. These are two useful items that were not in my presentation. About packing data-structures, I don't know if it has been simplified since...
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Linux, WinNT, MS-DOS - also known as the Good, the Bad and the Ugly.