UTCovTest.pas 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //---------------------------------------------------------------------------
  2. // Copyright 2012 The Open Source Electronic Health Record Agent
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //---------------------------------------------------------------------------
  16. unit UTCovTest;
  17. interface
  18. uses UnitTest, TestFrameWork,SysUtils,Windows;
  19. implementation
  20. type
  21. UTCovTestTests=class(TTestCase)
  22. public
  23. procedure SetUp; override;
  24. procedure TearDown; override;
  25. published
  26. procedure TestCov1;
  27. procedure TestCov2;
  28. procedure TestCov3;
  29. end;
  30. procedure NotRun;
  31. begin
  32. WriteLn('This line will never run');
  33. end;
  34. procedure UTCovTestTests.SetUp;
  35. begin
  36. end;
  37. procedure UTCovTestTests.TearDown;
  38. begin
  39. end;
  40. procedure UTCovTestTests.TestCov1;
  41. begin
  42. {
  43. Block comment lines
  44. }
  45. CheckEquals(1,2-1);
  46. end;
  47. procedure UTCovTestTests.TestCov2;
  48. var
  49. i:DWORD;
  50. begin
  51. for i := 0 to 1 do
  52. WriteLn( IntToStr(i));
  53. // Comment
  54. CheckEquals(i,2);
  55. end;
  56. procedure UTCovTestTests.TestCov3;
  57. var
  58. i : DWORD;
  59. begin
  60. i := 0;
  61. while i < 5 do
  62. i := i+1;
  63. CheckEquals(i,5);
  64. end;
  65. begin
  66. UnitTest.addSuite(UTCovTestTests.Suite);
  67. end.