Skip to content

Commit 95686fa

Browse files
committed
[lldb][NFC] Actually run all expects in lang/cpp/operators
Apparently inline tests stop running anything after an empty line behind an self.expect, which is a very good approach that could never cause people to write tests that never run. This patch removes all the empty lines so that all this test is actually run. Also fixes the broken expects that only passed because they weren't run before. llvm-svn: 370195
1 parent 05e2e29 commit 95686fa

File tree

1 file changed

+6
-12
lines changed
  • lldb/packages/Python/lldbsuite/test/lang/cpp/operators

1 file changed

+6
-12
lines changed

lldb/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ struct C {
4343
int operator>=(int) { return 87; }
4444
int operator>>=(int) { return 88; }
4545

46-
int operator[](int) { return 91; }
47-
int operator()(int) { return 92; }
46+
int operator()(int) { return 91; }
47+
int operator[](int) { return 92; }
4848

4949
operator int() { return 11; }
5050
operator long() { return 12; }
@@ -106,12 +106,10 @@ int main(int argc, char **argv) {
106106
//% self.expect("expr c += 42", endstr=" 42\n")
107107
//% self.expect("expr c++", endstr=" 123\n")
108108
//% self.expect("expr ++c", endstr=" 1234\n")
109-
110109
//% self.expect("expr c - 34", endstr=" 34\n")
111110
//% self.expect("expr c -= 32", endstr=" 32\n")
112-
//% self.expect("expr c--", endstr=" 321\n")
113-
//% self.expect("expr --c", endstr=" 4321\n")
114-
111+
//% self.expect("expr c--", endstr=" 4321\n")
112+
//% self.expect("expr --c", endstr=" 321\n")
115113
//% self.expect("expr c * 3", endstr=" 51\n")
116114
//% self.expect("expr c *= 3", endstr=" 52\n")
117115
//% self.expect("expr c % 3", endstr=" 53\n")
@@ -120,20 +118,17 @@ int main(int argc, char **argv) {
120118
//% self.expect("expr c /= 3", endstr=" 56\n")
121119
//% self.expect("expr c ^ 3", endstr=" 57\n")
122120
//% self.expect("expr c ^= 3", endstr=" 58\n")
123-
124121
//% self.expect("expr c | 3", endstr=" 61\n")
125122
//% self.expect("expr c |= 3", endstr=" 62\n")
126123
//% self.expect("expr c || 3", endstr=" 63\n")
127124
//% self.expect("expr c & 3", endstr=" 64\n")
128125
//% self.expect("expr c &= 3", endstr=" 65\n")
129126
//% self.expect("expr c && 3", endstr=" 66\n")
130-
131127
//% self.expect("expr ~c", endstr=" 71\n")
132128
//% self.expect("expr !c", endstr=" 72\n")
133129
//% self.expect("expr c!=1", endstr=" 73\n")
134130
//% self.expect("expr c=1", endstr=" 74\n")
135131
//% self.expect("expr c==1", endstr=" 75\n")
136-
137132
//% self.expect("expr c<1", endstr=" 81\n")
138133
//% self.expect("expr c<<1", endstr=" 82\n")
139134
//% self.expect("expr c<=1", endstr=" 83\n")
@@ -142,10 +137,9 @@ int main(int argc, char **argv) {
142137
//% self.expect("expr c>>1", endstr=" 86\n")
143138
//% self.expect("expr c>=1", endstr=" 87\n")
144139
//% self.expect("expr c>>=1", endstr=" 88\n")
145-
146140
//% self.expect("expr c(1)", endstr=" 91\n")
147141
//% self.expect("expr c[1]", endstr=" 92\n")
148-
//% self.expect("expr static_cast<int>", endstr=" 11\n")
149-
//% self.expect("expr static_cast<long>", endstr=" 12\n")
142+
//% self.expect("expr static_cast<int>(c)", endstr=" 11\n")
143+
//% self.expect("expr static_cast<long>(c)", endstr=" 12\n")
150144
return 0;
151145
}

0 commit comments

Comments
 (0)