Correct tseg.pp test for i8086 CPPU for which seg/cseg/dseg/sseg should NOT return zero values

git-svn-id: trunk@33770 -
This commit is contained in:
pierre 2016-05-23 20:58:37 +00:00
parent 74b3481918
commit 6646a0d29f

View File

@ -2,6 +2,14 @@
{ Carl Eric Codere Copyright (c) 2002 }
program tseg;
{$ifdef CPUI8086}
const
seg_should_be_zero = false;
{$else}
const
seg_should_be_zero = true;
{$endif}
const
cst : integer = 0;
var
@ -16,7 +24,8 @@ procedure fail;
procedure test_cseg;
begin
Write('Testing CSeg()...');
if cseg <> 0 then
if ((cseg <> 0) and seg_should_be_zero) or
((cseg=0) and not seg_should_be_zero) then
fail
else
WriteLn('Success!');
@ -25,7 +34,8 @@ procedure test_cseg;
procedure test_dseg;
begin
Write('Testing DSeg()...');
if dseg <> 0 then
if ((dseg <> 0) and seg_should_be_zero) or
((dseg=0) and not seg_should_be_zero) then
fail
else
WriteLn('Success!');
@ -34,7 +44,8 @@ procedure test_dseg;
procedure test_sseg;
begin
Write('Testing SSeg()...');
if sseg <> 0 then
if ((sseg <> 0) and seg_should_be_zero) or
((sseg=0) and not seg_should_be_zero) then
fail
else
WriteLn('Success!');
@ -47,11 +58,14 @@ procedure test_seg;
begin
_result := true;
Write('Testing Seg()...');
if seg(x) <> 0 then
if ((seg(x) <> 0) and seg_should_be_zero) or
((seg(x)=0) and not seg_should_be_zero) then
_result := false;
if seg(cst) <> 0 then
if ((seg(cst) <> 0) and seg_should_be_zero) or
((seg(cst)=0) and not seg_should_be_zero) then
_result := false;
if seg(variable) <> 0 then
if ((seg(variable) <> 0) and seg_should_be_zero) or
((seg(variable)=0) and not seg_should_be_zero) then
_result := false;
if not _result then
fail