Skip to content

Commit eed94df

Browse files
committed
Fix 'FLAG/NOFLAG' annotations in all test cases
1 parent 0b7e6e2 commit eed94df

File tree

22 files changed

+57
-69
lines changed

22 files changed

+57
-69
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
separate (Test)
2-
procedure Prim3 (Self : T6; Other : Integer) is
2+
procedure Prim3 (Self : T6; Other : Integer) is -- FLAG
33
begin
44
null;
55
end Prim3;

testsuite/tests/checks/overriding_marks/test.adb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ package body Test is
66
return "hello";
77
end Prim2;
88

9-
procedure Prim1 (Self : T2; Other : Integer) is null; -- FLAG
10-
function Prim2 (Self : T2; Other : Integer) return String
9+
procedure Prim1 (Self : T2; Other : Integer) is null; -- FLAG
10+
function Prim2 (Self : T2; Other : Integer) return String -- FLAG
1111
is
1212
begin
1313
return "hello";
14-
end Prim2; -- FLAG
14+
end Prim2;
1515

16-
overriding procedure Prim1 (Self : T3; Other : Integer) is null; -- NOFLAG
17-
overriding function Prim2 (Self : T3; Other : Integer) return String
16+
overriding procedure Prim1 (Self : T3; Other : Integer) is null; -- NOFLAG
17+
overriding function Prim2 (Self : T3; Other : Integer) return String -- NOFLAG
1818
is
1919
begin
2020
return "hello";
21-
end Prim2; -- NOFLAG
21+
end Prim2;
2222

2323
procedure Not_A_Prim (Self : Integer) is null; -- NOFLAG
2424

@@ -29,21 +29,21 @@ package body Test is
2929
return "hello";
3030
end Prim2;
3131

32-
overriding procedure Prim1 (Self : T5; Other : Integer) is null; -- NOFLAG
33-
overriding function Prim2 (Self : T5; Other : Integer) return String
32+
overriding procedure Prim1 (Self : T5; Other : Integer) is null; -- NOFLAG
33+
overriding function Prim2 (Self : T5; Other : Integer) return String -- NOFLAG
3434
is
3535
begin
3636
return "hello";
37-
end Prim2; -- NOFLAG
37+
end Prim2;
3838

3939
procedure Prim1 (Self : T6; Other : Integer) is null; -- FLAG
40-
function Prim2 (Self : T6; Other : Integer) return String
40+
function Prim2 (Self : T6; Other : Integer) return String -- FLAG
4141
is
4242
begin
4343
return "hello";
44-
end Prim2; -- FLAG
44+
end Prim2;
4545

4646
procedure Prim3 (Self : T4; Other : Integer) is null;
4747

48-
procedure Prim3 (Self : T6; Other : Integer) is separate;
48+
procedure Prim3 (Self : T6; Other : Integer) is separate; -- FLAG
4949
end Test;

testsuite/tests/checks/overriding_marks/test.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ test.ads:32:14: rule violation: Missing overriding mark
2323
| ^^^^^
2424

2525
test.adb:9:14: rule violation: Missing overriding mark
26-
9 | procedure Prim1 (Self : T2; Other : Integer) is null; -- FLAG
26+
9 | procedure Prim1 (Self : T2; Other : Integer) is null; -- FLAG
2727
| ^^^^^
2828

2929
test.adb:10:13: rule violation: Missing overriding mark
30-
10 | function Prim2 (Self : T2; Other : Integer) return String
30+
10 | function Prim2 (Self : T2; Other : Integer) return String -- FLAG
3131
| ^^^^^
3232

3333
test.adb:39:14: rule violation: Missing overriding mark
3434
39 | procedure Prim1 (Self : T6; Other : Integer) is null; -- FLAG
3535
| ^^^^^
3636

3737
test.adb:40:13: rule violation: Missing overriding mark
38-
40 | function Prim2 (Self : T6; Other : Integer) return String
38+
40 | function Prim2 (Self : T6; Other : Integer) return String -- FLAG
3939
| ^^^^^
4040

4141
test.adb:48:14: rule violation: Missing overriding mark
42-
48 | procedure Prim3 (Self : T6; Other : Integer) is separate;
42+
48 | procedure Prim3 (Self : T6; Other : Integer) is separate; -- FLAG
4343
| ^^^^^
4444

4545
test-prim3.adb:2:11: rule violation: Missing overriding mark
46-
2 | procedure Prim3 (Self : T6; Other : Integer) is
46+
2 | procedure Prim3 (Self : T6; Other : Integer) is -- FLAG
4747
| ^^^^^
4848

testsuite/tests/gnatcheck/exemptions/comment_annotations_check/main.adb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ procedure Main is
55
-- 1: Testing aliases (implicit_in)
66

77
--## rule off implicit_in ## Exemption justification
8-
procedure Bar (A : Integer) is null; -- FLAG in valid exemptions
8+
procedure Bar (A : Integer) is null; -- NOFLAG (exempted)
99
--## rule on implicit_in
1010

