Test suite results for test file test/cg/tcnvstr1.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "test/cg/tcnvstr1.pp" information:

t_id 174
t_adddate 2003/10/03
t_result 0
t_knownrunerror 0

Detailed test run results:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Successfully run 50 100.0 2024/05/17 11:04:00 38 2024/05/17 12:48:00 0
i386 11 22.0 2024/05/17 11:23:00 52 2024/05/17 12:24:00 45
m68k 1 2.0 2024/05/17 11:17:00 244 2024/05/17 11:17:00 244
sparc 1 2.0 2024/05/17 12:01:00 74 2024/05/17 12:01:00 74
powerpc 1 2.0 2024/05/17 11:30:00 242 2024/05/17 11:30:00 242
x86_64 26 52.0 2024/05/17 11:10:00 26 2024/05/17 12:48:00 0
powerpc64 2 4.0 2024/05/17 11:34:00 242 2024/05/17 11:39:00 59
mips 1 2.0 2024/05/17 11:21:00 241 2024/05/17 11:21:00 241
mipsel 1 2.0 2024/05/17 11:26:00 47 2024/05/17 11:26:00 47
aarch64 4 8.0 2024/05/17 11:04:00 38 2024/05/17 12:15:00 38
sparc64 1 2.0 2024/05/17 12:19:00 173 2024/05/17 12:19:00 173
riscv64 1 2.0 2024/05/17 11:56:00 31 2024/05/17 11:56:00 31
linux 39 78.0 2024/05/17 11:04:00 38 2024/05/17 12:48:00 0
solaris 11 22.0 2024/05/17 11:23:00 52 2024/05/17 12:24:00 45
3.3.1 19 38.0 2024/05/17 11:10:00 26 2024/05/17 12:48:00 0
3.2.2 11 22.0 2024/05/17 11:23:00 52 2024/05/17 12:24:00 45
3.2.3 20 40.0 2024/05/17 11:04:00 38 2024/05/17 12:32:00 34

Source:

{****************************************************************}
{  CODE GENERATOR TEST PROGRAM                                   }
{  Copyright (c) 2002, Carl Eric Codere                          }
{****************************************************************}
{ NODE TESTED : secondtypeconvert() -> second_string_string      }
{****************************************************************}
{ PRE-REQUISITES: secondload()                                   }
{                 secondassign()                                 }
{                 secondtypeconv()                               }
{****************************************************************}
{ DEFINES:                                                       }
{            FPC     = Target is FreePascal compiler             }
{****************************************************************}
{ REMARKS: Same type short conversion is not tested, except for  }
{          shortstrings , since it requires special handling.    }
{                                                                }
{                                                                }
{****************************************************************}

{$ifdef fpc}
{$mode objfpc}
  {$ifndef ver1_0}
    {$define haswidestring}
  {$endif}
{$else}
  {$ifndef ver70}
    {$define haswidestring}
  {$endif}
{$endif}

{$H+}  

const
  { exactly 255 characters in length }
  BIG_STRING =
' This is a small text documentation to verify the validity of'+
' the string conversion routines. Of course the conversion routines'+
' should normally work like a charm, and this can only test that there'+
' aren''t any problems with maximum length strings. This fix!';
  { < 255 characters in length }
  SMALL_STRING = 'This is a small hello!';
  { > 255 characters in length }
  HUGE_STRING_END = ' the goal of this experiment';
  HUGE_STRING =
