On 04.04.2015 10:03, Jianqiu Zhang wrote:
- trace("TotalAllocationUnits %08x %08x\n", fsi.TotalAllocationUnits.HighPart, fsi.TotalAllocationUnits.LowPart);
- trace("CallerAvailableAllocationUnits %08x %08x\n", fsi.CallerAvailableAllocationUnits.HighPart, fsi.CallerAvailableAllocationUnits.LowPart);
- trace("ActualAvailableAllocationUnits %08x %08x\n", fsi.ActualAvailableAllocationUnits.HighPart, fsi.ActualAvailableAllocationUnits.LowPart);
- trace("SectorsPerAllocationUnit %08x\n", fsi.SectorsPerAllocationUnit);
- trace("BytesPerSector %08x\n", fsi.BytesPerSector);
Hi, Jianqiu.
This is not exactly a test, as you're just printing a result. Same thing with patch 3/4. Also to print LONGLONG values you use wine_dbgstr_longlong() probably.
At 2015-04-04 15:17:13, "Nikolay Sivov" bunglehead@gmail.com wrote:
Hi, Jianqiu.
This is not exactly a test, as you're just printing a result. Same thing with patch 3/4. Also to print LONGLONG values you use wine_dbgstr_longlong() probably.
Hi~ Nikolay In fact , this is my first time to submit a patch to wine community :) I have a few questions to ask
What does a test do? I thought test functions is a kind of implementation of WinAPI . I write test function and build cross test executable file and then run on Windows to get some data I need . Then I can write the FileFsFullSizeInformation based on these data
And you said that what I wrote is not a test.Does it mean I should test whether my new function works well? Should I use ok and todo macro to make my test convincing?
If I doesn't make my self clear enough~ would you please let me know and I will try to make myself clear enough.
Thanks~
On 04.04.2015 11:07, Jianqiu Zhang wrote:
At 2015-04-04 15:17:13, "Nikolay Sivov" bunglehead@gmail.com wrote:
Hi, Jianqiu.
This is not exactly a test, as you're just printing a result. Same thing with patch 3/4. Also to print LONGLONG values you use wine_dbgstr_longlong() probably.
Hi~ Nikolay In fact , this is my first time to submit a patch to wine community :) I have a few questions to ask
That's perfectly normal, and you're welcome to ask.
What does a test do? I thought test functions is a kind of implementation of WinAPI . I write test function and build cross test executable file and then run on Windows to get some data I need . Then I can write the FileFsFullSizeInformation based on these data
Test calls some function or a set of functions, then checks for function output (could be return value or out arguments, or something indirectly affected by this call) using ok() statements. Then like you said, you make sure test works on Windows and then you make it work on Wine.
And you said that what I wrote is not a test.Does it mean I should test whether my new function works well? Should I use ok and todo macro to make my test convincing?
What I mean is that your test is supposed to actually check what function returns, not just print a result. Because if it only prints something we don't know if it's working or not, and tests output is not supposed to be visually examined. Basically you should use ok() for that.
At 2015-04-04 16:15:54, "Nikolay Sivov" bunglehead@gmail.com wrote:
On 04.04.2015 11:07, Jianqiu Zhang wrote:
At 2015-04-04 15:17:13, "Nikolay Sivov" bunglehead@gmail.com wrote:
Hi, Jianqiu.
This is not exactly a test, as you're just printing a result. Same thing with patch 3/4. Also to print LONGLONG values you use wine_dbgstr_longlong() probably.
Hi~ Nikolay I tried to use wine_dbgstr_longlong to print LONGLONG values the code is shown below:
trace("TotalAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.TotalAllocationUnits)); trace("CallerAvailableAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.CallerAvailableAllocationUnits)); trace("ActualAvailableAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.ActualAvailableAllocationUnits));
And then when I run make test , the process occurs some errors ,the error log is shown below:
dlls/ntdll/tests/file.c:1232: undefined reference to `wine_dbgstr_longlong' dlls/ntdll/tests/file.c:1233: undefined reference to `wine_dbgstr_longlong' dlls/ntdll/tests/file.c:1234: undefined reference to `wine_dbgstr_longlong'
I think it's because there is no compiled object file that contain wine_dbgstr_longlong function. and i try to include wine/debug.h in file.c . But the problem still exists. And error log like this
n file included from file.c:40:0: ../../../include/wine/debug.h:31:2: error: #error This file should not be used in Wine tests #error This file should not be used in Wine tests ^ ../../../include/wine/debug.h:181:27: error: redefinition of ‘wine_dbgstr_w’ static inline const char *wine_dbgstr_w( const WCHAR *s ) ^ In file included from file.c:36:0: ../../../include/wine/test.h:69:27: note: previous definition of ‘wine_dbgstr_w’ was here static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } ^ In file included from file.c:40:0: ../../../include/wine/debug.h:186:27: error: static declaration of ‘wine_dbgstr_guid’ follows non-static declaration static inline const char *wine_dbgstr_guid( const GUID *id ) ^ In file included from file.c:36:0: ../../../include/wine/test.h:68:20: note: previous declaration of ‘wine_dbgstr_guid’ was here extern const char *wine_dbgstr_guid( const GUID *guid ); ^ file.c: In function ‘test_file_full_size_information’: file.c:1233:5: error: incompatible type for argument 1 of ‘wine_dbgstr_longlong’ trace("TotalAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.TotalAllocationUnits)); ^ In file included from file.c:40:0: ../../../include/wine/debug.h:215:27: note: expected ‘ULONGLONG’ but argument is of type ‘LARGE_INTEGER’ static inline const char *wine_dbgstr_longlong( ULONGLONG ll ) ^ file.c:1234:5: error: incompatible type for argument 1 of ‘wine_dbgstr_longlong’ trace("CallerAvailableAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.CallerAvailableAllocationUnits)); ^ In file included from file.c:40:0: ../../../include/wine/debug.h:215:27: note: expected ‘ULONGLONG’ but argument is of type ‘LARGE_INTEGER’ static inline const char *wine_dbgstr_longlong( ULONGLONG ll ) ^ file.c:1235:5: error: incompatible type for argument 1 of ‘wine_dbgstr_longlong’ trace("ActualAvailableAllocationUnits 0x%s\n", wine_dbgstr_longlong(fsi.ActualAvailableAllocationUnits)); ^ In file included from file.c:40:0: ../../../include/wine/debug.h:215:27: note: expected ‘ULONGLONG’ but argument is of type ‘LARGE_INTEGER’ static inline const char *wine_dbgstr_longlong( ULONGLONG ll )
Could you please give me an explaination on why I cannot use wine_dbgstr_longlong ? Thanks~