From e9a1ed94463bfca25c989848ea502ca57fbc408d Mon Sep 17 00:00:00 2001 From: pierre <pierre@freepascal.org> Date: Fri, 22 Jul 2016 06:26:17 +0000 Subject: [PATCH] Add fpwidestring and unicodeducet units for go32v2 tests related to unicode support git-svn-id: trunk@34168 - --- tests/test/tcpstr1.pp | 16 ++++++++++++++++ tests/test/tunistr6.pp | 11 +++++++++++ tests/test/tunistr7.pp | 11 +++++++++++ tests/test/twide3.pp | 6 +++--- tests/test/twide6.pp | 11 +++++++++++ tests/test/twide7.pp | 14 ++++++++++++-- tests/test/twrstr9.pp | 17 +++++++++++++++++ 7 files changed, 81 insertions(+), 5 deletions(-) diff --git a/tests/test/tcpstr1.pp b/tests/test/tcpstr1.pp index 3f0f9a490f..3dca327228 100644 --- a/tests/test/tcpstr1.pp +++ b/tests/test/tcpstr1.pp @@ -1,6 +1,22 @@ +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} {$ifdef unix} uses {$ifdef darwin}iosxwstr{$else}cwstring{$endif}; +{$else} +uses + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, + {$endif} + { The unit strings is not really used here, + but simpifies the conditional construction + for fpwidestring and unicodeducet use } + strings; {$endif} type diff --git a/tests/test/tunistr6.pp b/tests/test/tunistr6.pp index 332a1cc56f..83e7a5776a 100644 --- a/tests/test/tunistr6.pp +++ b/tests/test/tunistr6.pp @@ -1,9 +1,20 @@ {%skiptarget=wince} {$codepage utf-8} +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} + uses {$ifdef unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$endif} + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, + {$endif} sysutils; procedure doerror(i : integer); diff --git a/tests/test/tunistr7.pp b/tests/test/tunistr7.pp index d1905a792f..f65fd43ddc 100644 --- a/tests/test/tunistr7.pp +++ b/tests/test/tunistr7.pp @@ -1,9 +1,20 @@ {$codepage utf-8} +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} + uses {$ifdef unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$endif unix} + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, + {$endif} sysutils; procedure testwcmp; diff --git a/tests/test/twide3.pp b/tests/test/twide3.pp index 28388fb7e6..4c100964ff 100644 --- a/tests/test/twide3.pp +++ b/tests/test/twide3.pp @@ -1,4 +1,4 @@ -{ %skiptarget=win32,win64,wince,os2,emx } +{ %skiptarget=win32,win64,wince,os2,emx,go32v2,msdos } { This test is only useful if the local codepage is utf-8 which usually not the case on windows (and never can be the case on OS/2) } @@ -27,7 +27,7 @@ begin writeln(t,'łóżka'); close(t); reset(t); - + try read(t,wc); if wc<>'ł' then @@ -37,7 +37,7 @@ begin // erase(t); raise; end; - + reset(t); try readln(t,a); diff --git a/tests/test/twide6.pp b/tests/test/twide6.pp index d0a3638174..cbfa1e1aed 100644 --- a/tests/test/twide6.pp +++ b/tests/test/twide6.pp @@ -1,8 +1,19 @@ {%skiptarget=wince} {$codepage utf-8} + +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} uses {$ifdef unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, + {$endif} + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, {$endif} sysutils; diff --git a/tests/test/twide7.pp b/tests/test/twide7.pp index 2028ed5909..4ac4cd9a5a 100644 --- a/tests/test/twide7.pp +++ b/tests/test/twide7.pp @@ -1,9 +1,19 @@ {$codepage utf-8} +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} uses {$ifdef unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$endif unix} + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, + {$endif} sysutils; procedure testwcmp; @@ -16,7 +26,7 @@ begin s:=w1; w1:=s; w2:=w1; - + if (w1<>w2) then halt(1); w1[2]:='f'; @@ -44,4 +54,4 @@ end; begin testwcmp; -end. \ No newline at end of file +end. diff --git a/tests/test/twrstr9.pp b/tests/test/twrstr9.pp index c1e5458fc7..5d08e6c888 100644 --- a/tests/test/twrstr9.pp +++ b/tests/test/twrstr9.pp @@ -1,8 +1,25 @@ {$codepage utf8} +{$ifdef go32v2} + {$define USE_FPWIDESTRING_UNIT} + {$define USE_UNICODEDUCET_UNIT} +{$endif} + {$ifdef unix} uses {$ifdef darwin}iosxwstr{$else}cwstring{$endif}; +{$else} +uses + {$ifdef USE_FPWIDESTRING_UNIT} + fpwidestring, + {$endif} + {$ifdef USE_UNICODEDUCET_UNIT} + unicodeducet, + {$endif} + { The unit strings is not really used here, + but simpifies the conditional construction + for fpwidestring and unicodeducet use } + strings; {$endif} type