2023-01-20 16:30:02 +00:00
|
|
|
definitions = '''
|
|
|
|
struct CustomComparator {
|
|
|
|
bool operator()(const int& left, const int& right) const {
|
|
|
|
return left < right;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Foo {
|
2023-08-24 16:58:59 +01:00
|
|
|
std::multimap<int, double> m1;
|
2023-01-20 16:30:02 +00:00
|
|
|
std::multimap<int, int, CustomComparator> m2;
|
|
|
|
};
|
|
|
|
'''
|
|
|
|
includes = ["map"]
|
|
|
|
|
|
|
|
[cases]
|
|
|
|
[cases.a]
|
|
|
|
param_types = ["const Foo&"]
|
|
|
|
setup = '''
|
|
|
|
Foo foo;
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
foo.m1.insert(std::pair<int, int>(i,i));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
foo.m2.insert(std::pair<int, int>(i,i));
|
|
|
|
}
|
|
|
|
|
|
|
|
return {foo};
|
|
|
|
'''
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":96,
|
2023-08-24 16:58:59 +01:00
|
|
|
"dynamicSize":76,
|
2023-01-20 16:30:02 +00:00
|
|
|
"members":[
|
2023-08-24 16:58:59 +01:00
|
|
|
{"name":"m1", "staticSize":48, "dynamicSize":36, "length":3, "capacity":3, "elementStaticSize":12},
|
2023-01-20 16:30:02 +00:00
|
|
|
{"name":"m2", "staticSize":48, "dynamicSize":40, "length":5, "capacity":5, "elementStaticSize":8}
|
|
|
|
]}]'''
|
2023-08-24 16:58:59 +01:00
|
|
|
expect_json_v2 = '''[{
|
|
|
|
"staticSize":96,
|
|
|
|
"exclusiveSize":0,
|
2024-01-03 17:30:31 +00:00
|
|
|
"size":440,
|
2023-08-24 16:58:59 +01:00
|
|
|
"members":[
|
|
|
|
{"name":"m1",
|
|
|
|
"staticSize":48,
|
|
|
|
"exclusiveSize":48,
|
2024-01-03 17:30:31 +00:00
|
|
|
"size":192,
|
2023-08-24 16:58:59 +01:00
|
|
|
"length":3,
|
|
|
|
"capacity":3,
|
|
|
|
"members": [
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"[]", "staticSize":48, "exclusiveSize":36, "size":48},
|
2023-08-24 16:58:59 +01:00
|
|
|
{},
|
|
|
|
{}
|
|
|
|
]},
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"m2", "staticSize":48, "exclusiveSize":48, "size":248, "length":5, "capacity":5}
|
2023-08-24 16:58:59 +01:00
|
|
|
]}]'''
|