Test suite results for test file test/units/strings/tstrings1.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/units/strings/tstrings1.pp" information:

t_id 1222
t_adddate 2004/01/02
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 10:38:00 39 2024/05/17 12:32:00 34
i386 12 24.0 2024/05/17 11:09:00 236 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
arm 1 2.0 2024/05/17 11:05:00 37 2024/05/17 11:05:00 37
x86_64 22 44.0 2024/05/17 11:06:00 36 2024/05/17 12:32:00 34
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 5 10.0 2024/05/17 10:38:00 39 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
loongarch64 1 2.0 2024/05/17 11:13:00 34 2024/05/17 11:13:00 34
linux 39 78.0 2024/05/17 10:38:00 39 2024/05/17 12:32:00 34
solaris 11 22.0 2024/05/17 11:17:00 44 2024/05/17 12:24:00 45
3.3.1 18 36.0 2024/05/17 11:05:00 37 2024/05/17 12:24:00 30
3.2.2 11 22.0 2024/05/17 11:17:00 44 2024/05/17 12:24:00 45
3.2.3 21 42.0 2024/05/17 10:38:00 39 2024/05/17 12:32:00 34

Source:

{ Basic test suite for the strings unit }
Program TStrings1;

uses
   strings;

procedure failed;
  begin
     writeln('Failed.');
     halt(1);
  end;

procedure teststrlen;
  Const
     P1 : PChar = '';
     P2 : PChar = 'This is a constant pchar string';
  begin
     if strlen(P1)<>0 then
       failed;
     if strlen(P2)<>31 then
       failed;
  end;

procedure teststrcomp;
  Const
     P1 : PChar = 'This is the first string.';
     P2 : PCHar = 'This is the second string.';
     P3 : PChar = 'This is the first string.';
  begin
     If StrComp (P1,P2)=0 then
       failed;
     If StrComp (P1,P3)<>0 then
       failed;
     If StrComp (P1,P2)>0 then
       failed;
     If StrComp (P2,P1)<0 then
       failed;
  end;

procedure teststrpas;
  Const
     P1 : PChar = 'This is a PCHAR string';
     P2 : PChar = '';
  var
     S : string;
  begin
     S:=StrPas(P1);
     if S<>'This is a PCHAR string' then
       failed;
     S:=StrPas(P2);
     if S<>'' then
       failed;
end;


procedure teststrlcomp;
  Const
     P1 : PChar = 'This is the first string.';
     P2 : PCHar = 'This is the second string.';
     P3 : PChar = 'This is the first string.';
  Var
     L : Longint;
  begin
     L:=1;
     While StrLComp(P1,P2,L)=0 do
       inc (L);
     if L<>13 then failed;
     If StrLComp (P1,P2,255)=0 then
       failed;
     If StrLComp (P1,P3,100)<>0 then
       failed;
     If StrLComp (P1,P2,65535)>0 then
       failed;
     If StrLComp (P2,P1,12341234)<0 then
       failed;
  end;


procedure teststrpcopy;
  Const
     S1 = 'This is a normal string.';
     S2 = '';
  Var
     P : array[0..255] of char;
  begin
     if StrPCopy(P,S1)<>P then
       failed;
     if StrComp(P,S1)<>0 then
       failed;
     if StrPCopy(P,S2)<>P then
       failed;
     if StrComp(P,S2)<>0 then
       failed;
  end;


procedure teststrend;
  Const
     P : PChar = 'This is a PCHAR string.';
  begin
     If StrEnd(P)-P<>23 then
       failed;
  end;


procedure teststrcopy;
  Const
     P1 : PChar = 'This a test string 012345678901234567890123456789012345678901234567890123456789';
     P2 : PChar = '';
  var
     Buf : array[0..255] of char;
  begin
     if StrCopy(Buf,P1)<>Buf then
       failed;
     if StrComp(Buf,P1)<>0 then
       failed;
     if StrCopy(Buf,P2)<>Buf then
       failed;
     if StrComp(Buf,P2)<>0 then
       failed;
  end;


procedure teststrscanstrrscan;
  Const
    P : PChar = 'This is a PCHAR string.';
    S : Char = 's' ;
begin
  if StrComp(StrScan(P,s),'s is a PCHAR string.')<>0 then
    failed;
  if StrComp(StrRScan(P,s),'string.')<>0 then
    failed;
end;


begin
   write('Testing strlen ... ');
   teststrlen;
   writeln('Success.');
   write('Testing strcomp ... ');
   teststrcomp;
   writeln('Success.');
   write('Testing strlcomp ... ');
   teststrlcomp;
   writeln('Success.');
   write('Testing strpas ... ');
   teststrpas;
   writeln('Success.');
   write('Testing strcopy ... ');
   teststrcopy;
   writeln('Success.');
   write('Testing strpcopy ... ');
   teststrpcopy;
   writeln('Success.');
   write('Testing strend ... ');
   teststrend;
   writeln('Success.');
   write('Testing strscan/strrscan ... ');
   teststrscanstrrscan;
   writeln('Success.');
end.

Link to SVN view of test/units/strings/tstrings1.pp source.