I submitted a patch yesterday for the implementation of _tempnam in msvcrt. Today I started to write a conformance test which has led to several questions.
1) What action should we take if MS documentation and the implementation do not agree?
a) leave out the test b) test to implementation
2) If a function takes several parameters, do you test all permutations, or just the ones you feel are important?
3) This question is specific to the implementation of _tempnam. The current implementation just calls GetTempFileNameA. My first attempt at a patch made things better by calling GetTempFileNameA with better parameters. After writing the conformance test, however, I see that calling GetTempFileNameA is just plain wrong -- for at least two reasons:
a) GetTempFileNameA truncates prefix to 3 characters, _tempnam does not b) GetTempFileNameA adds a ".tmp" extension, _tempnam does not.
Do we just duplicate and modify the kernel TempFileNameA code in msvcrt?
Thanks, Phil
From: "Phil Lodwick" Phil.Lodwick@EFI.COM
- What action should we take if MS documentation and the implementation
do
not agree?
just test to implementation.
- If a function takes several parameters, do you test all permutations,
or
just the ones you feel are important?
As much as possible, within reason. I guess this means "the ones you feel are important" :)
- This question is specific to the implementation of _tempnam. The
current
implementation just calls GetTempFileNameA. My first attempt at a patch
made
things better by calling GetTempFileNameA with better parameters. After writing the conformance test, however, I see that calling GetTempFileNameA
is
just plain wrong -- for at least two reasons:
Yeah, just duplicate TempFileNameA code in msvcrt, and change it accordingly.
"Phil" == Phil Lodwick Phil.Lodwick@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