ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/testsuite/Test12.pas
(Generate patch)

Comparing ibx/trunk/fbintf/testsuite/Test12.pas (file contents):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 309 by tony, Tue Jul 21 08:00:42 2020 UTC

# Line 1 | Line 1
1 < unit Test12;
1 > unit Test12;
2 > {$IFDEF MSWINDOWS}
3 > {$DEFINE WINDOWS}
4 > {$ENDIF}
5  
6 < {$mode objfpc}{$H+}
6 > {$IFDEF FPC}
7 > {$mode delphi}
8  
9   {$codepage UTF8}
10 + {$ENDIF}
11  
12   interface
13  
# Line 26 | Line 31 | type
31      procedure UpdateDatabase(Attachment: IAttachment);
32      procedure QueryDatabase(Attachment: IAttachment);
33    public
34 <    function TestTitle: string; override;
35 <    procedure RunTest(CharSet: string; SQLDialect: integer); override;
34 >    function TestTitle: AnsiString; override;
35 >    procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override;
36    end;
37  
38   implementation
# Line 37 | Line 42 | const
42      'Create Table TestData ('+
43      'RowID Integer not null,'+
44      'Title VarChar(32) Character Set UTF8,'+
45 <    'Notes VarChar(64) Character Set ISO8859_1,'+
45 >    'Notes VarChar(64) Character Set ISO8859_1 collate FR_FR,'+
46      'BlobData Blob sub_type 1 Character Set WIN1252, '+
47      'BlobData2 Blob sub_type 1 Character Set UTF8, '+
48 <    'InClear VarChar(16) Character Set NONE, '+
48 >    'InClear VarChar(16) Character Set OCTETS, '+
49 >    'FixedWidth Char(4) Character set UTF8, '+
50      'Primary Key(RowID)'+
51      ')';
52  
53    sqlGetCharSets = 'Select RDB$CHARACTER_SET_NAME,RDB$CHARACTER_SET_ID from RDB$CHARACTER_SETS order by 2';
54  
55 <  sqlInsert = 'Insert into TestData(RowID,Title,Notes, BlobData,BlobData2,InClear) Values(:RowID,:Title,:Notes,:BlobData,:BlobData2,:InClear)';
55 >  sqlInsert = 'Insert into TestData(RowID,Title,Notes, BlobData,BlobData2,InClear,FixedWidth) '+
56 >              'Values(:RowID,:Title,:Notes,:BlobData,:BlobData2,:InClear,:FixedWidth)';
57  
58  
59   { TTest12 }
# Line 62 | Line 69 | begin
69    with Statement.GetSQLParams do
70    begin
71      ByName('rowid').AsInteger := 1;
72 +    {$IFDEF DCC}
73 +    ByName('title').AsString := UTF8Encode('Blob Test ©€');
74 +    ByName('Notes').AsString := UTF8Encode('Écoute moi');
75 +    {$ELSE}
76      ByName('title').AsString := 'Blob Test ©€';
77      ByName('Notes').AsString := 'Écoute moi';
78 +    {$ENDIF}
79      ByName('BlobData').AsString := 'Some German Special Characters like ÖÄÜöäüß';
80      ByName('BlobData2').AsBlob := Attachment.CreateBlob(Transaction,'TestData','BlobData').SetString('Some German Special Characters like ÖÄÜöäüß');
81      ByName('InClear').AsString := #$01'Test'#$0D#$C3;
82 +    ByName('FixedWidth').AsString := 'É';
83    end;
84    Statement.Execute;
85   end;
# Line 81 | Line 94 | begin
94    ReportResults(Statement);
95   end;
96  
97 < function TTest12.TestTitle: string;
97 > function TTest12.TestTitle: AnsiString;
98   begin
99    Result := 'Test 12: Character Sets';
100   end;
101  
102 < procedure TTest12.RunTest(CharSet: string; SQLDialect: integer);
102 > procedure TTest12.RunTest(CharSet: AnsiString; SQLDialect: integer);
103   var DPB: IDPB;
104      Attachment: IAttachment;
105   begin

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines