This test case should not rely on stepping behavior because that might chance due to inlining. Set breakpoints where you want them instead. Fixes rdar://18724175

llvm-svn: 220513
This commit is contained in:
Enrico Granata
2014-10-23 21:35:18 +00:00
parent e608aed22b
commit ecbe7c03a0
2 changed files with 7 additions and 13 deletions

View File

@@ -30,14 +30,12 @@ class TypeCompletionTestCase(TestBase):
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
def type_completion_commands(self):
"""Check that types only get completed when necessary."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
lldbutil.run_break_set_by_source_regexp (self, "// Set break point at this line.")
self.runCmd("run", RUN_SUCCEEDED)
@@ -62,15 +60,13 @@ class TypeCompletionTestCase(TestBase):
p_type = p_vector.GetType()
self.assertFalse(p_type.IsTypeComplete(), 'vector<T> complete but it should not be')
self.runCmd("next")
self.runCmd("next")
self.runCmd("continue")
p_vector = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('p')
p_type = p_vector.GetType()
self.assertFalse(p_type.IsTypeComplete(), 'vector<T> complete but it should not be')
self.runCmd("next")
self.runCmd("next")
self.runCmd("continue")
self.runCmd("frame variable p --show-types")
@@ -81,8 +77,7 @@ class TypeCompletionTestCase(TestBase):
self.assertTrue(name_address_type.IsValid(), 'NameAndAddress should be valid')
self.assertFalse(name_address_type.IsTypeComplete(), 'NameAndAddress complete but it should not be')
self.runCmd("next")
self.runCmd("next")
self.runCmd("continue")
self.runCmd("frame variable guy --show-types")
@@ -102,8 +97,7 @@ class TypeCompletionTestCase(TestBase):
self.assertTrue(string.IsValid(), 'std::string should be valid')
self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be')
self.runCmd("next")
self.runCmd("next")
self.runCmd("continue")
p_vector = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('p')
p_type = p_vector.GetType()

View File

@@ -36,14 +36,14 @@ int main (int argc, const char * argv[])
p.push_back(NameAndAddress("Enrico","123 Main Street"));
p.push_back(NameAndAddress("Foo","10710 Johnson Avenue")); // Set break point at this line.
p.push_back(NameAndAddress("Arpia","6956 Florey Street"));
p.push_back(NameAndAddress("Apple","1 Infinite Loop"));
p.push_back(NameAndAddress("Apple","1 Infinite Loop")); // Set break point at this line.
p.push_back(NameAndAddress("Richard","9500 Gilman Drive"));
p.push_back(NameAndAddress("Bar","3213 Windsor Rd"));
for (int j = 0; j<p.size(); j++)
{
NameAndAddress guy = p[j];
std::cout << "Person " << j << " is named " << guy.GetName() << " and lives at " << guy.GetAddress() << std::endl;
std::cout << "Person " << j << " is named " << guy.GetName() << " and lives at " << guy.GetAddress() << std::endl; // Set break point at this line.
}
return 0;