forked from github/server
more tests
This commit is contained in:
parent
8a48d9323f
commit
4793d0fd34
1 changed files with 23 additions and 1 deletions
|
@ -56,12 +56,34 @@ function test_hse()
|
||||||
write_game("50.txt.1", "text")
|
write_game("50.txt.1", "text")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_realloc()
|
||||||
|
local t1 = os.clock()
|
||||||
|
read_game("571.dat.2", "binary")
|
||||||
|
print(os.clock() - t1)
|
||||||
|
free_game()
|
||||||
|
print(os.clock() - t1)
|
||||||
|
-- and again
|
||||||
|
local t2 = os.clock()
|
||||||
|
read_game("571.dat.2", "binary")
|
||||||
|
print(os.clock() - t2)
|
||||||
|
free_game()
|
||||||
|
print(os.clock() - t2)
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_bmark()
|
||||||
|
local t1 = os.clock()
|
||||||
|
read_game("566.dat", "binary")
|
||||||
|
print(os.clock() - t1)
|
||||||
|
end
|
||||||
|
|
||||||
loadscript("default.lua")
|
loadscript("default.lua")
|
||||||
run_scripts()
|
run_scripts()
|
||||||
-- go
|
-- go
|
||||||
local now = os.clock()
|
local now = os.clock()
|
||||||
test_free()
|
-- test_free()
|
||||||
|
test_bmark()
|
||||||
-- test_hse()
|
-- test_hse()
|
||||||
|
-- test_realloc()
|
||||||
local elapsed = os.clock() - now
|
local elapsed = os.clock() - now
|
||||||
print(elapsed)
|
print(elapsed)
|
||||||
-- text: 50.574
|
-- text: 50.574
|
||||||
|
|
Loading…
Reference in a new issue