浏览代码

+ test for r28985

git-svn-id: trunk@28987 -
Jonas Maebe 10 年之前
父节点
当前提交
979761493f
共有 2 个文件被更改,包括 50 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 49 0
      tests/webtbs/tw26993.pp

+ 1 - 0
.gitattributes

@@ -14111,6 +14111,7 @@ tests/webtbs/tw2690.pp svneol=native#text/plain
 tests/webtbs/tw2691.pp svneol=native#text/plain
 tests/webtbs/tw2696.pp svneol=native#text/plain
 tests/webtbs/tw26976.pp svneol=native#text/plain
+tests/webtbs/tw26993.pp svneol=native#text/plain
 tests/webtbs/tw26993a.pp svneol=native#text/plain
 tests/webtbs/tw2702.pp svneol=native#text/plain
 tests/webtbs/tw2703.pp svneol=native#text/plain

+ 49 - 0
tests/webtbs/tw26993.pp

@@ -0,0 +1,49 @@
+program tw26993;
+
+{$mode delphi}
+
+uses
+  Classes, SysUtils;
+
+type
+
+  { TExtendedTestCase }
+
+  TExtendedTestCase = record
+  private
+    FValue: extended;
+  public
+    property Value: extended read FValue write FValue;
+    class operator Add(v1, v2: TExtendedTestCase): TExtendedTestCase;
+    class operator Multiply(v1, v2: TExtendedTestCase): TExtendedTestCase;
+  end;
+
+
+{ TExtendedTestCase }
+
+class operator TExtendedTestCase.Add(v1, v2: TExtendedTestCase): TExtendedTestCase;
+begin
+  Result.Value := v1.Value + v2.Value;
+end;
+
+class operator TExtendedTestCase.Multiply(v1, v2: TExtendedTestCase):
+TExtendedTestCase;
+begin
+  Result.Value := v1.Value * v2.Value;
+end;
+
+var
+  e1,e2,e3: textendedtestcase;
+begin
+  e1.fvalue:=2.0;
+  e2.fvalue:=3.0;
+  e3:=e1+e2;
+  if (e3*e2).fvalue<>15.0 then
+    halt(1);
+
+end.
+
+
+
+
+