Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions test/integration/std_vector.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
includes = ["vector"]
definitions = """
/* The Foo struct has a size of 5 bytes, but requires
* 3 bytes of padding to keep the `int x;` aligned.
*/
struct Foo {
int x;
char y;
};
"""
[cases]
[cases.int_empty]
param_types = ["const std::vector<int>&"]
Expand Down Expand Up @@ -62,3 +71,29 @@ includes = ["vector"]
{"staticSize":4, "exclusiveSize":4},
{"staticSize":4, "exclusiveSize":4}
]}]'''
[cases.item_align]
oil_skip = true # https://github.com/facebookexperimental/object-introspection/issues/301
param_types = ["const std::vector<Foo>&"]
setup = """
return std::vector<Foo>{
{.x = 1,.y = 2},
{.x = 3,.y = 4},
{.x = 5,.y = 6},
};
"""
expect_json = """
[{
"staticSize":24,
"exclusiveSize":24,
"length":3,
"capacity":3,
"members":[
{"staticSize":8, "exclusiveSize":3, "members":[
{"name":"x", "staticSize":4, "exclusiveSize":4},
{"name":"y", "staticSize":1, "exclusiveSize":1}
]},
{"staticSize":8, "exclusiveSize":3},
{"staticSize":8, "exclusiveSize":3}
]
}]
"""