<rdar://problem/14086503>

Hardening the libstdc++ std::vector test case against line table changes

llvm-svn: 184264
This commit is contained in:
Enrico Granata 2013-06-19 00:14:02 +00:00
parent bba8559767
commit d223563a59
2 changed files with 17 additions and 20 deletions

View File

@ -36,7 +36,7 @@ class StdVectorDataFormatterTestCase(TestBase):
"""Test that that file and class static variables display correctly."""
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)
@ -61,7 +61,7 @@ class StdVectorDataFormatterTestCase(TestBase):
self.expect("frame variable numbers",
substrs = ['numbers = size=0'])
self.runCmd("n")
self.runCmd("c")
# first value added
self.expect("frame variable numbers",
@ -70,7 +70,7 @@ class StdVectorDataFormatterTestCase(TestBase):
'}'])
# add some more data
self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable numbers",
substrs = ['numbers = size=4',
@ -104,7 +104,7 @@ class StdVectorDataFormatterTestCase(TestBase):
self.runCmd("type summary delete int_vect")
# add some more data
self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable numbers",
substrs = ['numbers = size=7',
@ -148,12 +148,12 @@ class StdVectorDataFormatterTestCase(TestBase):
self.assertTrue(self.frame().FindVariable("numbers").MightHaveChildren(), "numbers.MightHaveChildren() says False for non empty!")
# clear out the vector and see that we do the right thing once again
self.runCmd("n")
self.runCmd("c")
self.expect("frame variable numbers",
substrs = ['numbers = size=0'])
self.runCmd("n")
self.runCmd("c")
# first value added
self.expect("frame variable numbers",
@ -162,10 +162,7 @@ class StdVectorDataFormatterTestCase(TestBase):
'}'])
# check if we can display strings
self.runCmd("n")
self.runCmd("n")
self.runCmd("n")
self.runCmd("n")
self.runCmd("c")
self.expect("frame variable strings",
substrs = ['goofy',
@ -191,7 +188,7 @@ class StdVectorDataFormatterTestCase(TestBase):
'is',
'smart'])
self.runCmd("n");
self.runCmd("c");
self.expect("frame variable strings",
substrs = ['vector has 4 items'])
@ -211,7 +208,7 @@ class StdVectorDataFormatterTestCase(TestBase):
# check that MightHaveChildren() gets it right
self.assertTrue(self.frame().FindVariable("strings").MightHaveChildren(), "strings.MightHaveChildren() says False for non empty!")
self.runCmd("n")
self.runCmd("c")
self.expect("frame variable strings",
substrs = ['vector has 0 items'])

View File

@ -7,25 +7,25 @@ int main()
{
int_vect numbers;
numbers.push_back(1); // Set break point at this line.
numbers.push_back(12);
numbers.push_back(12); // Set break point at this line.
numbers.push_back(123);
numbers.push_back(1234);
numbers.push_back(12345);
numbers.push_back(12345); // Set break point at this line.
numbers.push_back(123456);
numbers.push_back(1234567);
numbers.clear();
numbers.clear(); // Set break point at this line.
numbers.push_back(7);
numbers.push_back(7); // Set break point at this line.
string_vect strings;
string_vect strings; // Set break point at this line.
strings.push_back(std::string("goofy"));
strings.push_back(std::string("is"));
strings.push_back(std::string("smart"));
strings.push_back(std::string("!!!"));
strings.push_back(std::string("!!!")); // Set break point at this line.
strings.clear();
strings.clear(); // Set break point at this line.
return 0;
return 0;// Set break point at this line.
}