So I've finally started writing tests for functions that have both Unicode and Ascii equivalents, and I'm wondering how to write the tests. I re-read the thread about this that occurred back in January, and there didn't seem to be a clear decision.
With the current framework, it doesn't appear to be possible to just write one test, and have it build both unicode and ascii versions, and it seems like at least Alexandre was strongly against this anyway.
But in my case, I know nothing at all about writing Unicode tests, or how to explicitly test unicode functionality, so I see that I have three options: 1) Don't write any 'W' tests, and use only 'A' functions in my tests 2) Duplicate my 'A' tests as 'W' tests, and acknowledge that there is likely Unicode specific stuff that is not tested 3) Learn something about Unicode, and figure out how to test the functions correctly.
Now obvioulsy (3) is the best choice, but honestly, I am not motivated towards this at the moment. Which leaves (1) and (2), with (2) being the way I'm leaning. But the tests are getting really big, and pretty messy, and duplicating them and managing both versions looks like a nightmare (there are lots of TODOs, and I expect the tests to behave differently on different OS).
So what is the recomendation that I do? In the simplest case, I can just copy the Ascii test to a new file and replace all 'A' with 'W', and just keep the tests seperated that way.
Anyhow, any comments would be appreciated.
Thanks, .Geoff
A couple comments: 1) it is useful to check intermixed API calls, like A->W->A to be sure they do conversions correctly. 2) while testing W functions use some Unicode symbols which do not have corresponding ASCII symbols.
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/
On Mon, 8 Apr 2002, Andriy Palamarchuk wrote:
A couple comments:
- it is useful to check intermixed API calls, like
A->W->A to be sure they do conversions correctly. 2) while testing W functions use some Unicode symbols which do not have corresponding ASCII symbols.
Could you give a couple examples of these Unicode symbols? I know that I would be hard-pressed to make up a Unicode string with anything significant. But if I had an example to base my code on, integrating it into my own tests should be trivial.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ 1 + e ^ ( i * pi ) = 0
One thing you may try are the explicit BiDi specifiers (Right to left, left to right etc.). These are Unicode characters designed to explicitly specify the direction of otherwise amigious characters.
Ansii does not have, to the best of my knowledge, an equivalent encoded characters.
Shachar
Francois Gouget wrote:
On Mon, 8 Apr 2002, Andriy Palamarchuk wrote:
A couple comments:
- it is useful to check intermixed API calls, like
A->W->A to be sure they do conversions correctly. 2) while testing W functions use some Unicode symbols which do not have corresponding ASCII symbols.
Could you give a couple examples of these Unicode symbols? I know that I would be hard-pressed to make up a Unicode string with anything significant. But if I had an example to base my code on, integrating it into my own tests should be trivial.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ 1 + e ^ ( i * pi ) = 0
On Sun, 14 Apr 2002, Shachar Shemesh wrote:
One thing you may try are the explicit BiDi specifiers (Right to left, left to right etc.). These are Unicode characters designed to explicitly specify the direction of otherwise amigious characters.
Ansii does not have, to the best of my knowledge, an equivalent encoded characters.
But what would these Unicode characters look like? I.e. what would I write in my code:
const WCHAR test_string[]={'???','???','???'};
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Broadcast message : fin du monde dans cinq minutes, repentez vous !