object-introspection/test/integration/inheritance_access.toml
Jake Hillion 5071519e45 oil v2
2023-08-23 15:59:53 +01:00

55 lines
1.4 KiB
TOML

definitions = '''
class Base {
int32_t base_int;
};
class Public : public Base {
int32_t public_int;
};
class Protected : protected Base {
int32_t protected_int;
};
class Private : private Base {
int32_t private_int;
};
'''
[cases]
[cases.public]
param_types = ["const Public&"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"members":[
{"name":"base_int", "staticSize":4, "typeName": "int32_t"},
{"name":"public_int", "staticSize":4, "typeName": "int32_t"}
]}]'''
[cases.protected]
param_types = ["const Protected&"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"members":[
{"name":"base_int", "staticSize":4, "typeName": "int32_t"},
{"name":"protected_int", "staticSize":4, "typeName": "int32_t"}
]}]'''
[cases.private]
param_types = ["const Private&"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"members":[
{"name":"base_int", "staticSize":4, "typeName": "int32_t"},
{"name":"private_int", "staticSize":4, "typeName": "int32_t"}
]}]'''
[cases.public_as_base]
param_types = ["const Base&"]
arg_types = ["Public"]
setup = "return {};"
expect_json = '''[{
"staticSize":4,
"members":[
{"name":"base_int", "staticSize":4, "typeName": "int32_t"}
]}]'''