xref: /llvm-project/lldb/test/API/lang/cpp/static_methods/TestCPPStaticMethods.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Tests expressions that distinguish between static and non-static methods.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10
11class CPPStaticMethodsTestCase(TestBase):
12    def test_with_run_command(self):
13        """Test that static methods are properly distinguished from regular methods"""
14        self.build()
15        lldbutil.run_to_source_breakpoint(
16            self, "// Break here", lldb.SBFileSpec("main.cpp")
17        )
18
19        self.expect_expr("A::getStaticValue()", result_type="int", result_value="5")
20        self.expect_expr("a.getMemberValue()", result_type="int", result_value="3")
21