includes = ["vector"] definitions = ''' template class TemplatedClass1 { T val; }; template class TemplatedClass2 { TemplatedClass1 tc1; S val2; }; struct Foo { int a; int b; }; template struct TemplatedClassVal { int arr[N]; }; ''' [cases] [cases.int] oil_skip = "primitives are named differently in treebuilderv2" # https://github.com/facebookexperimental/object-introspection/issues/286 param_types = ["const TemplatedClass1&"] setup = "return {};" expect_json = '''[{ "typeName":"TemplatedClass1", "staticSize":4, "dynamicSize":0, "members":[{ "typeName":"int" }]}]''' [cases.vector] param_types = ["const TemplatedClass1>&"] setup = "return {};" expect_json = '''[{ "typeName":"TemplatedClass1 > >", "staticSize":24, "dynamicSize":0, "members":[{ "typeName":"vector >", "staticSize":24, "dynamicSize":0, "length":0, "capacity":0, "elementStaticSize":4 }]}]''' expect_json_v2 = '''[{ "typeName":"TemplatedClass1 > >", "staticSize":24, "exclusiveSize":0, "members":[{ "typeName":"std::vector>", "staticSize":24, "exclusiveSize":24, "length":0, "capacity":0 }]}]''' [cases.two] oil_skip = "OIL returns better primitive names" param_types = ["const TemplatedClass2&"] setup = "return {};" expect_json = '''[{ "typeName":"TemplatedClass2", "staticSize":12, "dynamicSize":0, "members":[ {"typeName":"TemplatedClass1", "staticSize":8, "dynamicSize":0}, {"typeName":"int", "staticSize":4, "dynamicSize":0} ]}]''' [cases.value] param_types = ["const TemplatedClassVal<3>&"] setup = "return {};" expect_json = '''[{ "typeName":"TemplatedClassVal<3>", "staticSize":12, "dynamicSize":0, "members":[{ "staticSize":12, "dynamicSize":0, "length":3, "capacity":3, "elementStaticSize":4 }]}]''' expect_json_v2 = '''[{ "typeName":"TemplatedClassVal<3>", "staticSize":12, "exclusiveSize":0, "members":[{ "staticSize":12, "exclusiveSize":0, "length":3, "capacity":3 }]}]'''