2023-09-07 15:07:57 +01:00
|
|
|
includes = ["folly/container/F14Map.h"]
|
|
|
|
definitions = '''
|
|
|
|
struct Bar {
|
|
|
|
float a, b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Foo {
|
|
|
|
folly::F14FastMap<int, int> m1;
|
|
|
|
folly::F14FastMap<int, Bar> m2;
|
|
|
|
folly::F14FastMap<int, int> m3;
|
2023-10-06 17:40:08 +01:00
|
|
|
folly::F14FastMap<int, long> m4;
|
2023-09-07 15:07:57 +01:00
|
|
|
};
|
|
|
|
'''
|
|
|
|
|
|
|
|
[cases]
|
|
|
|
[cases.a]
|
|
|
|
param_types = ["const Foo&"]
|
|
|
|
setup = '''
|
|
|
|
Foo foo;
|
|
|
|
|
|
|
|
foo.m1.reserve(3);
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
foo.m1.emplace(i, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
foo.m2.reserve(5);
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
foo.m2.emplace(i, Bar{0.0f, 0.0f});
|
|
|
|
}
|
|
|
|
|
|
|
|
foo.m3.reserve(7);
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
|
foo.m3.emplace(i, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
foo.m4.reserve(9);
|
|
|
|
for (int i = 0; i < 9; i++) {
|
|
|
|
foo.m4.emplace(i, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
return {foo};
|
|
|
|
'''
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":96,
|
2023-10-06 17:40:08 +01:00
|
|
|
"dynamicSize":368,
|
2023-09-07 15:07:57 +01:00
|
|
|
"members":[
|
|
|
|
{"name":"m1", "staticSize":24, "dynamicSize":48, "length":3, "capacity":3, "elementStaticSize":8},
|
|
|
|
{
|
|
|
|
"name":"m2",
|
|
|
|
"staticSize":24,
|
|
|
|
"dynamicSize":80,
|
|
|
|
"length":5,
|
|
|
|
"capacity":5,
|
|
|
|
"elementStaticSize":12,
|
|
|
|
"members":[
|
|
|
|
{"staticSize": 4},
|
|
|
|
{"staticSize":8, "members":[{"name":"a"}, {"name": "b"}]},
|
|
|
|
{"staticSize": 4},
|
|
|
|
{"staticSize":8, "members":[{"name":"a"}, {"name": "b"}]},
|
|
|
|
{"staticSize": 4},
|
|
|
|
{"staticSize":8, "members":[{"name":"a"}, {"name": "b"}]},
|
|
|
|
{"staticSize": 4},
|
|
|
|
{"staticSize":8, "members":[{"name":"a"}, {"name": "b"}]},
|
|
|
|
{"staticSize": 4},
|
|
|
|
{"staticSize":8, "members":[{"name":"a"}, {"name": "b"}]}
|
|
|
|
]},
|
|
|
|
{"name":"m3", "staticSize":24, "dynamicSize":80, "length":7, "capacity":7, "elementStaticSize":8},
|
2023-10-06 17:40:08 +01:00
|
|
|
{"name":"m4", "staticSize":24, "dynamicSize":160, "length":9, "capacity":9, "elementStaticSize":12}
|
2023-09-07 15:07:57 +01:00
|
|
|
]}]'''
|
|
|
|
expect_json_v2 = '''[{
|
|
|
|
"staticSize":96,
|
|
|
|
"exclusiveSize": 0,
|
2024-01-03 17:30:31 +00:00
|
|
|
"size": 464,
|
2023-09-07 15:07:57 +01:00
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"m1", "staticSize":24, "exclusiveSize": 48, "size": 72, "length": 3, "capacity": 3},
|
|
|
|
{"name":"m2", "staticSize":24, "exclusiveSize": 44, "size": 104, "length": 5, "capacity": 5},
|
|
|
|
{"name":"m3", "staticSize":24, "exclusiveSize": 48, "size": 104,"length": 7, "capacity": 7},
|
2023-10-06 17:40:08 +01:00
|
|
|
{
|
|
|
|
"name":"m4",
|
|
|
|
"staticSize":24,
|
|
|
|
"exclusiveSize": 40,
|
2024-01-03 17:30:31 +00:00
|
|
|
"size": 184,
|
2023-10-06 17:40:08 +01:00
|
|
|
"length": 9,
|
|
|
|
"capacity": 9,
|
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16},
|
|
|
|
{"staticSize":16, "exclusiveSize": 4, "size":16}
|
2023-10-06 17:40:08 +01:00
|
|
|
]
|
|
|
|
}]
|
|
|
|
}]'''
|