Browse Source

* fix test for targets not having a real wide string

git-svn-id: trunk@47637 -
florian 4 years ago
parent
commit
b7e2b751cf
2 changed files with 23 additions and 10 deletions
  1. 18 10
      tests/webtbs/tw17904.pp
  2. 5 0
      tests/webtbs/tw5086.pp

+ 18 - 10
tests/webtbs/tw17904.pp

@@ -34,7 +34,7 @@ begin
     tmp := Swap(tmp);
     tmp := Swap(tmp);
     {$endif}
     {$endif}
     Variant(Dest^) := tmp;
     Variant(Dest^) := tmp;
-  end;  
+  end;
 end;
 end;
 
 
 type
 type
@@ -126,7 +126,7 @@ begin
   begin
   begin
     write(' BYREF failed');
     write(' BYREF failed');
     Code := Code or 1;
     Code := Code or 1;
-  end;  
+  end;
   if WordRec(tmp).Hi <> absexp then
   if WordRec(tmp).Hi <> absexp then
   begin
   begin
     write(' BYVAL failed');
     write(' BYVAL failed');
@@ -142,7 +142,7 @@ begin
   TVarData(v).vType := cv.VarType;
   TVarData(v).vType := cv.VarType;
 
 
   test('u8:    ', v.foo(cl.u8, cl.u8prop), varbyte);
   test('u8:    ', v.foo(cl.u8, cl.u8prop), varbyte);
-  
+
   test('u16:    ', v.foo(cl.u16, cl.u16prop), varword);       // (Uncertain) D7: treated as Integer
   test('u16:    ', v.foo(cl.u16, cl.u16prop), varword);       // (Uncertain) D7: treated as Integer
   test('u32:    ', v.foo(cl.u32, cl.u32prop), varlongword);   // (Uncertain) D7: treated as Integer ByRef
   test('u32:    ', v.foo(cl.u32, cl.u32prop), varlongword);   // (Uncertain) D7: treated as Integer ByRef
   test('s8:     ', v.foo(cl.s8, cl.s8prop), varshortint);     // (Uncertain) D7: treated as Integer
   test('s8:     ', v.foo(cl.s8, cl.s8prop), varshortint);     // (Uncertain) D7: treated as Integer
@@ -153,29 +153,37 @@ begin
 {$ifdef fpc}
 {$ifdef fpc}
   test('u64:    ', v.foo(cl.u64, cl.u64prop), varword64);
   test('u64:    ', v.foo(cl.u64, cl.u64prop), varword64);
 {$endif}
 {$endif}
-  
+
   test('wordbool:', v.foo(cl.wb, cl.wbprop), varBoolean);
   test('wordbool:', v.foo(cl.wb, cl.wbprop), varBoolean);
   test('curncy:  ', v.foo(cl.cy, cl.cyprop), varCurrency);
   test('curncy:  ', v.foo(cl.cy, cl.cyprop), varCurrency);
-  
+
   test('single:  ', v.foo(cl.sgl, cl.sglprop), varSingle);
   test('single:  ', v.foo(cl.sgl, cl.sglprop), varSingle);
   test('double:  ', v.foo(cl.dbl, cl.dblprop), varDouble);
   test('double:  ', v.foo(cl.dbl, cl.dblprop), varDouble);
   test('extended:', v.foo(cl.ext, cl.extprop), -varDouble);  // not a COM type, passed by value
   test('extended:', v.foo(cl.ext, cl.extprop), -varDouble);  // not a COM type, passed by value
-  
+
   test('date:    ', v.foo(cl.dt, cl.dtprop), varDate);
   test('date:    ', v.foo(cl.dt, cl.dtprop), varDate);
 
 
   test('ansistr: ', v.foo(cl.fastr, cl.astr), varStrArg);
   test('ansistr: ', v.foo(cl.fastr, cl.astr), varStrArg);
+{$ifdef FPC_WINLIKEWIDESTRING}
   test('widestr: ', v.foo(cl.fwstr, cl.wstr), varOleStr);
   test('widestr: ', v.foo(cl.fwstr, cl.wstr), varOleStr);
+{$else FPC_WINLIKEWIDESTRING}
+  test('widestr: ', v.foo(cl.fwstr, cl.wstr), varUStrArg);
+{$endif FPC_WINLIKEWIDESTRING}
 {$ifdef fpc}
 {$ifdef fpc}
   test('unistr:  ', v.foo(cl.fustr, cl.ustr), varUStrArg);
   test('unistr:  ', v.foo(cl.fustr, cl.ustr), varUStrArg);
 {$endif}
 {$endif}
   test('variant: ', v.foo(cl.fvar, cl.varprop), varVariant);
   test('variant: ', v.foo(cl.fvar, cl.varprop), varVariant);
-  
+
   test('IUnknown:', v.foo(cl.fintf, cl.intfprop), varUnknown);
   test('IUnknown:', v.foo(cl.fintf, cl.intfprop), varUnknown);
   test('IDispatch:', v.foo(cl.fdisp, cl.dispprop), varDispatch);
   test('IDispatch:', v.foo(cl.fdisp, cl.dispprop), varDispatch);
-  
+
   // not an COM type, passed by value; Delphi uses varStrArg
   // not an COM type, passed by value; Delphi uses varStrArg
+{$ifdef FPC_WINLIKEWIDESTRING}
   test('shortstr:', v.foo(cl.fsstr, cl.sstr), -varOleStr);
   test('shortstr:', v.foo(cl.fsstr, cl.sstr), -varOleStr);
-  // not an COM type, passed by value
+{$else FPC_WINLIKEWIDESTRING}
+  test('shortstr:', v.foo(cl.fsstr, cl.sstr), -varUStrArg);
+{$endif FPC_WINLIKEWIDESTRING}
+// not an COM type, passed by value
   test('longbool:', v.foo(cl.lb, cl.lbprop), -varBoolean);
   test('longbool:', v.foo(cl.lb, cl.lbprop), -varBoolean);
 
 
   // typecasted ordinals (only one arg is actually used)
   // typecasted ordinals (only one arg is actually used)
@@ -195,4 +203,4 @@ begin
     writeln('Errors: ', Code);
     writeln('Errors: ', Code);
   Halt(Code);
   Halt(Code);
 
 
-end.
+end.

+ 5 - 0
tests/webtbs/tw5086.pp

@@ -28,6 +28,9 @@ begin
   erase(input);
   erase(input);
 end;
 end;
 
 
+var
+  p : pbyte;
+
 procedure dfs(a, b, c, k1: Byte);
 procedure dfs(a, b, c, k1: Byte);
 var
 var
 	x					: Byte;
 	x					: Byte;
@@ -52,6 +55,8 @@ begin
 end;
 end;
 
 
 begin
 begin
+//    p:=@a;
+
 	if (k1 > k) then Exit;
 	if (k1 > k) then Exit;
 	if (a = 1) or (b = 1) or (c = 1) then begin
 	if (a = 1) or (b = 1) or (c = 1) then begin
 		answ := answ + 1;
 		answ := answ + 1;