value_check = ValueCheck(type=result_type, value=result_value,
summary=result_summary, children=result_children)
value_check.check_value(self, eval_result, str(eval_result))
+ return eval_result
def invoke(self, obj, name, trace=False):
"""Use reflection to call a method dynamically with no argument."""
clang_ast, decl_ctx, clang::SourceLocation(), clang::SourceLocation(),
&clang_ast.Idents.get(typedef_name),
clang_ast.getTrivialTypeSourceInfo(qual_type));
+ decl_ctx->addDecl(decl);
SetOwningModule(decl, TypePayloadClang(payload).GetOwningModule());
clang::TagDecl *tdecl = nullptr;
# First of all, check that we can get a typedefed type correctly in a simple case
- expr_result = frame.EvaluateExpression("(SF)s")
- self.assertTrue(expr_result.IsValid(), "Expression failed with: " + str(expr_result.GetError()))
+ expr_result = self.expect_expr("(SF)s", result_children=[ValueCheck(value="0.5")])
+ self.expect_expr("(ns::SF)s", result_children=[ValueCheck(value="0.5")])
+ self.expect_expr("(ST::SF)s", result_children=[ValueCheck(value="0.5")])
+
+ self.filecheck("image dump ast a.out", __file__, "--strict-whitespace")
+# CHECK: {{^}}|-TypedefDecl {{.*}} SF 'S<float>'
+# CHECK: {{^}}|-NamespaceDecl {{.*}} ns
+# CHECK-NEXT: {{^}}| `-TypedefDecl {{.*}} SF 'S<float>'
+# CHECK: {{^}}`-CXXRecordDecl {{.*}} struct ST definition
+# CHECK: {{^}} `-TypedefDecl {{.*}} SF 'S<float>'
typedef_type = expr_result.GetType();
self.assertTrue(typedef_type.IsValid(), "Can't get `SF` type of evaluated expression")