definitions = ''' struct SimpleStruct { int a; char b; long long c; }; class SimpleClass { int a; char b; long long c; }; union SimpleUnion { int a; char b; long long c; }; ''' [cases] [cases.struct] param_types = ["const SimpleStruct&"] setup = "return {};" expect_json = '''[{ "staticSize":16, "dynamicSize":0, "exclusiveSize": 3, "members":[ {"name":"a", "staticSize":4, "dynamicSize":0, "exclusiveSize": 4, "size": 4}, {"name":"b", "staticSize":1, "dynamicSize":0, "exclusiveSize": 1, "size": 1}, {"name":"c", "staticSize":8, "dynamicSize":0, "exclusiveSize": 8, "size": 8} ]}]''' expect_json_v2 = '''[{ "staticSize":16, "exclusiveSize": 3, "size": 16, "is_primitive": false, "members":[ {"name":"a", "staticSize":4, "exclusiveSize": 4, "size": 4, "is_primitive": true}, {"name":"b", "staticSize":1, "exclusiveSize": 1, "size": 1, "is_primitive": true}, {"name":"c", "staticSize":8, "exclusiveSize": 8, "size": 8, "is_primitive": true} ]}]''' [cases.class] param_types = ["const SimpleClass&"] setup = "return {};" expect_json = '''[{ "staticSize":16, "dynamicSize":0, "exclusiveSize": 3, "members":[ {"name":"a", "staticSize":4, "dynamicSize":0, "exclusiveSize": 4, "size": 4}, {"name":"b", "staticSize":1, "dynamicSize":0, "exclusiveSize": 1, "size": 1}, {"name":"c", "staticSize":8, "dynamicSize":0, "exclusiveSize": 8, "size": 8} ]}]''' expect_json_v2 = '''[{ "staticSize":16, "exclusiveSize": 3, "size": 16, "is_primitive": false, "members":[ {"name":"a", "staticSize":4, "exclusiveSize": 4, "size": 4, "is_primitive": true}, {"name":"b", "staticSize":1, "exclusiveSize": 1, "size": 1, "is_primitive": true}, {"name":"c", "staticSize":8, "exclusiveSize": 8, "size": 8, "is_primitive": true} ]}]''' [cases.union] param_types = ["const SimpleUnion&"] setup = "return {};" expect_json = '''[{ "staticSize":8, "dynamicSize":0, "exclusiveSize":8 }]''' expect_json_v2 = '''[{ "staticSize":8, "exclusiveSize":8, "size":8, "is_primitive":false }]'''