* fixed linefeeds

This commit is contained in:
peter 2004-05-02 12:11:44 +00:00
parent 12efb6d19e
commit 87438454b9
20 changed files with 25279 additions and 25214 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ var
begin
getint64 := $10000000;
end;
function getint64_2 : int64;
var
i: longint;
@ -200,7 +200,10 @@ end.
{
$Log$
Revision 1.6 2002-09-29 14:37:22 carl
Revision 1.7 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.6 2002/09/29 14:37:22 carl
* must more 64-bit testing (to detect endian specific problems)
Revision 1.5 2002/09/27 17:46:01 carl

View File

@ -28,7 +28,7 @@
{$endif}
{$endif}
{$H+}
{$H+}
const
{ exactly 255 characters in length }
@ -48,65 +48,65 @@ const
' aren''t any problems with maximum length strings. I hope you understand'+
HUGE_STRING_END;
EMPTY_STRING = '';
type
shortstr = string[127];
var
s2: shortstr;
str_ansi: ansistring;
str_short: shortstring;
{$ifdef haswidestring}
{$ifdef haswidestring}
str_wide : widestring;
{$endif}
{$endif}
procedure fail;
begin
WriteLn('Failure!');
Halt(1);
end;
procedure test_ansi_to_short;
begin
{************************************************************************}
{************************************************************************}
{ ansistring -> shortstring }
{************************************************************************}
{************************************************************************}
WriteLn('Test ansistring -> shortstring');
{ ansistring -> shortstring }
str_short := '';
str_ansi:='';
str_ansi := SMALL_STRING;
str_short:=str_ansi;
Write('small ansistring -> shortstring...');
Write('small ansistring -> shortstring...');
if str_short = str_ansi then
WriteLn('Success.')
else
fail;
str_short := '';
str_ansi:='';
str_ansi := EMPTY_STRING;
str_short:=str_ansi;
Write('empty ansistring -> shortstring...');
Write('empty ansistring -> shortstring...');
if str_short = str_ansi then
WriteLn('Success.')
else
fail;
str_short := '';
str_ansi:='';
str_ansi := BIG_STRING;
str_short:=str_ansi;
Write('big ansistring -> shortstring...');
Write('big ansistring -> shortstring...');
if str_short = str_ansi then
WriteLn('Success.')
else
fail;
Write('huge ansistring -> shortstring...');
Write('huge ansistring -> shortstring...');
str_short := '';
str_ansi:='';
str_ansi := HUGE_STRING;
@ -121,17 +121,17 @@ begin
str_ansi:='';
str_ansi := SMALL_STRING;
s2:=str_ansi;
Write('small ansistring -> shortstring...');
Write('small ansistring -> shortstring...');
if s2 = str_ansi then
WriteLn('Success.')
else
fail;
s2 := '';
str_ansi:='';
str_ansi := EMPTY_STRING;
s2:=str_ansi;
Write('empty ansistring -> shortstring...');
Write('empty ansistring -> shortstring...');
if s2 = str_ansi then
WriteLn('Success.')
else
@ -141,18 +141,18 @@ begin
str_ansi:='';
str_ansi := BIG_STRING;
s2:=str_ansi;
Write('big ansistring -> shortstring...');
Write('big ansistring -> shortstring...');
{ Should fail, since comparing different string lengths }
if s2 <> str_ansi then
WriteLn('Success.')
else
fail;
s2 := '';
str_ansi:='';
str_ansi := HUGE_STRING;
s2:=str_ansi;
Write('huge ansistring -> shortstring...');
Write('huge ansistring -> shortstring...');
{ Should fail, since comparing different string lengths }
if s2 <> str_ansi then
WriteLn('Success.')
@ -163,9 +163,9 @@ end;
procedure test_short_to_short;
begin
{************************************************************************}
{************************************************************************}
{ shortstring -> shortstring }
{************************************************************************}
{************************************************************************}
WriteLn('Test shortstring -> shortstring...');
{ shortstring -> shortstring }
str_short := '';
@ -177,7 +177,7 @@ begin
WriteLn('Success.')
else
fail;
str_short := '';
s2:='';
s2 := EMPTY_STRING;
@ -222,7 +222,7 @@ begin
WriteLn('Success.')
else
fail;
s2 := '';
str_short:='';
str_short := EMPTY_STRING;
@ -244,7 +244,7 @@ begin
else
fail;
{$ifdef fpc}
{$ifdef fpc}
s2 := '';
str_short:='';
str_short := HUGE_STRING;
@ -255,17 +255,17 @@ begin
WriteLn('Success.')
else
fail;
{$endif}
{$endif}
end;
procedure test_short_to_ansi;
begin
{************************************************************************}
{************************************************************************}
{ shortstring -> ansistring }
{************************************************************************}
{************************************************************************}
WriteLn('Test shortstring -> ansistring');
Write('small shortstring -> ansistring...');
Write('small shortstring -> ansistring...');
{ shortstring -> ansistring }
str_short := SMALL_STRING;
str_ansi:=str_short;
@ -273,8 +273,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty shortstring -> ansistring...');
Write('empty shortstring -> ansistring...');
str_short := EMPTY_STRING;
str_ansi:=str_short;
if str_short = str_ansi then
@ -282,7 +282,7 @@ begin
else
fail;
Write('big shortstring -> ansistring...');
Write('big shortstring -> ansistring...');
str_short := BIG_STRING;
str_ansi:=str_short;
if str_short = str_ansi then
@ -290,7 +290,7 @@ begin
else
fail;
Write('small shortstring -> ansistring...');
Write('small shortstring -> ansistring...');
{ shortstring -> ansistring }
s2 := SMALL_STRING;
str_ansi:=s2;
@ -298,8 +298,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty shortstring -> ansistring...');
Write('empty shortstring -> ansistring...');
s2 := EMPTY_STRING;
str_ansi:=s2;
if s2 = str_ansi then
@ -313,11 +313,11 @@ end;
{$ifdef haswidestring}
procedure test_wide_to_ansi;
begin
{************************************************************************}
{************************************************************************}
{ widestring -> ansistring }
{************************************************************************}
{************************************************************************}
WriteLn('Test widestring -> ansistring');
Write('small widestring -> ansistring...');
Write('small widestring -> ansistring...');
{ widestring -> ansistring }
str_wide := SMALL_STRING;
str_ansi:=str_wide;
@ -325,8 +325,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty widestring -> ansistring...');
Write('empty widestring -> ansistring...');
str_wide := EMPTY_STRING;
str_ansi:=str_wide;
if str_wide = str_ansi then
@ -334,7 +334,7 @@ begin
else
fail;
Write('big widestring -> ansistring...');
Write('big widestring -> ansistring...');
str_wide := BIG_STRING;
str_ansi:=str_wide;
if str_wide = str_ansi then
@ -342,7 +342,7 @@ begin
else
fail;
Write('huge widestring -> ansistring...');
Write('huge widestring -> ansistring...');
str_wide := HUGE_STRING;
str_ansi:=str_wide;
if str_wide = str_ansi then
@ -356,11 +356,11 @@ end;
procedure test_short_to_wide;
begin
{************************************************************************}
{************************************************************************}
{ shortstring -> widestring }
{************************************************************************}
{************************************************************************}
WriteLn('Test shortstring -> widestring');
Write('small shortstring -> widestring...');
Write('small shortstring -> widestring...');
{ shortstring -> widestring }
str_short := SMALL_STRING;
str_wide:=str_short;
@ -368,8 +368,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty shortstring -> widestring...');
Write('empty shortstring -> widestring...');
str_short := EMPTY_STRING;
str_wide:=str_short;
if str_short = str_wide then
@ -377,7 +377,7 @@ begin
else
fail;
Write('big shortstring -> widestring...');
Write('big shortstring -> widestring...');
str_short := BIG_STRING;
str_wide:=str_short;
if str_short = str_wide then
@ -385,7 +385,7 @@ begin
else
fail;
Write('small shortstring -> widestring...');
Write('small shortstring -> widestring...');
{ shortstring -> widestring }
s2 := SMALL_STRING;
str_wide:=s2;
@ -393,8 +393,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty shortstring -> widestring...');
Write('empty shortstring -> widestring...');
s2 := EMPTY_STRING;
str_wide:=s2;
if s2 = str_wide then
@ -407,11 +407,11 @@ end;
procedure test_ansi_to_wide;
begin
{************************************************************************}
{************************************************************************}
{ ansistring -> widestring }
{************************************************************************}
{************************************************************************}
WriteLn('Test ansistring -> widestring');
Write('small ansistring -> widestring...');
Write('small ansistring -> widestring...');
{ ansistring -> widestring }
str_ansi := SMALL_STRING;
str_wide:=str_ansi;
@ -419,8 +419,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty ansistring -> widestring...');
Write('empty ansistring -> widestring...');
str_ansi := EMPTY_STRING;
str_wide:=str_ansi;
if str_ansi = str_wide then
@ -428,7 +428,7 @@ begin
else
fail;
Write('big ansistring -> widestring...');
Write('big ansistring -> widestring...');
str_ansi := BIG_STRING;
str_wide:=str_ansi;
if str_ansi = str_wide then
@ -436,7 +436,7 @@ begin
else
fail;
Write('small ansistring -> widestring...');
Write('small ansistring -> widestring...');
{ ansistring -> widestring }
s2 := SMALL_STRING;
str_wide:=s2;
@ -444,8 +444,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty ansistring -> widestring...');
Write('empty ansistring -> widestring...');
s2 := EMPTY_STRING;
str_wide:=s2;
if s2 = str_wide then
@ -459,33 +459,33 @@ end;
procedure test_wide_to_short;
begin
{************************************************************************}
{************************************************************************}
{ widestring -> shortstring }
{************************************************************************}
{************************************************************************}
WriteLn('Test widestring -> shortstring');
{ widestring -> shortstring }
str_short := '';
str_wide:='';
str_wide := SMALL_STRING;
Write('small widestring -> shortstring...');
str_short:=str_wide;
if str_short = str_wide then
WriteLn('Success.')
else
fail;
str_short := '';
str_wide:='';
str_wide := EMPTY_STRING;
Write('empty widestring -> shortstring...');
Write('small widestring -> shortstring...');
str_short:=str_wide;
if str_short = str_wide then
WriteLn('Success.')
else
fail;
Write('big widestring -> shortstring...');
str_short := '';
str_wide:='';
str_wide := EMPTY_STRING;
Write('empty widestring -> shortstring...');
str_short:=str_wide;
if str_short = str_wide then
WriteLn('Success.')
else
fail;
Write('big widestring -> shortstring...');
str_short := '';
str_wide:='';
str_wide := BIG_STRING;
@ -495,16 +495,16 @@ begin
else
fail;
Write('huge widestring -> shortstring...');
Write('huge widestring -> shortstring...');
str_wide := HUGE_STRING;
str_short:=str_wide;
if str_short <> str_wide then
WriteLn('Success.')
else
fail;
{}
Write('small widestring -> shortstring...');
Write('small widestring -> shortstring...');
s2 := '';
str_wide:='';
str_wide := SMALL_STRING;
@ -513,8 +513,8 @@ begin
WriteLn('Success.')
else
fail;
Write('empty widestring -> shortstring...');
Write('empty widestring -> shortstring...');
s2 := '';
str_wide:='';
str_wide := EMPTY_STRING;
@ -524,7 +524,7 @@ begin
else
fail;
Write('big widestring -> shortstring...');
Write('big widestring -> shortstring...');
s2 := '';
str_wide:='';
str_wide := BIG_STRING;
@ -533,8 +533,8 @@ begin
WriteLn('Success.')
else
fail;
Write('huge widestring -> shortstring...');
Write('huge widestring -> shortstring...');
s2 := '';
str_wide:='';
str_wide := HUGE_STRING;
@ -551,17 +551,20 @@ Begin
test_short_to_short;
test_short_to_ansi;
{ requires widestring support }
{$ifdef haswidestring}
{$ifdef haswidestring}
test_short_to_wide;
test_ansi_to_wide;
test_wide_to_short;
test_wide_to_ansi;
{$endif}
{$endif}
End.
{
$Log$
Revision 1.3 2002-10-02 19:26:49 carl
Revision 1.4 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.3 2002/10/02 19:26:49 carl
+ added much much more testing of different string types
* str() format depends on size of real

View File

@ -26,10 +26,10 @@ procedure fail;
var
str_ansi : ansistring;
str_short : shortstring;
{$ifdef haswidestring}
{$ifdef haswidestring}
str_wide : widestring;
wc : widechar;
{$endif haswidestring}
{$endif haswidestring}
c: char;
_result : boolean;
Begin
@ -40,7 +40,7 @@ Begin
{ empty string -> shortstring }
str_short := '';
if str_short <> '' then
_result := false;
_result := false;
{ constant char -> shortstring }
str_short := 'c';
if str_short <> 'c' then
@ -52,12 +52,12 @@ Begin
if str_short <> 'c' then
_result := false;
{* wide char *}
{$ifdef haswidestring}
{$ifdef haswidestring}
{ constant char -> shortstring }
str_short := shortstring(widechar('c'));
if str_short <> 'c' then
_result := false;
{$endif}
{$endif}
{ wide char -> shortstring }
{ This should not compile - at least it does not compile under Delphi }
{ str_short := '';
@ -65,8 +65,8 @@ Begin
str_short:=wc;
if str_short <> 'c' then
_result := false;}
if _result then
WriteLn('Success!')
else
@ -78,7 +78,7 @@ Begin
{ empty string -> ansistring }
str_ansi := '';
if str_ansi <> '' then
_result := false;
_result := false;
{ constant char -> ansistring }
str_ansi := 'c';
if str_ansi <> 'c' then
@ -90,7 +90,7 @@ Begin
if str_ansi <> 'c' then
_result := false;
{* wide char *}
{$ifdef haswidestring}
{$ifdef haswidestring}
{ constant char -> ansistring }
str_ansi := widechar('c');
if str_ansi <> 'c' then
@ -101,14 +101,14 @@ Begin
str_ansi:=wc;
if str_ansi <> 'c' then
_result := false;
{$endif}
{$endif}
if _result then
WriteLn('Success!')
else
fail;
{}
{$ifdef haswidestring}
{$ifdef haswidestring}
{********************** char/widechar -> widestring *******************}
Write('widechar/char -> widestring...');
{* normal char *}
@ -116,7 +116,7 @@ Begin
{ empty string -> widestring }
str_wide := '';
if str_wide <> '' then
_result := false;
_result := false;
{ constant char -> widestring }
str_wide := 'c';
if str_wide <> 'c' then
@ -138,8 +138,8 @@ Begin
str_wide:=wc;
if str_wide <> 'c' then
_result := false;
if _result then
WriteLn('Success!')
else

View File

@ -27,7 +27,7 @@ var
int64res : int64;
int64cnt : int64;
begin
{ RIGHT : LOC_REFERENCE }
{ LEFT : LOC_REGISTER }
int64res := 1;
@ -36,7 +36,10 @@ begin
end.
{
$Log$
Revision 1.1 2002-09-21 13:28:06 carl
Revision 1.2 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.1 2002/09/21 13:28:06 carl
+ division by zero testing
}

View File

@ -25,14 +25,17 @@ var
longres : longint;
longcnt : longint;
begin
longres := 1;
longcnt := 0;
longres := longres div longcnt;
end.
{
$Log$
Revision 1.1 2002-09-21 13:28:06 carl
Revision 1.2 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.1 2002/09/21 13:28:06 carl
+ division by zero testing
}

17
tests/test/cg/tpara1.pp Normal file
View File

@ -0,0 +1,17 @@
function f(l1,l2,l3,l4,l5,l6,l7,l8:longint):longint;
begin
f:=l1+l2+l3+l4+l5+l6+l7+l8;
end;
var
l : longint;
begin
l:=f(f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8));
writeln('Got ',l,' expected ',8*(1+2+3+4+5+6+7+8));
if l<>8*(1+2+3+4+5+6+7+8) then
begin
writeln('Error!');
halt(1);
end;
end.

View File

@ -10,7 +10,7 @@ var
value : longint;
begin
value:=1;
getint64_1 := int64(value) shl 40;
getint64_1 := int64(value) shl 40;
end;
function getint64_2 : int64;
@ -18,7 +18,7 @@ var
value : longint;
begin
value:=65535;
getint64_2 := value;
getint64_2 := value;
end;
procedure test_rwtext;
@ -65,7 +65,7 @@ begin
a := 'this is an ansistring';
writeln(a);
vl:=getint64_1;
vl1:=getint64_2;
writeln('int64 test : ',vl, ' ',vl1);

View File

@ -251,7 +251,7 @@ Begin
int64res := int64res shl int64cnt;
Write('(SHL) Value should be -32768...');
test(int64res, -32768);
int64res := 1;
int64cnt := 33;
int64res := int64res shl int64cnt;
@ -282,7 +282,7 @@ Begin
{ left : LOC_REFERENCE }
{ right : LOC_REGISRER }
{
{
WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REGISTER');
int64res := 1;
bytecnt := -2;
@ -317,14 +317,14 @@ Begin
int64res := int64res shr bytecnt;
Write('(SHR) Value should be 1...');
test(int64res, 1);
int64res := 1;
bytecnt := 33;
int64res := int64res shl bytecnt;
Write('(SHL) Value should be 2 in high longint (85899345)...');
move(int64res,int64rec, sizeof(int64));
test(int64rec.highval, 2);
{ int64res:=-1;
bytecnt := 15;
int64res := int64res shr bytecnt;
@ -335,7 +335,10 @@ end.
{
$Log$
Revision 1.7 2003-12-07 11:59:44 jonas
Revision 1.8 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.7 2003/12/07 11:59:44 jonas
* test procedure uses 64bit arguments under FPC
- disabled tests with negative shift counts (illegal)

View File

@ -64,7 +64,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345;
{$IFOPT E-}
{$IFOPT E-}
str(f,s);
if (sizeof(extended) = 10) or
(sizeof(extended) = 12) then
@ -73,7 +73,7 @@ begin
check('-1.12345000000000E+000')
else
check('error, not yet implemented!!!!');
{$endif}
{$endif}
{ the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then
begin
@ -248,7 +248,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345;
{$IFOPT E-}
{$IFOPT E-}
str(f,s);
if (sizeof(extended) = 10) or
(sizeof(extended) = 12) then
@ -257,7 +257,7 @@ begin
check('-1.12345000000000E+000')
else
check('error, not yet implemented!!!!');
{$endif}
{$endif}
{ the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then
begin
@ -433,7 +433,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345;
{$IFOPT E-}
{$IFOPT E-}
str(f,s);
if sizeof(extended) = 10 then
check('-1.123450000000000E+000')
@ -441,7 +441,7 @@ begin
check('-1.12345000000000E+000')
else
check('error, not yet implemented!!!!');
{$endif}
{$endif}
{ the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then
begin