Skip to content

Commit

Permalink
fixed gh-562 : added expected-to-fail test of lua finalizers table
Browse files Browse the repository at this point in the history
  • Loading branch information
alyapunov committed Feb 6, 2015
1 parent e0ff949 commit 2ea3b40
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/box/finalizers.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expected error: <type 'exceptions.OSError'>
17 changes: 17 additions & 0 deletions test/box/finalizers.test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import sys
import re
import yaml
from lib.tarantool_server import TarantoolServer

server = TarantoolServer(server.ini)
server.script = 'box/lua/finalizers.lua'
server.vardir = os.path.join(server.vardir, 'finalizers')
try:
server.deploy()
except:
print "Expected error:", sys.exc_info()[0]
else:
print "Error! exception did not occured"


23 changes: 23 additions & 0 deletions test/box/lua/finalizers.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env tarantool

--# setopt delimiter ';'

function on_gc(t)
end;

function test_finalizers()
local result = {}
local i = 1
local ffi = require('ffi')
while true do
result[i] = ffi.gc(ffi.cast('void *', NULL), on_gc)
i = i + 1
end
return "done"
end;

--# setopt delimiter ''

test_finalizers()
test_finalizers()

0 comments on commit 2ea3b40

Please sign in to comment.