(self)
| 7024 | assert isinstance(self.nesting_state.stack[1], cpplint._ClassInfo) |
| 7025 | |
| 7026 | def testArguments(self): |
| 7027 | self.UpdateWithLines(["class A {"]) |
| 7028 | assert len(self.nesting_state.stack) == 1 |
| 7029 | assert isinstance(self.nesting_state.stack[0], cpplint._ClassInfo) |
| 7030 | assert self.nesting_state.stack[0].name == "A" |
| 7031 | assert self.nesting_state.stack[-1].open_parentheses == 0 |
| 7032 | |
| 7033 | self.UpdateWithLines([" void Func(", " struct X arg1,"]) |
| 7034 | assert len(self.nesting_state.stack) == 1 |
| 7035 | assert self.nesting_state.stack[-1].open_parentheses == 1 |
| 7036 | self.UpdateWithLines([" struct X *arg2);"]) |
| 7037 | assert len(self.nesting_state.stack) == 1 |
| 7038 | assert self.nesting_state.stack[-1].open_parentheses == 0 |
| 7039 | |
| 7040 | self.UpdateWithLines(["};"]) |
| 7041 | assert len(self.nesting_state.stack) == 0 |
| 7042 | |
| 7043 | self.UpdateWithLines(["struct B {"]) |
| 7044 | assert len(self.nesting_state.stack) == 1 |
| 7045 | assert isinstance(self.nesting_state.stack[0], cpplint._ClassInfo) |
| 7046 | assert self.nesting_state.stack[0].name == "B" |
| 7047 | |
| 7048 | self.UpdateWithLines(["#ifdef MACRO", " void Func(", " struct X arg1"]) |
| 7049 | assert len(self.nesting_state.stack) == 1 |
| 7050 | assert self.nesting_state.stack[-1].open_parentheses == 1 |
| 7051 | self.UpdateWithLines(["#else"]) |
| 7052 | |
| 7053 | assert len(self.nesting_state.stack) == 1 |
| 7054 | assert self.nesting_state.stack[-1].open_parentheses == 0 |
| 7055 | self.UpdateWithLines([" void Func(", " struct X arg1"]) |
| 7056 | assert len(self.nesting_state.stack) == 1 |
| 7057 | assert self.nesting_state.stack[-1].open_parentheses == 1 |
| 7058 | |
| 7059 | self.UpdateWithLines(["#endif"]) |
| 7060 | assert len(self.nesting_state.stack) == 1 |
| 7061 | assert self.nesting_state.stack[-1].open_parentheses == 1 |
| 7062 | self.UpdateWithLines([" struct X *arg2);"]) |
| 7063 | assert len(self.nesting_state.stack) == 1 |
| 7064 | assert self.nesting_state.stack[-1].open_parentheses == 0 |
| 7065 | |
| 7066 | self.UpdateWithLines(["};"]) |
| 7067 | assert len(self.nesting_state.stack) == 0 |
| 7068 | |
| 7069 | def testInlineAssembly(self): |
| 7070 | self.UpdateWithLines( |
nothing calls this directly
no test coverage detected