|
@@ -30,6 +30,7 @@ const
|
|
|
|
|
|
|
|
|
var
|
|
|
+ arr: array[0..255] of byte;
|
|
|
str1 : shortstring;
|
|
|
str2 : ansistring;
|
|
|
{$ifdef haswidestring}
|
|
@@ -44,6 +45,7 @@ procedure fail;
|
|
|
|
|
|
procedure test_shortstring;
|
|
|
var
|
|
|
+ i: longint;
|
|
|
_failed : boolean;
|
|
|
begin
|
|
|
_failed := false;
|
|
@@ -68,10 +70,14 @@ begin
|
|
|
if str1 <> '' then
|
|
|
_failed := true;
|
|
|
str1:='';
|
|
|
- setstring(str1,PCHAR_NORMAL,512);
|
|
|
- if str1 <> '' then
|
|
|
- _failed := true;
|
|
|
- str1:='';
|
|
|
+ fillchar(arr,sizeof(arr),'a');
|
|
|
+ setstring(str1,@arr[0],512);
|
|
|
+ if length(str1) <> 255 then
|
|
|
+ _failed := true;
|
|
|
+ for i := 1 to length(str1) do
|
|
|
+ if str1[i] <> 'a' then
|
|
|
+ _failed := true;
|
|
|
+ str1:='';
|
|
|
setstring(str1,PCHAR_NORMAL,strlen(PCHAR_NORMAL));
|
|
|
if str1 <> HELLO_STRING then
|
|
|
_failed := true;
|
|
@@ -162,7 +168,10 @@ end.
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.2 2002-12-16 20:40:36 peter
|
|
|
+ Revision 1.3 2003-03-04 18:19:48 jonas
|
|
|
+ * adapted tests to fixed implementation
|
|
|
+
|
|
|
+ Revision 1.2 2002/12/16 20:40:36 peter
|
|
|
* win32 fix
|
|
|
|
|
|
Revision 1.1 2002/10/20 11:44:15 carl
|
|
@@ -170,4 +179,4 @@ end.
|
|
|
* args checking is not interactive
|
|
|
+ zero and negative length checking for move/fillchar
|
|
|
|
|
|
-}
|
|
|
+}
|