diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-11-08 07:19:37 -0800 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2024-11-08 07:23:11 -0800 |
| commit | c93eb43a63d3b5c90e828608b5c2063644a3b161 (patch) | |
| tree | c1e4d5817dc03b0328cfe3dfe5162dec1be21e50 /lldb/test/API/lua_api | |
| parent | 7844257fc2afe490ae4b923a770d20dabed5c3c6 (diff) | |
[lldb] Fix TestFileHandle.lua
- Explicitly create an `SBFile`.
- Add missing call to `close`.
- Use `SetErrorFile` in TestLegacyFileErr.
Diffstat (limited to 'lldb/test/API/lua_api')
| -rw-r--r-- | lldb/test/API/lua_api/TestFileHandle.lua | 10 |
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') |
