aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-01-01 21:16:40 -0500
committerGraham Bloice <graham.bloice@trihedral.com>2015-01-02 13:09:16 +0000
commit3cc6aee32a54283455fa3a8832874a22b9d41114 (patch)
treec9ea0784107a45c53810c0ee2edf286043079440
parent55c385e610d5fa89d78075cce66741fb582d948b (diff)
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>
-rw-r--r--test/lua/gregex.lua8
1 files changed, 7 insertions, 1 deletions
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")