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.