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

49 lines
1.1 KiB
TOML

definitions = '''
struct SimpleStruct {
int a;
char b;
long long c;
};
class SimpleClass {
int a;
char b;
long long c;
};
union SimpleUnion {
int a;
char b;
long long c;
};
'''
[cases]
[cases.struct]
param_types = ["const SimpleStruct&"]
setup = "return {};"
expect_json = '''[{
"staticSize":16,
"dynamicSize":0,
"members":[
{"name":"a", "staticSize":4, "dynamicSize":0},
{"name":"b", "staticSize":1, "dynamicSize":0},
{"name":"c", "staticSize":8, "dynamicSize":0}
]}]'''
[cases.class]
param_types = ["const SimpleClass&"]
setup = "return {};"
expect_json = '''[{
"staticSize":16,
"dynamicSize":0,
"members":[
{"name":"a", "staticSize":4, "dynamicSize":0},
{"name":"b", "staticSize":1, "dynamicSize":0},
{"name":"c", "staticSize":8, "dynamicSize":0}
]}]'''
[cases.union]
param_types = ["const SimpleUnion&"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"dynamicSize":0
}]'''