object-introspection/test/integration/std_multimap_custom_comparator.toml

56 lines
1.4 KiB
TOML
Raw Normal View History

definitions = '''
struct CustomComparator {
bool operator()(const int& left, const int& right) const {
return left < right;
}
};
struct Foo {
std::multimap<int, double> m1;
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,
"dynamicSize":76,
"members":[
{"name":"m1", "staticSize":48, "dynamicSize":36, "length":3, "capacity":3, "elementStaticSize":12},
{"name":"m2", "staticSize":48, "dynamicSize":40, "length":5, "capacity":5, "elementStaticSize":8}
]}]'''
expect_json_v2 = '''[{
"staticSize":96,
"exclusiveSize":0,
"size":440,
"members":[
{"name":"m1",
"staticSize":48,
"exclusiveSize":48,
"size":192,
"length":3,
"capacity":3,
"members": [
{"name":"[]", "staticSize":48, "exclusiveSize":36, "size":48},
{},
{}
]},
{"name":"m2", "staticSize":48, "exclusiveSize":48, "size":248, "length":5, "capacity":5}
]}]'''