File: rectangle-tests.adb

package info (click to toggle)
libaunit 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,360 kB
  • sloc: ada: 5,615; python: 243; makefile: 223; sh: 92; xml: 13
file content (32 lines) | stat: -rw-r--r-- 720 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--
--  Copyright (C) 2008, AdaCore
--
with AUnit.Assertions;   use AUnit.Assertions;

with Shape;

package body Rectangle.Tests is

   -----------------
   -- Set_Up_Case --
   -----------------

   Local_Rectangle : aliased Rectangle_Type;
   procedure Set_Up (T : in out Test) is
   begin
      T.The_Shape := Local_Rectangle'Access;
   end Set_Up;

   -------------------
   -- Test_Get_Area --
   -------------------

   procedure Test_Get_Area (T : in out Test) is
   begin
      Shape.Set_Width (T.The_Shape.all, 3);
      Shape.Set_Height (T.The_Shape.all, 5);
      Assert (Shape.Area (T.The_Shape.all) = 15,
              "Wrong area returned for object rectangle");
   end Test_Get_Area;

end Rectangle.Tests;