Browse Source

* hook up CompareUnicodeStringProc and CompareTextUnicodeStringProc in
cwstring (fixes webtbs/tw17591.pp on unix platforms)
* enhanced webtbs/tw17591.pp so it also (superficially) checks the
correctness of the called routines, and add cwstring for unix platforms

git-svn-id: trunk@16298 -

Jonas Maebe 14 years ago
parent
commit
c4488f6b3a
2 changed files with 11 additions and 5 deletions
  1. 2 2
      rtl/unix/cwstring.pp
  2. 9 3
      tests/webtbs/tw17591.pp

+ 2 - 2
rtl/unix/cwstring.pp

@@ -771,13 +771,13 @@ begin
       StrUpperAnsiStringProc:=@AnsiStrUpper;
       ThreadInitProc:=@InitThread;
       ThreadFiniProc:=@FiniThread;
-{$ifndef VER2_2}
       { Unicode }
       Unicode2AnsiMoveProc:=@Wide2AnsiMove;
       Ansi2UnicodeMoveProc:=@Ansi2WideMove;
       UpperUnicodeStringProc:=@UpperWideString;
       LowerUnicodeStringProc:=@LowerWideString;
-{$endif VER2_2}
+      CompareUnicodeStringProc:=@CompareWideString;
+      CompareTextUnicodeStringProc:=@CompareTextWideString;
     end;
   SetUnicodeStringManager(CWideStringManager);
 end;

+ 9 - 3
tests/webtbs/tw17591.pp

@@ -2,13 +2,19 @@ program comparetext;
 {$ifdef FPC}{$mode objfpc}{$h+}{$endif}
 {$ifdef mswindows}{$apptype console}{$endif}
 uses
- sysutils{,msesysintf};
+ sysutils
+{$ifdef unix}
+ ,cwstring
+{$endif}
+;
 var
  int1: integer;
  ustr1,ustr2: unicodestring;
 begin
  ustr1:= 'A';
  ustr2:= 'a';
- writeln(unicodecomparestr(ustr1,ustr2));
- writeln(unicodecomparetext(ustr1,ustr2));
+ if unicodecomparestr(ustr1,ustr2)=0 then
+   halt(1);
+ if unicodecomparetext(ustr1,ustr2)<>0 then
+   halt(2);
 end.