<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Piotr,<br>
    <br>
    <div class="moz-cite-prefix">On 16/3/22 下午10:29, Piotr Caban wrote:<br>
    </div>
    <blockquote cite="mid:56F156BD.7000506@gmail.com" type="cite">Hi
      YongHao,
      <br>
      <br>
      On 03/18/16 17:24, YongHao Hu wrote:
      <br>
      <blockquote type="cite">  dlls/msvcr120/tests/msvcr120.c | 300
        <br>
        +++++++++++++++++++++++++++++++++++++++++
        <br>
          1 file changed, 300 insertions(+)
        <br>
      </blockquote>
      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). </blockquote>
    <blockquote cite="mid:56F156BD.7000506@gmail.com" type="cite">Testing
      5s/6s timeouts is also not a good idea. Because of it the tests
      are running much longer.
      <br>
    </blockquote>
    How long is a test running acceptable? I want to know a appropriate
    standard. <br>
    <br>
    <blockquote cite="mid:56F156BD.7000506@gmail.com" type="cite">
      <br>
      It would be much better if you test following things:
      <br>
       - 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
      <br>
       - check some basic functionality of try_lock: use it to lock the
      cs, check if it fails on locked cs
      <br>
    </blockquote>
    Thank you for your comment, it's of great help. I will try it.<br>
    <br>
    <blockquote cite="mid:56F156BD.7000506@gmail.com" type="cite">
      <br>
      Also the tests failed on testbot, I was not checking why.
      <br>
    </blockquote>
    The tests failed on w2008s64(64bit msvcr120), however, it succeed on
    32bit msvcr120.<br>
    I did not figure out this.<br>
    <br>
    <meta charset="utf-8">
    Thank you.<br>
    <br>
  </body>
</html>