1""" 2Test SBLaunchInfo 3""" 4 5 6 7from lldbsuite.test.lldbtest import * 8 9 10def lookup(info, key): 11 for i in range(info.GetNumEnvironmentEntries()): 12 KeyEqValue = info.GetEnvironmentEntryAtIndex(i) 13 Key, Value = KeyEqValue.split("=") 14 if Key == key: 15 return Value 16 return "" 17 18class TestSBLaunchInfo(TestBase): 19 20 mydir = TestBase.compute_mydir(__file__) 21 NO_DEBUG_INFO_TESTCASE = True 22 23 def test_environment_getset(self): 24 info = lldb.SBLaunchInfo(None) 25 info.SetEnvironmentEntries(["FOO=BAR"], False) 26 self.assertEquals(1, info.GetNumEnvironmentEntries()) 27 info.SetEnvironmentEntries(["BAR=BAZ"], True) 28 self.assertEquals(2, info.GetNumEnvironmentEntries()) 29 self.assertEquals("BAR", lookup(info, "FOO")) 30 self.assertEquals("BAZ", lookup(info, "BAR")) 31