-
Notifications
You must be signed in to change notification settings - Fork 37
Minimal example of a bug from cppyy #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,6 +139,39 @@ TEST(VariableReflectionTest, DatamembersWithAnonymousStructOrUnion) { | |
| #endif | ||
| } | ||
|
|
||
| TEST(VariableReflectionTest, GetTypeAsString) { | ||
| if (llvm::sys::RunningOnValgrind()) | ||
| GTEST_SKIP() << "XFAIL due to Valgrind report"; | ||
|
|
||
| std::string code = R"( | ||
| namespace my_namespace { | ||
|
|
||
| struct Container { | ||
| int value; | ||
| }; | ||
|
|
||
| struct Wrapper { | ||
| Container item; | ||
| }; | ||
|
|
||
| } | ||
| )"; | ||
|
|
||
| Cpp::CreateInterpreter(); | ||
| EXPECT_EQ(Cpp::Declare(code.c_str()), 0); | ||
|
|
||
| Cpp::TCppScope_t wrapper = | ||
| Cpp::GetScopeFromCompleteName("my_namespace::Wrapper"); | ||
| EXPECT_TRUE(wrapper); | ||
|
|
||
| std::vector<Cpp::TCppScope_t> datamembers; | ||
| Cpp::GetDatamembers(wrapper, datamembers); | ||
| EXPECT_EQ(datamembers.size(), 1); | ||
|
|
||
| EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetVariableType(datamembers[0])), | ||
| "my_namespace::Container"); | ||
|
Comment on lines
+171
to
+172
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The assertion fails here with I need the fully qualified type name.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well the following diff in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the change makes the test pass that's a good sign.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, let me run all the tests and get back to you.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vgvassilev I ran all the tests now, all tests pass but the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @faze-geek, I did not test your changes locally. But if all existing tests and the test from this PR pass, you can open a PR of this branch (create a new branch from this branch). I will take a look at it. We may extend the test with other combinations. Thanks for looking into this. 😄
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure ! Will make the changes soon. |
||
| } | ||
|
|
||
| TEST(VariableReflectionTest, LookupDatamember) { | ||
| std::vector<Decl*> Decls; | ||
| std::string code = R"( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::string" is directly included [misc-include-cleaner]
unittests/CppInterOp/VariableReflectionTest.cpp:6:
+ #include <string>