definitions = ''' struct CustomComparator { bool operator()(const int& left, const int& right) const { return left < right; } }; // static size of map only increases in multiples of 8. So including // a single double would keep the static size of map the same struct SmallSizedCustomComparator { double a; bool operator()(const int& left, const int& right) const { return left < right; } }; struct BigSizedCustomComparator { double d[1000]; bool operator()(const int& left, const int& right) const { return left < right; } }; struct Foo { std::map m1; std::map m2; std::map m3; std::map m4; }; struct Foo4 { std::map> m; }; ''' includes = ["map", "functional"] [cases] [cases.a] param_types = ["const Foo&"] setup = ''' Foo foo; for (int i = 0; i < 3; i++) { foo.m1[i] = (i * 10); } for (int i = 0; i < 5; i++) { foo.m2[i] = (i * 10); } for (int i = 0; i < 7; i++) { foo.m3[i] = (i * 10); } for (int i = 0; i < 9; i++) { foo.m4[i] = (i * 10); } return {foo}; ''' expect_json = '''[{ "staticSize":8184, "dynamicSize":780, "members":[ {"name":"m1", "staticSize":48, "dynamicSize":108, "length":3, "capacity":3, "elementStaticSize":36}, {"name":"m2", "staticSize":48, "dynamicSize":160, "length":5, "capacity":5, "elementStaticSize":32}, {"name":"m3", "staticSize":48, "dynamicSize":224, "length":7, "capacity":7, "elementStaticSize":32}, {"name":"m4", "staticSize":8040, "dynamicSize":288, "length":9, "capacity":9, "elementStaticSize":32} ]}]''' expect_json_v2 = '''[{ "staticSize":8184, "exclusiveSize":0, "size":9168, "members":[ {"name":"m1", "staticSize":48, "exclusiveSize":48, "size":192, "length":3, "capacity":3, "members": [ {"name":"[]", "staticSize":48, "exclusiveSize":36}, {}, {} ]}, {"name":"m2", "staticSize":48, "exclusiveSize":48, "size":248, "length":5, "capacity":5}, {"name":"m3", "staticSize":48, "exclusiveSize":48, "size":328, "length":7, "capacity":7}, {"name":"m4", "staticSize":8040, "exclusiveSize":8040, "size":8400, "length":9, "capacity":9} ]}]'''