1111
procedure Baz (A : Integer) is null; -- FLAG
1212

1313
-- 2: Check that no justification doesn't trigger a warning in "rule
1414
-- off"
1515
--## rule off expression_functions
16-
function Boo return Boolean is (True); -- FLAG in valid exemptions
16+
function Boo return Boolean is (True); -- NOFLAG (exempted)
1717

1818
-- 3: We check that justification is ignored in "rule on"
1919
--## rule on expression_functions ## useless comment
@@ -22,23 +22,23 @@ procedure Main is
2222
-- 4: Check that any extra wording is ignored and that the missing
2323
-- rule on is flagged
2424
--## rule off expression_functions this is not -- a justification -- FLAG because no matching 'exempt_OFF'
25-
function Loo return Boolean is (True); -- FLAG in valid exemptions
25+
function Loo return Boolean is (True); -- NOFLAG (exempted)
2626
end Pkg;
2727

2828
-- Check that a redundant rule off is detected and the alias used in the message
2929
--## rule off expr_func -- FLAG rule is already exempted at line 24
30-
procedure Poo (A : Integer) is null; --## rule line off implicit_in ## justify line off -- FLAG in valid exemptions
30+
procedure Poo (A : Integer) is null; --## rule line off implicit_in ## justify line off -- NOFLAG (exempted)
3131

3232
-- Check that there is a warning for "rule line on"
33-
procedure Roo (A : Integer) is null; --## rule line on implicit_in -- FLAG (2)
33+
procedure Roo (A : Integer) is null; --## rule line on implicit_in -- FLAG
3434

3535
-- Check that exempting with a comment after exempting with a pragma is working as expected
3636
--## rule off implicit_in ## Because
37-
procedure Zoo (A : Integer) is null; -- FLAG
37+
procedure Zoo (A : Integer) is null; -- NOFLAG (exempted)
3838
--## rule on implicit_in
3939

4040
pragma Annotate (Gnatcheck, Exempt_On, "implicit_in", "Because");
41-
procedure Woo (A : Integer) is null; -- FLAG
41+
procedure Woo (A : Integer) is null; -- NOFLAG (exempted)
4242
pragma Annotate (Gnatcheck, Exempt_Off, "implicit_in");
4343
begin
4444
null;

testsuite/tests/gnatcheck/exemptions/comment_annotations_check/test.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ main.adb:16:16: rule violation (exempted): expression function
2222
main.adb:25:16: rule violation (exempted): expression function
2323
(unjustified)
2424
main.adb:30:19: rule violation (exempted): implicit IN mode in parameter specification
25-
(justify line off -- FLAG in valid exemptions)
25+
(justify line off -- NOFLAG (exempted))
2626
main.adb:33:19: rule violation (exempted): implicit IN mode in parameter specification
2727
(unjustified)
2828
main.adb:37:19: rule violation (exempted): implicit IN mode in parameter specification

testsuite/tests/gnatcheck/exemptions/gnatkp/src/main.adb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ procedure Main is
77
with Address => X'Address;
88

99
pragma Annotate (GnatKP, Exempt_On, "kp_19198", "Because");
10-
A_2 : Int_Arr := (1, 2, 3) -- FLAG
10+
A_2 : Int_Arr := (1, 2, 3) -- NOFLAG (exempted)
1111
with Address => X'Address;
1212
pragma Annotate (GnatKP, Exempt_Off, "kp_19198");
1313

1414
--## kp off kp_19198 ## Because
15-
A_3 : Int_Arr := (1, 2, 3) -- FLAG
15+
A_3 : Int_Arr := (1, 2, 3) -- NOFLAG (exempted)
1616
with Address => X'Address;
1717
--## kp on kp_19198
1818
begin
1919
goto lbl; -- FLAG
2020

2121
pragma Annotate (Gnatcheck, Exempt_On, "goto_statements", "Because");
22-
goto lbl; -- FLAG
22+
goto lbl; -- NOFLAG (exempted)
2323
pragma Annotate (Gnatcheck, Exempt_Off, "goto_statements");
2424

2525
--## rule off goto_statements ## Because
26-
goto lbl; -- FLAG
26+
goto lbl; -- NOFLAG (exempted)
2727
--## rule on goto_statements
2828

2929
<<lbl>>

testsuite/tests/gnatcheck/exemptions/instance_exemptions/main.adb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ procedure Main is
77

