mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-10 05:26:56 +00:00
55 lines
1.4 KiB
TOML
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"}
|
|
]}]'''
|