C testing framework. ASCII/Unicode portable version
Andriy Palamarchuk
apa3a at yahoo.com
Wed Jan 23 08:24:06 CST 2002
--- Alexandre Julliard <julliard at winehq.com> wrote:
> If your test does:
>
> foo(_T("abc"))
>
> it essentially does:
>
> fooA("abc")
> fooW(L"abc")
>
> but in most cases since fooA converts the string and
> calls fooW
> already you are not really testing anything more
> than by simply
> calling fooA. This doesn't mean that you shouldn't
> test fooW at all,
> but the interesting thing to do is to test fooW with
> Unicode input. So
> you should do something like:
>
> fooA("abc")
> fooW(L"some unicode chars here")
>
> Now with your solution:
>
> foo(_T("abc"))
> #ifdef UNICODE
> fooW(L"some unicode chars here")
> #endif
>
> the test is more complex to write, it takes twice as
> long to compile
> and run, and it doesn't test more than my version.
Alexandre, you forgot conditional in your test example
and mentioned in mine ;-) With your permission I
rewrite your test:
fooA("abc")
#ifdef UNICODE
fooW(L"some unicode chars here")
#endif
The only differences are that with TCHAR version I
have additional fooW(L"abc") test and have to use
different names. Having at least simple test for
Unicode API is better than having nothing at all.
I don't see how using TCHAR will prevent you from
writing Unicode-specific tests.
> You will never test interesting combinations like
> CreateEventA/OpenEventW
> because it's a big pain to write.
Exactly the same for your tests. See above.
> > Using TCHAR insures that A and W functions have
> the
> > same behaviour.
> > Why you are against using the same code for this
> and
> > using encoding-specific code to check the
> differences?
>
> Because it makes writing a small subset of tests
> slightly easier at
> the cost of making the really interesting tests much
> more painful to
> write. Not a good trade-off.
IMHO we don't have this issue. As you agreed we have
advantages with simple boring tests, but complexity
writing "really interesting tests" is exactly the
same.
However, I agree that we have different tradoff with
TCHAR - more complex build process, but this is not
such a big problem.
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