C testing framework. ASCII/Unicode portable version
Andriy Palamarchuk
apa3a at yahoo.com
Tue Jan 22 10:24:33 CST 2002
--- "Dimitrie O. Paun" <dimi at cs.toronto.edu> wrote:
> I have a number of observations:
> -- we should rename wt_helper.h to something like
> wine/tests.h
I'm open for suggestions. I used this name to avoid
name clashes with Perl winetest framework. BTW, wt =
Wine Test.
I'd prefer more recognizable name than "test.h".
> -- maybe we should not use main as the main
> funtion,
> but rather something like 'test'. This way we
> can
> provide the main and have another level of
> indirection which can be put to good use.
> (like we should not need the explicit
> end_tests())
> -- another thing we can do is to have the tests in
>
> functions named testXXX. This way we can use nm
> to generate the main function, and so we can
> put
> a bunch of tests in the same executable.
Whether we'll use these ideas depends on architecture
of the whole testing process.
> -- wt_helper.h should include tchar.h, and
> redefine
> _T to call a function to transform the string
> to
> Unicode if need be. This way we get rid of the
> compiler requirement.
Using function instead of macro won't work in all the
cases, e.g. in this one:
_TCHAR buf[100] = _T("foo")
> -- 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()?
> -- if TCHAR is not available, we should
> typedef _TCHAR TCHAR
> in wine/tests.h
Yes, we'll be able to do this. I came across opposite
situation. Cygwin has TCHAR, but not _TCHAR. Already
submitted bug report to cygwin project.
AFAICS TCHAR and _TCHAR have almost the same
semantics.
MBCS Survival Guide at
http://www.microsoft.com/globaldev/fareast/mbcssg.asp
says:
"For ANSI conformance, the "official" type is _TCHAR.
In practice, either TCHAR or _TCHAR is acceptable."
> -- Why do you do:
> _T(__FILE__)
> Files are ASCII, no need to _T them.
__FILE__is a macro which is expanded to file name. I
use _T with it for simplicity - to have the same
ASCII/Unicode mode processing for everything.
Otherwise I'd have to explicitely call ASCII functions
for file names processing, probably do A->W
conversion.
> More comments later :)
Look forward :-)
Andriy Palamarchuk
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
More information about the wine-devel
mailing list