[Lldb-commits] [lldb] 82a46cd - [test] Remove named function arguments from TestSBEnvironment
Jordan Rupprecht via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 21 10:05:49 PST 2022
Author: Jordan Rupprecht
Date: 2022-11-21T10:05:41-08:00
New Revision: 82a46cd247c3980f86443a54fbe0a124beee7d26
URL: https://github.com/llvm/llvm-project/commit/82a46cd247c3980f86443a54fbe0a124beee7d26
DIFF: https://github.com/llvm/llvm-project/commit/82a46cd247c3980f86443a54fbe0a124beee7d26.diff
LOG: [test] Remove named function arguments from TestSBEnvironment
This is not available in all versions of swig 3.
Added:
Modified:
lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
Removed:
################################################################################
diff --git a/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py b/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
index dfd919b40eb5d..8144ceeaa62bb 100644
--- a/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
+++ b/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
@@ -41,25 +41,27 @@ def test_launch_info(self):
env = launch_info.GetEnvironment()
env_count = env.GetNumValues()
- env.Set("FOO", "bar", overwrite=True)
+ env.Set("FOO", "bar", True)
self.assertEqual(env.GetNumValues(), env_count + 1)
# Make sure we only modify the copy of the launchInfo's environment
self.assertEqual(launch_info.GetEnvironment().GetNumValues(), env_count)
- launch_info.SetEnvironment(env, append=True)
+ # Note: swig >= 3.0.3 can use named parameters, omit to support <= 3.0.2.
+ # i.e. launch_info.SetEnvironment(env, append=True)
+ launch_info.SetEnvironment(env, True)
self.assertEqual(launch_info.GetEnvironment().GetNumValues(), env_count + 1)
- env.Set("FOO", "baz", overwrite=True)
- launch_info.SetEnvironment(env, append=True)
+ env.Set("FOO", "baz", True)
+ launch_info.SetEnvironment(env, True)
self.assertEqual(launch_info.GetEnvironment().GetNumValues(), env_count + 1)
self.assertEqual(launch_info.GetEnvironment().Get("FOO"), "baz")
# Make sure we can replace the launchInfo's environment
env.Clear()
- env.Set("BAR", "foo", overwrite=True)
+ env.Set("BAR", "foo", True)
env.PutEntry("X=y")
- launch_info.SetEnvironment(env, append=False)
+ launch_info.SetEnvironment(env, False)
self.assertEqualEntries(launch_info.GetEnvironment(), ["BAR=foo", "X=y"])
@@ -87,8 +89,10 @@ def test_creating_and_modifying_environment(self):
self.assertEqual(env.Get("BAR"), None)
# We also test empty values
- self.assertTrue(env.Set("FOO", "", overwrite=False))
- env.Set("BAR", "foo", overwrite=False)
+ # Note: swig >= 3.0.3 can use named parameters, omit to support <= 3.0.2.
+ # i.e. env.Set("FOO", "", overwrite=False)
+ self.assertTrue(env.Set("FOO", "", False))
+ env.Set("BAR", "foo", False)
self.assertEqual(env.Get("FOO"), "")
self.assertEqual(env.Get("BAR"), "foo")
@@ -98,7 +102,7 @@ def test_creating_and_modifying_environment(self):
self.assertEqualEntries(env, ["FOO=", "BAR=foo"])
# Make sure modifications work
- self.assertFalse(env.Set("FOO", "bar", overwrite=False))
+ self.assertFalse(env.Set("FOO", "bar", False))
self.assertEqual(env.Get("FOO"), "")
env.PutEntry("FOO=bar")
@@ -115,15 +119,15 @@ def test_creating_and_modifying_environment(self):
entries = lldb.SBStringList()
entries.AppendList(["X=x", "Y=y"], 2)
- env.SetEntries(entries, append=True)
+ env.SetEntries(entries, True)
self.assertEqualEntries(env, ["BAR=foo", "X=x", "Y=y"])
- env.SetEntries(entries, append=False)
+ env.SetEntries(entries, False)
self.assertEqualEntries(env, ["X=x", "Y=y"])
entries.Clear()
entries.AppendList(["X=y", "Y=x"], 2)
- env.SetEntries(entries, append=True)
+ env.SetEntries(entries, True)
self.assertEqualEntries(env, ["X=y", "Y=x"])
# Test clear
More information about the lldb-commits
mailing list