mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
81 lines
2.3 KiB
TOML
81 lines
2.3 KiB
TOML
definitions = '''
|
|
namespace nsA {
|
|
struct C {
|
|
int a;
|
|
};
|
|
}
|
|
namespace nsB {
|
|
struct C {
|
|
int b;
|
|
};
|
|
}
|
|
|
|
// TODO: Custom allocator for deque is generating a compiler error
|
|
|
|
// deque generates compiler errors with custom allocator. But because of
|
|
// name conflicts, OI would fail unless it deletes the allocator param.
|
|
struct Foo {
|
|
std::deque<nsA::C> v1;
|
|
std::deque<nsB::C> v2;
|
|
};
|
|
|
|
'''
|
|
includes = ["deque"]
|
|
|
|
[cases]
|
|
[cases.a]
|
|
param_types = ["const Foo&"]
|
|
setup = '''
|
|
Foo foo;
|
|
foo.v1.resize(1);
|
|
foo.v2.resize(2);
|
|
return {foo};
|
|
'''
|
|
expect_json = '''[{
|
|
"staticSize":160,
|
|
"dynamicSize":12,
|
|
"members":[
|
|
{"name":"v1", "staticSize":80, "dynamicSize":4, "length":1, "capacity":1, "elementStaticSize":4,
|
|
"members":[
|
|
{"name":"", "staticSize":4, "dynamicSize":0,
|
|
"members":[
|
|
{"name":"a", "staticSize":4, "dynamicSize":0}
|
|
]}
|
|
]},
|
|
{"name":"v2", "staticSize":80, "dynamicSize":8, "length":2, "capacity":2, "elementStaticSize":4,
|
|
"members":[
|
|
{"name":"", "staticSize":4, "dynamicSize":0,
|
|
"members":[
|
|
{"name":"b", "staticSize":4, "dynamicSize":0}
|
|
]},
|
|
{"name":"", "staticSize":4, "dynamicSize":0,
|
|
"members":[
|
|
{"name":"b", "staticSize":4, "dynamicSize":0}
|
|
]}
|
|
]}
|
|
]}]'''
|
|
expect_json_v2 = '''[{
|
|
"size":1312,
|
|
"staticSize":160,
|
|
"exclusiveSize":0,
|
|
"members":[
|
|
{"name":"v1", "size":656, "staticSize":80, "exclusiveSize":652, "length":1, "capacity":128,
|
|
"members":[
|
|
{"name":"[]", "staticSize":4, "exclusiveSize":0,
|
|
"members":[
|
|
{"name":"a", "staticSize":4, "exclusiveSize":4}
|
|
]}
|
|
]},
|
|
{"name":"v2", "size":656, "staticSize":80, "exclusiveSize":648, "length":2, "capacity":128,
|
|
"members":[
|
|
{"name":"[]", "staticSize":4, "exclusiveSize":0,
|
|
"members":[
|
|
{"name":"b", "staticSize":4, "exclusiveSize":4}
|
|
]},
|
|
{"name":"[]", "staticSize":4, "exclusiveSize":0,
|
|
"members":[
|
|
{"name":"b", "staticSize":4, "exclusiveSize":4}
|
|
]}
|
|
]}
|
|
]}]'''
|