mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-10 05:26:56 +00:00
32 lines
1.5 KiB
TOML
32 lines
1.5 KiB
TOML
|
# This test checks that we can correctly distinguish between types with the same
|
||
|
# name in different namespaces.
|
||
|
includes = ["queue", "stack"]
|
||
|
definitions = '''
|
||
|
namespace nsA {
|
||
|
struct Foo {
|
||
|
int x;
|
||
|
};
|
||
|
} // namespace nsA
|
||
|
namespace nsB {
|
||
|
struct Foo {
|
||
|
int y;
|
||
|
int z;
|
||
|
};
|
||
|
} // namespace nsB
|
||
|
'''
|
||
|
[cases]
|
||
|
[cases.queue]
|
||
|
param_types = ["const std::queue<std::pair<nsA::Foo, nsB::Foo>>&"]
|
||
|
setup = "return std::queue<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>({{ns_namespaces::nsA::Foo(), ns_namespaces::nsB::Foo()}});"
|
||
|
expect_json = '''[{
|
||
|
"typeName": "queue<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::deque<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::allocator<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo> > > >",
|
||
|
"staticSize": 80, "dynamicSize": 12, "length": 1, "capacity": 1, "elementStaticSize": 12
|
||
|
}]'''
|
||
|
[cases.stack]
|
||
|
param_types = ["const std::stack<std::pair<nsA::Foo, nsB::Foo>>&"]
|
||
|
setup = "return std::stack<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>({{ns_namespaces::nsA::Foo(), ns_namespaces::nsB::Foo()}});"
|
||
|
expect_json = '''[{
|
||
|
"typeName": "stack<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::deque<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::allocator<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo> > > >",
|
||
|
"staticSize": 80, "dynamicSize": 12, "length": 1, "capacity": 1, "elementStaticSize": 12
|
||
|
}]'''
|