summaryrefslogtreecommitdiff
path: root/lldb/test/API/lua_api/TestFileHandle.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/lua_api/TestFileHandle.lua')
-rw-r--r--lldb/test/API/lua_api/TestFileHandle.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/test/API/lua_api/TestFileHandle.lua b/lldb/test/API/lua_api/TestFileHandle.lua
index aed45be206ea..8db5ccb2c465 100644
--- a/lldb/test/API/lua_api/TestFileHandle.lua
+++ b/lldb/test/API/lua_api/TestFileHandle.lua
@@ -2,7 +2,8 @@ _T = require('lua_lldb_test').create_test('TestFileHandle')
function _T:TestLegacyFileOutScript()
local f = io.open(self.output, 'w')
- self.debugger:SetOutputFile(f)
+ local sbf = lldb.SBFile(f)
+ self.debugger:SetOutputFile(sbf)
self:handle_command('script print(1+1)')
self.debugger:GetOutputFileHandle():write('FOO\n')
self.debugger:GetOutputFileHandle():flush()
@@ -15,7 +16,8 @@ end
function _T:TestLegacyFileOut()
local f = io.open(self.output, 'w')
- self.debugger:SetOutputFile(f)
+ local sbf = lldb.SBFile(f)
+ self.debugger:SetOutputFile(sbf)
self:handle_command('expression/x 3735928559', false)
f:close()
@@ -26,8 +28,10 @@ end
function _T:TestLegacyFileErr()
local f = io.open(self.output, 'w')
- self.debugger:SetErrorFile(f)
+ local sbf = lldb.SBFile(f)
+ self.debugger:SetErrorFile(sbf)
self:handle_command('lol', false)
+ f:close()
f = io.open(self.output, 'r')
assertStrContains(f:read('*l'), 'is not a valid command')