Skip to content

Commit 19248af

Browse files
committed
Remove conditional compilation from array tests
Previously, the code that used generics in TestUArraysCatSnippets was not hidden from compilers that don't support generics via conditional compilation. Since the tests are only designed for use with Delphi XE and later, there is no need for this, so all the conditional compilation directives were removed from the test unit.
1 parent a6d67b3 commit 19248af

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

tests/Cat-Arrays/TestUArraysCatSnippets.pas

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
unit TestUArraysCatSnippets;
22

3-
{$UNDEF Generics}
4-
{$IFNDEF FPC}
5-
{$IFDEF CONDITIONALEXPRESSIONS}
6-
{$IF CompilerVersion >= 14.00}
7-
{$WARN SYMBOL_PLATFORM OFF}
8-
{$WARN SYMBOL_DEPRECATED OFF}
9-
{$WARN SYMBOL_LIBRARY OFF}
10-
{$IFEND}
11-
{$IF CompilerVersion >= 15.00}
12-
{$WARN UNSAFE_TYPE OFF}
13-
{$WARN UNSAFE_CAST OFF}
14-
{$WARN UNSAFE_CODE OFF}
15-
{$IFEND}
16-
{$IF CompilerVersion >= 20.00}
17-
{$WARN EXPLICIT_STRING_CAST OFF}
18-
{$WARN IMPLICIT_STRING_CAST OFF}
19-
{$DEFINE Generics}
20-
{$IFEND}
21-
{$ENDIF}
22-
{$ENDIF}
23-
243
interface
254

265
uses
276
TestFramework, UArraysCatSnippets;
287

298
type
309

31-
{$IFDEF Generics}
3210
TestTArrayUtils = class(TTestCase)
3311
strict private
3412
fSA0: TArray<string>;
@@ -54,7 +32,6 @@ TestTArrayUtils = class(TTestCase)
5432
procedure TestEqual;
5533
procedure TestSameStart;
5634
end;
57-
{$ENDIF Generics}
5835

5936
TestArraysCatSnippets = class(TTestCase)
6037

@@ -63,19 +40,11 @@ TestArraysCatSnippets = class(TTestCase)
6340
implementation
6441

6542
uses
66-
SysUtils
67-
{$IFDEF Generics}
68-
, Generics.Defaults
69-
{$ENDIF Generics}
70-
;
43+
SysUtils, Generics.Defaults;
7144

72-
{$IFDEF Generics}
7345
var
7446
IntegerCompareFn: TEqualityComparison<Integer>;
7547
StringCompareFn: TEqualityComparison<string>;
76-
{$ENDIF Generics}
77-
78-
{$IFDEF Generics}
7948

8049
{ TestTArrayUtils }
8150

@@ -229,12 +198,8 @@ procedure TestTArrayUtils.TestSameStart;
229198
);
230199
end;
231200

232-
{$ENDIF Generics}
233-
234201
initialization
235202

236-
{$IFDEF Generics}
237-
238203
IntegerCompareFn := function (const Left, Right: Integer): Boolean
239204
begin
240205
Result := Left = Right;
@@ -245,12 +210,8 @@ initialization
245210
Result := SameStr(Left, Right);
246211
end;
247212

248-
{$ENDIF Generics}
249-
250213
// Register any test cases with the test runner
251-
{$IFDEF Generics}
252214
RegisterTest(TestTArrayUtils.Suite);
253-
{$ENDIF Generics}
254215
RegisterTest(TestArraysCatSnippets.Suite);
255216

256217
end.

0 commit comments

Comments
 (0)