* fix test for targets not having a real wide string

git-svn-id: trunk@47637 -
This commit is contained in:
florian 2020-11-29 20:53:15 +00:00
parent 706d89d6cc
commit b7e2b751cf
2 changed files with 23 additions and 10 deletions

View File

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

View File

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