Browse Source

+ test for mantis #14112

git-svn-id: trunk@13379 -
Jonas Maebe 16 years ago
parent
commit
66bf7190dd
3 changed files with 49 additions and 0 deletions
  1. 2 0
      .gitattributes
  2. 47 0
      tests/test/units/system/tres4.pp
  3. BIN
      tests/test/units/system/tres4.res

+ 2 - 0
.gitattributes

@@ -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/tres2ext.pp svneol=native#text/plain
 tests/test/units/system/tres3.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/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.rc svneol=native#text/plain
 tests/test/units/system/tresb.res -text
 tests/test/units/system/tresb.res -text
 tests/test/units/system/tresext.pp svneol=native#text/plain
 tests/test/units/system/tresext.pp svneol=native#text/plain

+ 47 - 0
tests/test/units/system/tres4.pp

@@ -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