浏览代码

+ add static functions to check for the correct string helper

git-svn-id: trunk@39398 -
svenbarth 7 年之前
父节点
当前提交
664724fb82
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      tests/test/uthlp.pp

+ 24 - 0
tests/test/uthlp.pp

@@ -99,21 +99,25 @@ type
 
   TShortStringHelper = record helper for ShortString
     function Test: LongInt;
+    class function TestClass: LongInt; static;
     constructor Create(aArg: ShortString);
   end;
 
   TAnsiStringHelper = record helper for AnsiString
     function Test: LongInt;
+    class function TestClass: LongInt; static;
     constructor Create(aArg: AnsiString);
   end;
 
   TWideStringHelper = record helper for WideString
     function Test: LongInt;
+    class function TestClass: LongInt; static;
     constructor Create(aArg: WideString);
   end;
 
   TUnicodeStringHelper = record helper for UnicodeString
     function Test: LongInt;
+    class function TestClass: LongInt; static;
     constructor Create(aArg: UnicodeString);
   end;
 
@@ -334,6 +338,11 @@ begin
   Result := 4;
 end;
 
+class function TUnicodeStringHelper.TestClass: LongInt;
+begin
+  Result := 4;
+end;
+
 constructor TUnicodeStringHelper.Create(aArg: UnicodeString);
 begin
   Self := aArg;
@@ -346,6 +355,11 @@ begin
   Result := 3;
 end;
 
+class function TWideStringHelper.TestClass: LongInt;
+begin
+  Result := 3;
+end;
+
 constructor TWideStringHelper.Create(aArg: WideString);
 begin
   Self := aArg;
@@ -358,6 +372,11 @@ begin
   Result := 2;
 end;
 
+class function TAnsiStringHelper.TestClass: LongInt;
+begin
+  Result := 2;
+end;
+
 constructor TAnsiStringHelper.Create(aArg: AnsiString);
 begin
   Self := aArg;
@@ -370,6 +389,11 @@ begin
   Result := 1;
 end;
 
+class function TShortStringHelper.TestClass: LongInt;
+begin
+  Result := 1;
+end;
+
 constructor TShortStringHelper.Create(aArg: ShortString);
 begin
   Self := aArg;