1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 02:02:17 -05:00

Tests: More finder.simba changes.

This commit is contained in:
Merlijn Wajer 2011-08-10 14:22:02 +02:00
parent ec3892a037
commit ec71ac3ee3

View File

@ -77,19 +77,11 @@ begin
write_str(inttostr(Pinteger(@int)^)); write_str(inttostr(Pinteger(@int)^));
end; end;
procedure write_tpa(tpa: tpointarray);
var s: string;
i: integer;
begin
for i := 0 to length(tpa) - 1 do
s:=s+tostring(tpa[i]);
write_str(s);
end;
procedure test_findcolor; procedure test_findcolor;
var i: integer; var i: integer;
var foo, bar: integer; var foo, bar: integer;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
findcolor(foo, foo, col, 0, 0, w - 1, h - 1); findcolor(foo, foo, col, 0, 0, w - 1, h - 1);
@ -108,6 +100,7 @@ procedure test_findcolorspiral;
var i: integer; var i: integer;
var foo, bar: integer; var foo, bar: integer;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -132,6 +125,7 @@ procedure test_findcolorspiraltolerance;
var i: integer; var i: integer;
var foo, bar: integer; var foo, bar: integer;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -156,6 +150,7 @@ procedure test_findcolors;
var i: integer; var i: integer;
tpa: array of tpoint; tpa: array of tpoint;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -176,6 +171,7 @@ procedure test_findcolorstolerance;
var i: integer; var i: integer;
tpa: array of tpoint; tpa: array of tpoint;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -198,6 +194,7 @@ var i: integer;
foo,bar: integer; foo,bar: integer;
tpa: array of tpoint; tpa: array of tpoint;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -221,6 +218,7 @@ procedure test_countcolor;
var i: integer; var i: integer;
count: integer; count: integer;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -238,6 +236,7 @@ procedure test_countcolortolerance;
var i: integer; var i: integer;
count: integer; count: integer;
begin begin
write_str('------------------------------------------------');
t := gettickcount(); t := gettickcount();
for i := 0 to bench_times do for i := 0 to bench_times do
begin begin
@ -251,12 +250,19 @@ begin
end; end;
var cts: integer;
begin begin
f := rewritefile('/home/merlijn/Programs/simba/Tests/lape/' + out_file, false); f := rewritefile('/home/merlijn/Programs/simba/Tests/lape/' + out_file, false);
bmp := loadbitmap(test_bmp); bmp := loadbitmap(test_bmp);
settargetbitmap(bmp); settargetbitmap(bmp);
getbitmapsize(bmp,w,h); getbitmapsize(bmp,w,h);
for cts := 0 to 2 do
begin
SetColorToleranceSpeed(cts);
test_findcolor(); test_findcolor();
test_findcolorspiral(); test_findcolorspiral();
test_findcolorspiraltolerance(); test_findcolorspiraltolerance();
@ -267,6 +273,7 @@ begin
test_countcolor(); test_countcolor();
test_countcolortolerance(); test_countcolortolerance();
end;
setdesktopasclient(); setdesktopasclient();
closefile(f); closefile(f);