[PATCH] msvcr120/tests: Add critical section test.
YongHao Hu
christopherwuy at gmail.com
Tue Mar 22 11:28:40 CDT 2016
Hi Piotr,
On 16/3/22 下午10:29, Piotr Caban wrote:
> Hi YongHao,
>
> On 03/18/16 17:24, YongHao Hu wrote:
>> dlls/msvcr120/tests/msvcr120.c | 300
>> +++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 300 insertions(+)
> I don't think this is a good approach for adding tests of
> critical_section class. Executing tons of enter/leave calls is not
> really testing much. Your test_critical_section_lock tests will
> probably pass if you comment all critical section related calls out
> (it passed on my computer in 10 consecutive runs, never failed,
> probably it's because the code was optimized during compilation).
> Testing 5s/6s timeouts is also not a good idea. Because of it the
> tests are running much longer.
How long is a test running acceptable? I want to know a appropriate
standard.
>
> It would be much better if you test following things:
> - just check some basic functionality of enter/leave: enter cs in
> main thread, start new thread that tries to enter it as well, wait for
> 100ms and check that it was not able to enter the cs, then leave cs in
> main thread and wait for thread to enter cs and finish
> - check some basic functionality of try_lock: use it to lock the cs,
> check if it fails on locked cs
Thank you for your comment, it's of great help. I will try it.
>
> Also the tests failed on testbot, I was not checking why.
The tests failed on w2008s64(64bit msvcr120), however, it succeed on
32bit msvcr120.
I did not figure out this.
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160323/032f051d/attachment.html>
More information about the wine-devel
mailing list