2 Test calling an expression with errors that a FixIt can fix.
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
import lldbutil
11 class NestedExpressions(TestBase
):
12 def test_enum_in_nested_structs(self
):
14 Test expressions that references an enumeration in nested structs.
17 exe_path
= self
.getBuildArtifact("a.out")
18 target
= self
.dbg
.CreateTarget(exe_path
)
19 self
.assertTrue(target
, "Target: %s is not valid." % (exe_path
))
21 "A::B::C::EnumType::Eleven",
22 result_type
="A::B::C::EnumType",
23 result_value
="Eleven",
26 def test_struct_in_nested_structs(self
):
28 Test expressions that references a struct in nested structs.
31 exe_path
= self
.getBuildArtifact("a.out")
32 target
= self
.dbg
.CreateTarget(exe_path
)
33 self
.assertTrue(target
, "Target: %s is not valid." % (exe_path
))
34 self
.expect_expr("sizeof(A::B::C)", result_value
="1")
35 self
.expect_expr("sizeof(A::B)", result_value
="2")
37 # Fails on Windows for unknown reasons.
39 def test_static_in_nested_structs(self
):
41 Test expressions that references a static variable in nested structs.
44 (target
, process
, thread
, bkpt
) = lldbutil
.run_to_source_breakpoint(
45 self
, "Stop here to evaluate expressions", lldb
.SBFileSpec("main.cpp")
48 "A::B::C::enum_static",
49 result_type
="A::B::C::EnumType",
50 result_value
="Eleven",
53 def test_enum_in_nested_namespaces(self
):
55 Test expressions that references an enumeration in nested namespaces.
58 exe_path
= self
.getBuildArtifact("a.out")
59 target
= self
.dbg
.CreateTarget(exe_path
)
60 self
.assertTrue(target
, "Target: %s is not valid." % (exe_path
))
62 "a::b::c::Color::Blue", result_type
="a::b::c::Color", result_value
="Blue"
65 def test_static_in_nested_namespaces(self
):
67 Test expressions that references an enumeration in nested namespaces.
70 (target
, process
, thread
, bkpt
) = lldbutil
.run_to_source_breakpoint(
71 self
, "Stop here to evaluate expressions", lldb
.SBFileSpec("main.cpp")
73 self
.expect_expr("a::b::c::d", result_type
="int", result_value
="12")