' This is a huge text documentation to verify the validity of'+
' the string conversion routines. Of course the conversion routines'+
' should normally work like a charm, and this can only test that there'+
' 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} 
 str_wide : widestring;
{$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...');  
 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...');  
 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...');  
 if str_short = str_ansi then
   WriteLn('Success.')
 else
   fail;


 Write('huge ansistring -> shortstring...');  
 str_short := '';
 str_ansi:='';
 str_ansi := HUGE_STRING;
 str_short:=str_ansi;
 { Delphi 3/Delphi 6 does not consider these as the same string }
 if str_short <> str_ansi then
   WriteLn('Success.')
 else
   fail;
{}
 s2 := '';
 str_ansi:='';
 str_ansi := SMALL_STRING;
 s2:=str_ansi;
 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...');  
 if s2 = str_ansi then
   WriteLn('Success.')
 else
   fail;

 s2 := '';
 str_ansi:='';
 str_ansi := BIG_STRING;
 s2:=str_ansi;
 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...');  
 { Should fail, since comparing different string lengths }
 if s2 <> str_ansi then
   WriteLn('Success.')
 else
   fail;
end;


procedure test_short_to_short;
begin
 {************************************************************************}   
 {                         shortstring -> shortstring                     }
 {************************************************************************}   
 WriteLn('Test shortstring -> shortstring...');
 { shortstring -> shortstring }
 str_short := '';
 s2:='';
 s2 := SMALL_STRING;
 str_short:=s2;
 Write('small shortstring -> shortstring...');
 if str_short = s2 then
   WriteLn('Success.')
 else
   fail;
   
 str_short := '';
 s2:='';
 s2 := EMPTY_STRING;
 str_short:=s2;
 Write('empty shortstring -> shortstring...');
 if str_short = s2 then
   WriteLn('Success.')
 else
   fail;

{$ifdef fpc}
{ Delphi does not compile these }
 str_short := '';
 s2:='';
 s2 := BIG_STRING;
 str_short:=s2;
 Write('big shortstring -> shortstring...');
 if str_short = s2 then
   WriteLn('Success.')
 else
   fail;


 str_short := '';
 s2:='';
 s2 := HUGE_STRING;
 str_short:=s2;
 Write('huge shortstring -> shortstring...');
 { Delphi 3/Delphi 6 does not consider these as the same string }
 if str_short = s2 then
   WriteLn('Success.')
 else
   fail;
{$endif}

 s2 := '';
 str_short:='';
 str_short := SMALL_STRING;
 Write('small shortstring -> shortstring...');
 s2:=str_short;
 if s2 = str_short then
   WriteLn('Success.')
 else
   fail;
   
 s2 := '';
 str_short:='';
 str_short := EMPTY_STRING;
 Write('empty shortstring -> shortstring...');
 s2:=str_short;
 if s2 = str_short then
   WriteLn('Success.')
 else
   fail;

 s2 := '';
 str_short:='';
 str_short := BIG_STRING;
 Write('big shortstring -> shortstring...');
 s2:=str_short;
 { Should fail, since comparing different string lengths }
 if s2 <> str_short then
   WriteLn('Success.')
 else
   fail;

{$ifdef fpc}   
 s2 := '';
 str_short:='';
 str_short := HUGE_STRING;
 Write('huge shortstring -> shortstring...');
 s2:=str_short;
 { Should fail, since comparing different string lengths }
 if s2 <> str_short then
   WriteLn('Success.')
 else
   fail;
{$endif}   
end;


procedure test_short_to_ansi;
begin
 {************************************************************************}   
 {                         shortstring -> ansistring                      }
 {************************************************************************}   
 WriteLn('Test shortstring -> ansistring');
 Write('small shortstring -> ansistring...');  
 { shortstring -> ansistring }
 str_short := SMALL_STRING;
 str_ansi:=str_short;
 if str_short = str_ansi then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty shortstring -> ansistring...');  
 str_short := EMPTY_STRING;
 str_ansi:=str_short;
 if str_short = str_ansi then
   WriteLn('Success.')
 else
   fail;

 Write('big shortstring -> ansistring...');  
 str_short := BIG_STRING;
 str_ansi:=str_short;
 if str_short = str_ansi then
   WriteLn('Success.')
 else
   fail;

 Write('small shortstring -> ansistring...');  
 { shortstring -> ansistring }
 s2 := SMALL_STRING;
 str_ansi:=s2;
 if s2 = str_ansi then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty shortstring -> ansistring...');  
 s2 := EMPTY_STRING;
 str_ansi:=s2;
 if s2 = str_ansi then
   WriteLn('Success.')
 else
   fail;

end;


{$ifdef haswidestring}
procedure test_wide_to_ansi;
begin
 {************************************************************************}   
 {                         widestring -> ansistring                      }
 {************************************************************************}   
 WriteLn('Test widestring -> ansistring');
 Write('small widestring -> ansistring...');  
 { widestring -> ansistring }
 str_wide := SMALL_STRING;
 str_ansi:=str_wide;
 if str_wide = str_ansi then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty widestring -> ansistring...');  
 str_wide := EMPTY_STRING;
 str_ansi:=str_wide;
 if str_wide = str_ansi then
   WriteLn('Success.')
 else
   fail;

 Write('big widestring -> ansistring...');  
 str_wide := BIG_STRING;
 str_ansi:=str_wide;
 if str_wide = str_ansi then
   WriteLn('Success.')
 else
   fail;

 Write('huge widestring -> ansistring...');  
 str_wide := HUGE_STRING;
 str_ansi:=str_wide;
 if str_wide = str_ansi then
   WriteLn('Success.')
 else
   fail;

end;



procedure test_short_to_wide;
begin
 {************************************************************************}   
 {                         shortstring -> widestring                      }
 {************************************************************************}   
 WriteLn('Test shortstring -> widestring');
 Write('small shortstring -> widestring...');  
 { shortstring -> widestring }
 str_short := SMALL_STRING;
 str_wide:=str_short;
 if str_short = str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty shortstring -> widestring...');  
 str_short := EMPTY_STRING;
 str_wide:=str_short;
 if str_short = str_wide then
   WriteLn('Success.')
 else
   fail;

 Write('big shortstring -> widestring...');  
 str_short := BIG_STRING;
 str_wide:=str_short;
 if str_short = str_wide then
   WriteLn('Success.')
 else
   fail;

 Write('small shortstring -> widestring...');  
 { shortstring -> widestring }
 s2 := SMALL_STRING;
 str_wide:=s2;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty shortstring -> widestring...');  
 s2 := EMPTY_STRING;
 str_wide:=s2;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;

end;


procedure test_ansi_to_wide;
begin
 {************************************************************************}   
 {                         ansistring -> widestring                      }
 {************************************************************************}   
 WriteLn('Test ansistring -> widestring');
 Write('small ansistring -> widestring...');  
 { ansistring -> widestring }
 str_ansi := SMALL_STRING;
 str_wide:=str_ansi;
 if str_ansi = str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty ansistring -> widestring...');  
 str_ansi := EMPTY_STRING;
 str_wide:=str_ansi;
 if str_ansi = str_wide then
   WriteLn('Success.')
 else
   fail;

 Write('big ansistring -> widestring...');  
 str_ansi := BIG_STRING;
 str_wide:=str_ansi;
 if str_ansi = str_wide then
   WriteLn('Success.')
 else
   fail;

 Write('small ansistring -> widestring...');  
 { ansistring -> widestring }
 s2 := SMALL_STRING;
 str_wide:=s2;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty ansistring -> widestring...');  
 s2 := EMPTY_STRING;
 str_wide:=s2;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;

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...');  
 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;
 str_short:=str_wide;
 if str_short = str_wide then
   WriteLn('Success.')
 else
   fail;

 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...');  
 s2 := '';
 str_wide:='';
 str_wide := SMALL_STRING;
 s2:=str_wide;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('empty widestring -> shortstring...');  
 s2 := '';
 str_wide:='';
 str_wide := EMPTY_STRING;
 s2:=str_wide;
 if s2 = str_wide then
   WriteLn('Success.')
 else
   fail;

 Write('big widestring -> shortstring...');  
 s2 := '';
 str_wide:='';
 str_wide := BIG_STRING;
 s2:=str_wide;
 if s2 <> str_wide then
   WriteLn('Success.')
 else
   fail;
   
 Write('huge widestring -> shortstring...');  
 s2 := '';
 str_wide:='';
 str_wide := HUGE_STRING;
 s2:=str_wide;
 if s2 <> str_wide then
   WriteLn('Success.')
 else
   fail;
end;
{$endif}

Begin
 test_ansi_to_short;
 test_short_to_short;
 test_short_to_ansi;
 { requires widestring support }
{$ifdef haswidestring} 
 test_short_to_wide;
 test_ansi_to_wide;
 test_wide_to_short;
 test_wide_to_ansi;
{$endif} 
End.

{
  $Log: tcnvstr1.pp,v $
  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

  Revision 1.2  2002/09/07 15:40:55  peter
    * old logs removed and tabs fixed

}

Link to SVN view of test/cg/tcnvstr1.pp source.