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,22 +250,30 @@ 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);
test_findcolor(); for cts := 0 to 2 do
test_findcolorspiral(); begin
test_findcolorspiraltolerance(); SetColorToleranceSpeed(cts);
test_findcolors(); test_findcolor();
test_findcolorstolerance(); test_findcolorspiral();
test_findcolorsspiraltolerance(); test_findcolorspiraltolerance();
test_countcolor(); test_findcolors();
test_countcolortolerance(); test_findcolorstolerance();
test_findcolorsspiraltolerance();
test_countcolor();
test_countcolortolerance();
end;
setdesktopasclient(); setdesktopasclient();
closefile(f); closefile(f);