object-introspection/test/integration/std_array.toml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

94 lines
2.1 KiB
TOML
Raw Normal View History

2022-12-19 14:37:51 +00:00
includes = ["array", "cstdint", "vector"]
[cases]
[cases.uint64_length_0]
2022-12-19 14:37:51 +00:00
param_types = ["std::array<std::uint64_t, 0>&"]
setup = "return {{}};"
expect_json = '''
[
{
"staticSize": 1,
"dynamicSize": 0,
2023-03-03 20:09:51 +00:00
"exclusiveSize": 1,
2022-12-19 14:37:51 +00:00
"length": 0,
"capacity": 0,
"elementStaticSize": 8
}
]
'''
[cases.uint64_length_1]
2022-12-19 14:37:51 +00:00
param_types = ["std::array<std::uint64_t, 1>&"]
setup = "return {{1}};"
expect_json = '''
[
{
"staticSize": 8,
"dynamicSize": 0,
2023-03-03 20:09:51 +00:00
"exclusiveSize": 8,
2022-12-19 14:37:51 +00:00
"length": 1,
"capacity": 1,
"elementStaticSize": 8
}
]
'''
[cases.uint64_length_8]
2022-12-19 14:37:51 +00:00
param_types = ["std::array<std::uint64_t, 8>&"]
setup = "return {{0,1,2,3,4,5,6,7}};"
expect_json = '''
[
{
"staticSize": 64,
"dynamicSize": 0,
"length": 8,
"capacity": 8,
"elementStaticSize": 8
}
]
'''
[cases.vector_length_1]
2022-12-19 14:37:51 +00:00
param_types = ["std::array<std::vector<std::uint64_t>, 1>&"]
setup = "return {{std::initializer_list<std::uint64_t>({1,2,3,4,5})}};"
expect_json = '''
[
{
"staticSize": 24,
"dynamicSize": 40,
"length": 1,
"capacity": 1,
"elementStaticSize": 24,
"members": [
{
"staticSize": 24,
"dynamicSize": 40
}
]
}
]
'''
[cases.vector_length_2]
2022-12-19 14:37:51 +00:00
param_types = ["std::array<std::vector<std::uint64_t>, 2>&"]
setup = "return {{std::initializer_list<std::uint64_t>({1,2,3,4,5}), std::initializer_list<std::uint64_t>({6,7,8,9})}};"
expect_json = '''
[
{
"staticSize": 48,
"dynamicSize": 72,
2023-03-03 20:09:51 +00:00
"exclusiveSize": 0,
2022-12-19 14:37:51 +00:00
"length": 2,
"capacity": 2,
"elementStaticSize": 24,
"members": [
{
"staticSize": 24,
2023-03-03 20:09:51 +00:00
"dynamicSize": 40,
"exclusiveSize": 64
2022-12-19 14:37:51 +00:00
},
{
"staticSize": 24,
2023-03-03 20:09:51 +00:00
"dynamicSize": 32,
"exclusiveSize": 56
2022-12-19 14:37:51 +00:00
}
]
}
]
'''