2023-01-20 14:05:36 +00:00
|
|
|
definitions = '''
|
|
|
|
class Base {
|
2023-08-16 20:40:36 +01:00
|
|
|
int32_t base_int;
|
2023-01-20 14:05:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Public : public Base {
|
2023-08-16 20:40:36 +01:00
|
|
|
int32_t public_int;
|
2023-01-20 14:05:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Protected : protected Base {
|
2023-08-16 20:40:36 +01:00
|
|
|
int32_t protected_int;
|
2023-01-20 14:05:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Private : private Base {
|
2023-08-16 20:40:36 +01:00
|
|
|
int32_t private_int;
|
2023-01-20 14:05:36 +00:00
|
|
|
};
|
|
|
|
'''
|
|
|
|
[cases]
|
|
|
|
[cases.public]
|
|
|
|
param_types = ["const Public&"]
|
|
|
|
setup = "return {};"
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":8,
|
2024-01-03 17:30:31 +00:00
|
|
|
"exclusiveSize":0,
|
|
|
|
"size":8,
|
2023-01-20 14:05:36 +00:00
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"base_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"},
|
|
|
|
{"name":"public_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"}
|
2023-01-20 14:05:36 +00:00
|
|
|
]}]'''
|
|
|
|
[cases.protected]
|
|
|
|
param_types = ["const Protected&"]
|
|
|
|
setup = "return {};"
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":8,
|
2024-01-03 17:30:31 +00:00
|
|
|
"exclusiveSize":0,
|
|
|
|
"size":8,
|
2023-01-20 14:05:36 +00:00
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"base_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"},
|
|
|
|
{"name":"protected_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"}
|
2023-01-20 14:05:36 +00:00
|
|
|
]}]'''
|
|
|
|
[cases.private]
|
|
|
|
param_types = ["const Private&"]
|
|
|
|
setup = "return {};"
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":8,
|
2024-01-03 17:30:31 +00:00
|
|
|
"exclusiveSize":0,
|
|
|
|
"size":8,
|
2023-01-20 14:05:36 +00:00
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"base_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"},
|
|
|
|
{"name":"private_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"}
|
2023-01-20 14:05:36 +00:00
|
|
|
]}]'''
|
|
|
|
[cases.public_as_base]
|
|
|
|
param_types = ["const Base&"]
|
|
|
|
arg_types = ["Public"]
|
|
|
|
setup = "return {};"
|
|
|
|
expect_json = '''[{
|
|
|
|
"staticSize":4,
|
2024-01-03 17:30:31 +00:00
|
|
|
"exclusiveSize":0,
|
|
|
|
"size":4,
|
2023-01-20 14:05:36 +00:00
|
|
|
"members":[
|
2024-01-03 17:30:31 +00:00
|
|
|
{"name":"base_int", "staticSize":4, "exclusiveSize":4, "size":4, "typeName": "int32_t"}
|
2023-01-20 14:05:36 +00:00
|
|
|
]}]'''
|