瀏覽代碼

+ extended test tfarptr2 to also test comparisons with nil

git-svn-id: trunk@25112 -
nickysn 12 年之前
父節點
當前提交
59d014dd10
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      tests/test/cpu16/i8086/tfarptr2.pp

+ 25 - 0
tests/test/cpu16/i8086/tfarptr2.pp

@@ -103,6 +103,31 @@ begin
   if eq or not neq then
     Error(4);
 
+  Writeln('var, nil');
+  FarPtr := Ptr(0, 0);
+  eq := FarPtr = nil;
+  neq := FarPtr <> nil;
+  if not eq or neq then
+    Error(1);
+
+  FarPtr := Ptr(0, 1);
+  eq := FarPtr = nil;
+  neq := FarPtr <> nil;
+  if eq or not neq then
+    Error(2);
+
+  FarPtr := Ptr(1, 0);
+  eq := FarPtr = nil;
+  neq := FarPtr <> nil;
+  if eq or not neq then
+    Error(3);
+
+  FarPtr := Ptr(1, 1);
+  eq := FarPtr = nil;
+  neq := FarPtr <> nil;
+  if eq or not neq then
+    Error(4);
+
   if ErrorCode = 0 then
     Writeln('Success!')
   else