xref: /llvm-project/lldb/test/API/lang/cpp/static_methods/TestCPPStaticMethods.py (revision 4bee2afcd7ea10c9f58f6172924f822849fed8f9)
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
13    mydir = TestBase.compute_mydir(__file__)
14
15    def test_with_run_command(self):
16        """Test that static methods are properly distinguished from regular methods"""
17        self.build()
18        lldbutil.run_to_source_breakpoint(self, "// Break here", lldb.SBFileSpec("main.cpp"))
19
20        self.expect_expr("A::getStaticValue()", result_type="int", result_value="5")
21        self.expect_expr("a.getMemberValue()", result_type="int", result_value="3")
22