mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-10 03:49:48 +01:00
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:
parent
74b3481918
commit
6646a0d29f
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user