Time for test is counted twice in total, when no assertions are made

Issue #109 resolved
Lübbe Onken created an issue

Today I came across a curious bug, TestInsight 1.1.5.0 and Delphi 10.2.3 professional. DUnitX test runner.

The following test is correctly timed with 100-102 ms by TestInsight. The total however lists exactly the double value (200-204 ms). Once you add an assert, no matter fail or pass, the total is correct.

procedure TTest.SmallTest;
begin
  Sleep (100);
//Assert.pass();
end;

Comments (7)

  1. Lübbe Onken reporter

    There seems to be more. It looks like only the first test without assertion is affected. And it looks like a Test with a failing assertion produces the same wrong total.

    procedure TTest.SmallTest;
    begin
      Sleep (100);
    // No assertion          // Total counts 200ms
    // Assert.Pass;          // Total counts 100ms
    // Assert.Fail;          // Total counts 100ms
    // Assert.IsTrue(false); // Total counts 200ms
    // Assert.IsTrue(true);  // Total counts 100ms
    end;
    
  2. Stefan Glienke repo owner
    • changed status to open

    Seems to be unrelated to the test framework being used but somewhere in the IDE plugin itself as I can reproduce with DUnit.

  3. Log in to comment