From 3cc6aee32a54283455fa3a8832874a22b9d41114 Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Thu, 1 Jan 2015 21:16:40 -0500 Subject: Lua: regex test suite fails with UTF-8 locale Due to the change in change-id Ib43e16a9d98d08e5ddaff81fd3235f5b64d7b95b, the setlocale() call has been moved earlier in tshark's processing, such that Lua plugins load with the environment locale instead of C-locale. Since that matches Wireshark's behavior, it's good, but it causes the Lua regex test suite to fail. So the test suite needs to be fixed. Bug: 10824 Change-Id: I3dcad15a9e247a1e42d2f708ccfb7272de2fe960 Reviewed-on: https://code.wireshark.org/review/6226 Reviewed-by: Hadriel Kaplan Reviewed-by: Graham Bloice --- test/lua/gregex.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/lua/gregex.lua b/test/lua/gregex.lua index 2ad04ba6dc..fe89607a7e 100644 --- a/test/lua/gregex.lua +++ b/test/lua/gregex.lua @@ -20,6 +20,11 @@ for i,v in ipairs(args) do print(i.." = "..v) end +-- save current locale and replace it with C-locale +local old_locale = os.setlocale() +print("Previous locale was '" .. old_locale .. "', setting it to C-locale now") +os.setlocale("C") + local function testing(...) print("---- Testing "..tostring(...).." ----") end @@ -277,7 +282,8 @@ do assert(nerr == 0, "Test failed!") end - +print("Resetting locale to: " .. old_locale) +os.setlocale(old_locale) print("\n-----------------------------\n") -- cgit v1.2.3