msvcrt _tempnam and tests
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Wed Nov 9 14:34:07 CST 2005
>>>>> "Phil" == Phil Lodwick <Phil.Lodwick at EFI.COM> writes:
Phil> I submitted a patch yesterday for the implementation of _tempnam
Phil> in msvcrt. Today I started to write a conformance test which has
Phil> led to several questions.
Phil> 1) What action should we take if MS documentation and the
Phil> implementation do not agree?
Phil> a) leave out the test b) test to implementation
If a program relies on undocumented features or windows behaving another was
as documented, try to extract that case and code a case for the test
suite. Test that the test tests the right thing on as many windows versions
as possible, at least XP or NT2K3. Win95 is not so high on our list.
If the test is right, submit it for inclusion.
If the undocumented feature is only found by poking around, without any
program found to rely on it, only write a comment.
Phil> 2) If a function takes several parameters, do you test all
Phil> permutations, or just the ones you feel are important?
If your implementation path for the different options is clearly distincted,
permuations are not that nescessary. But if the code pathes interweave, test
more.
At test what you feel important and what applications rely on.
Phil> 3) This question is specific to the implementation of _tempnam.
Phil> The current implementation just calls GetTempFileNameA. My first
Phil> attempt at a patch made things better by calling GetTempFileNameA
Phil> with better parameters. After writing the conformance test,
Phil> however, I see that calling GetTempFileNameA is just plain wrong
Phil> -- for at least two reasons:
Phil> a) GetTempFileNameA truncates prefix to 3 characters,
Phil> _tempnam does not b) GetTempFileNameA adds a ".tmp" extension,
Phil> _tempnam does not.
Phil> Do we just duplicate and modify the kernel TempFileNameA code in
Phil> msvcrt?
Use the source :-)
Bye
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the wine-devel
mailing list