Browse Source

tests: apply Inoussa patches to fix errors in his tests

git-svn-id: trunk@19469 -
paul 14 years ago
parent
commit
e4abb1731c

+ 2 - 13
tests/test/tcpstransistr2shortstring.pp

@@ -17,27 +17,16 @@ type
 var
   s : ts866;
   i : Integer;
-  sa : ansistring;
   ss : ShortString;
 begin
-  sa := '123'#196#200#250;
-  ss := sa;
-  if (Length(sa) <> Length(ss)) then
-    doerror(1);
-  for i := 1 to Length(sa) do
-    begin
-      if (Byte(ss[i]) <> Byte(sa[i])) then
-        doerror(2)
-    end;
-
   s := '123'#196#200#250;
   ss := s;
   if (Length(s) <> Length(ss)) then
-    doerror(3);
+    doerror(1);
   for i := 1 to Length(s) do
     begin
       if (Byte(ss[i]) <> Byte(s[i])) then
-        doerror(4)
+        doerror(2)
     end;
 
   WriteLn('Ok');

+ 0 - 17
tests/test/tcpstransistr2widechararray.pp

@@ -16,27 +16,10 @@ type
 var
   x : ts850;
   i : Integer;
-  sa : ansistring;
   ua : array[0..7] of UnicodeChar;
   uc : UnicodeChar;
   us : UnicodeString;
 begin
-{$ifdef broken}
-  
-  This only works if the DefaultSystemCodePage is guaranteed to be
-  different from utf-8 }
-
-  sa := 'abc'#$00A9#$00AE'123';
-  ua := sa;
-  for i := 1 to Length(sa) do
-    begin
-      uc := sa[i];
-      if (uc <> ua[i-1]) then begin
-        writeln(i);
-        doerror(1);
-      end;
-    end;
-{$endif}
   x := 'abc'#$00A9#$00AE'123';
   ua := x;
   us := x;

+ 2 - 2
tests/test/tcpstransistrcopy.pp

@@ -1,4 +1,4 @@
-uses
+uses
 {$ifdef unix}
   cwstring,
 {$endif unix}
@@ -18,7 +18,7 @@ var
   x, y, z : ts850;
   i : Integer;
   c : Integer;
-  sa : ansistring;
+  sa : ts850;
 begin
   sa := 'abc'#$00A9#$00AE'123';
   x := Copy(sa,1,2);