88
pragma Annotate (Gnatcheck, Exempt_On, "ID_SUF: constant", "testing");
99
type T_2 is new Integer; -- FLAG
10-
C_2 : constant Integer := 0; -- FLAG (exempted)
10+
C_2 : constant Integer := 0; -- NOFLAG (exempted)
1111
pragma Annotate (Gnatcheck, Exempt_On, "ID_SUF", "testing"); -- FLAG (already exempted with params)
1212
pragma Annotate (Gnatcheck, Exempt_On, "ID_SUF: constant", "testing"); -- FLAG (already exempted with same params)
1313
pragma Annotate (Gnatcheck, Exempt_On, "ID_SUF: constant, type", "testing"); -- FLAG (already exempted with the "constant" param)
1414
pragma Annotate (Gnatcheck, Exempt_On, "ID_SUF: type", "testing");
15-
type T_3 is new Integer; -- FLAG (exempted)
15+
type T_3 is new Integer; -- NOFLAG (exempted)
1616
pragma Annotate (Gnatcheck, Exempt_Off, "ID_SUF: type");
1717
pragma Annotate (Gnatcheck, Exempt_Off, "ID_SUF: constant");
1818
begin
@@ -29,30 +29,30 @@ begin
2929
--## rule off STYLE ## testing -- FLAG (cannot exempt compiler based instance)
3030

3131
--## rule off Redundant_Null_Statements ## testing
32-
null; -- FLAG (exempted)
32+
null; -- NOFLAG (exempted)
3333
--## rule on Redundant_Null_Statements
3434

3535
--## rule off NULL ## testing
36-
null; -- FLAG (exempted)
36+
null; -- NOFLAG (exempted)
3737
--## rule on NULL
3838

3939
--## rule off Goto_Statements ## testing
40-
goto lbl; -- FLAG (2) (exempted)
41-
if True then goto lbl; end if; -- FLAG (exempted)
40+
goto lbl; -- NOFLAG (exempted)
41+
if True then goto lbl; end if; -- NOFLAG (exempted)
4242
--## rule on Goto_Statements
4343

4444
--## rule off GOTO ## testing
45-
goto lbl; -- FLAG (2) (1 real, 1 exempted)
46-
if True then goto lbl; end if; -- FLAG (exempted)
45+
goto lbl; -- FLAG (1 real, 1 exempted)
46+
if True then goto lbl; end if; -- NOFLAG (exempted)
4747
--## rule on GOTO
4848

4949
--## rule off UNCOND_GOTO ## testing
50-
goto lbl; -- FLAG (2) (1 real, 1 exempted)
50+
goto lbl; -- FLAG (1 real, 1 exempted)
5151
if True then goto lbl; end if; -- FLAG
5252
--## rule on UNCOND_GOTO
5353

5454
--## rule off style_checks ## testing
55-
if (True) then null; end if; -- FLAG (exempted)
55+
if (True) then null; end if; -- NOFLAG (exempted)
5656
--## rule on style_checks
5757

5858
--## rule off Goto_Statements ## testing
@@ -67,7 +67,7 @@ begin
6767
--## rule on GOTO -- FLAG (no detection)
6868

6969
pragma Annotate (Gnatcheck, Exempt_On, "Style_Checks: xz", "testing");
70-
if (True) then null; end if; -- FLAG (exempted)
70+
if (True) then null; end if; -- NOFLAG (exempted)
7171
pragma Annotate (Gnatcheck, Exempt_On, "Style_Checks", "testing"); -- FLAG (already exempted with params)
7272
pragma Annotate (Gnatcheck, Exempt_On, "Style_Checks: x", "testing"); -- FLAG (already exempted with the "x" param)
7373
pragma Annotate (Gnatcheck, Exempt_On, "Style_Checks: xz", "testing"); -- FLAG (already exempted with the same params)

testsuite/tests/gnatcheck/exemptions/restriction_exemptions/src/main.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package Main is
22
-- Test the restriction exemption with a numeric parameter
33
pragma Annotate (GNATcheck, Exempt_On, "Restrictions: No_Protected_Types, Max_Protected_Entries", "testing");
44
protected type Protected_Type is
5-
entry Hello; -- FLAG
5+
entry Hello; -- NOFLAG (exempted)
66
pragma Annotate (GNATcheck, Exempt_Off, "Restrictions: No_Protected_Types, Max_Protected_Entries");
77
end Protected_Type;
88
end Main;

testsuite/tests/gnatcheck/lkql_rules_config/exemptions/main.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
with Ada.Text_IO; -- FLAG
22

33
pragma Annotate (gnatcheck, Exempt_On, "Warnings", "Exempting unused unbounded");
4-
with Ada.Strings.Unbounded; -- FLAG (as exempted)
4+
with Ada.Strings.Unbounded; -- NOFLAG (exempted)
55
pragma Annotate (gnatcheck, Exempt_Off, "Warnings");
66

77
with Ada.Containers; -- FLAG
@@ -12,7 +12,7 @@ begin
1212
<<x>>
1313

1414
--## rule off Goto_Statements ## Exempting gotos
15-
goto y; -- FLAG (as exempted)
15+
goto y; -- NOFLAG (exempted)
1616
<<y>>
1717
--## rule on Goto_Statements
1818

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
procedure Main is
22
begin
3-
goto Test; -- FLAG
3+
goto Test; -- NOFLAG
44
<<Test>>
55
end Main;

0 commit comments

Comments
 (0)