C testing framework. ASCII/Unicode portable version

Francois Gouget fgouget at free.fr
Tue Jan 22 12:11:30 CST 2002


   Just commenting from the side-lines :-)


On Tue, 22 Jan 2002, Andriy Palamarchuk wrote:
[...]
> Using function instead of macro won't work in all the
> cases, e.g. in this one:
>
> _TCHAR buf[100] = _T("foo")

   I would rather avoid such constructs precisely because of the
compiler support problems. We have to support _T because of legacy
windows code, but if we write the code then it should be very easy to
avoid its use entirely:


_TCHAR buf[100];
.... and at the start of the functions using buf:
{

   unicode(buf,sizeof(buf),"foo");
...

or as a macro:
   STR2UNICODE(buf,"foo");

   with a secondary use as:

   wstr=unicode(NULL,0,"foo"); // allocate and return a unicode string


> >   -- I still think my teststr() idea is worth doing.
> >      Do you want an implementation?
>
> I like the idea, but do not need such Unicode strings
> generator for my test :-) Can you implement it with a
> small real test which shows advantages of teststr()?

   I like the teststr() idea too. It's a bit complex but it sounds like
it could help write better tests.



--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
        It really galls me that most of the computer power in the world
                          is wasted on screen savers.
                     Chris Caldwell from the GIMPS project
                       http://www.mersenne.org/prime.htm





More information about the wine-devel mailing list