<rdar://problem/14086503>

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

llvm-svn: 184265
This commit is contained in:
Enrico Granata 2013-06-19 00:20:57 +00:00
parent d223563a59
commit 9ac21aef9b
2 changed files with 23 additions and 27 deletions

View File

@ -39,7 +39,7 @@ class StdMapDataFormatterTestCase(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)
@ -68,7 +68,7 @@ class StdMapDataFormatterTestCase(TestBase):
substrs = ['map has 0 items',
'{}'])
self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect('frame variable ii',
substrs = ['map has 2 items',
@ -79,7 +79,7 @@ class StdMapDataFormatterTestCase(TestBase):
'first = 1',
'second = 1'])
self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect('frame variable ii',
substrs = ['map has 4 items',
@ -90,8 +90,7 @@ class StdMapDataFormatterTestCase(TestBase):
'first = 3',
'second = 1'])
self.runCmd("n");self.runCmd("n");
self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable ii",
substrs = ['map has 9 items',
@ -133,20 +132,19 @@ class StdMapDataFormatterTestCase(TestBase):
#self.expect("expression ii[8]", matching=False, error=True,
# substrs = ['1234567'])
self.runCmd("n")
self.runCmd("c")
self.expect('frame variable ii',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n")
self.runCmd("frame variable si --show-types")
self.expect('frame variable si',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n")
self.runCmd("c")
self.expect('frame variable si',
substrs = ['map has 1 items',
@ -154,7 +152,7 @@ class StdMapDataFormatterTestCase(TestBase):
'first = \"zero\"',
'second = 0'])
self.runCmd("n");self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable si",
substrs = ['map has 5 items',
@ -208,20 +206,19 @@ class StdMapDataFormatterTestCase(TestBase):
#self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
self.runCmd("n")
self.runCmd("c")
self.expect('frame variable si',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n")
self.runCmd("frame variable is --show-types")
self.expect('frame variable is',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n");self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable is",
substrs = ['map has 4 items',
@ -269,20 +266,19 @@ class StdMapDataFormatterTestCase(TestBase):
#self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
self.runCmd("n")
self.runCmd("c")
self.expect('frame variable is',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n")
self.runCmd("frame variable ss --show-types")
self.expect('frame variable ss',
substrs = ['map has 0 items',
'{}'])
self.runCmd("n");self.runCmd("n");self.runCmd("n");self.runCmd("n");
self.runCmd("c");
self.expect("frame variable ss",
substrs = ['map has 4 items',
@ -329,7 +325,7 @@ class StdMapDataFormatterTestCase(TestBase):
#self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
self.runCmd("n")
self.runCmd("c")
self.expect('frame variable ss',
substrs = ['map has 0 items',

View File

@ -13,43 +13,43 @@ int main()
ii[0] = 0; // Set break point at this line.
ii[1] = 1;
ii[2] = 0;
ii[2] = 0;// Set break point at this line.
ii[3] = 1;
ii[4] = 0;
ii[4] = 0;// Set break point at this line.
ii[5] = 1;
ii[6] = 0;
ii[7] = 1;
ii[85] = 1234567;
ii.clear();
ii.clear();// Set break point at this line.
strint_map si;
si["zero"] = 0;
si["one"] = 1;
si["zero"] = 0;// Set break point at this line.
si["one"] = 1;// Set break point at this line.
si["two"] = 2;
si["three"] = 3;
si["four"] = 4;
si.clear();
si.clear();// Set break point at this line.
intstr_map is;
is[85] = "goofy";
is[85] = "goofy";// Set break point at this line.
is[1] = "is";
is[2] = "smart";
is[3] = "!!!";
is.clear();
is.clear();// Set break point at this line.
strstr_map ss;
ss["ciao"] = "hello";
ss["ciao"] = "hello";// Set break point at this line.
ss["casa"] = "house";
ss["gatto"] = "cat";
ss["a Mac.."] = "..is always a Mac!";
ss.clear();
ss.clear();// Set break point at this line.
return 0;
return 0;// Set break point at this line.
}