mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-02-04 04:34:49 +01:00
parent
292e4200c8
commit
66bf7190dd
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -8481,6 +8481,8 @@ tests/test/units/system/tres2.txt -text
|
||||
tests/test/units/system/tres2ext.pp svneol=native#text/plain
|
||||
tests/test/units/system/tres3.pp svneol=native#text/plain
|
||||
tests/test/units/system/tres3ext.pp svneol=native#text/plain
|
||||
tests/test/units/system/tres4.pp svneol=native#text/plain
|
||||
tests/test/units/system/tres4.res -text
|
||||
tests/test/units/system/tresb.rc svneol=native#text/plain
|
||||
tests/test/units/system/tresb.res -text
|
||||
tests/test/units/system/tresext.pp svneol=native#text/plain
|
||||
|
||||
47
tests/test/units/system/tres4.pp
Normal file
47
tests/test/units/system/tres4.pp
Normal file
@ -0,0 +1,47 @@
|
||||
{$mode objfpc}
|
||||
|
||||
program tres4;
|
||||
|
||||
|
||||
uses
|
||||
classes,
|
||||
|
||||
|
||||
sysutils;
|
||||
|
||||
{$R tres4.res}
|
||||
|
||||
function testResource(aName : string): longword;
|
||||
var
|
||||
ResourceStream: TResourceStream;
|
||||
begin
|
||||
resourceStream:=nil;
|
||||
result:=0;
|
||||
try
|
||||
try
|
||||
resourceStream := TResourceStream.Create(HInstance, aname, RT_RCDATA);
|
||||
result:=resourcestream.size;
|
||||
except
|
||||
|
||||
on EResNotFound do
|
||||
begin
|
||||
writeln(aname);
|
||||
halt(1)
|
||||
end;
|
||||
else
|
||||
end;
|
||||
finally
|
||||
freeandnil(ResourceStream);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
writeln('Resources test.');
|
||||
if (testresource('mdtytul100_png')<>50223) then
|
||||
halt(2);
|
||||
if (testresource('mdtoptyt_png') <>136303) then
|
||||
halt(3);
|
||||
writeln('Done.');
|
||||
end.
|
||||
|
||||
BIN
tests/test/units/system/tres4.res
Normal file
BIN
tests/test/units/system/tres4.res
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user