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 <hadrielk@yahoo.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
This commit is contained in:
Hadriel Kaplan 2015-01-01 21:16:40 -05:00 committed by Graham Bloice
parent 55c385e610
commit 3cc6aee32a
1 changed files with 7 additions and 1 deletions

View File

@ -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")