mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-10 05:26:56 +00:00
81 lines
1.7 KiB
TOML
81 lines
1.7 KiB
TOML
definitions = '''
|
|
class A {
|
|
int f;
|
|
int g;
|
|
};
|
|
|
|
class B {
|
|
int h;
|
|
};
|
|
|
|
class C {
|
|
public:
|
|
// using T = std::conditional_t<alignof(int*) >= sizeof(char), A, B>;
|
|
std::conditional_t<alignof(int*) >= sizeof(char), A, B> foo;
|
|
};
|
|
'''
|
|
[cases]
|
|
[cases.a]
|
|
param_types = ["const C&"]
|
|
setup = '''
|
|
C foo;
|
|
return {foo};
|
|
'''
|
|
expect_json = '''
|
|
[
|
|
{
|
|
"typeName": "C",
|
|
"isTypedef": false,
|
|
"staticSize": 8,
|
|
"dynamicSize": 0,
|
|
"members": [
|
|
{
|
|
"name": "foo",
|
|
"typePath": "foo",
|
|
"isTypedef": true,
|
|
"staticSize": 8,
|
|
"dynamicSize": 0,
|
|
"members": [
|
|
{
|
|
"name": "",
|
|
"typePath": "",
|
|
"typeName": "type",
|
|
"isTypedef": true,
|
|
"staticSize": 8,
|
|
"dynamicSize": 0,
|
|
"members": [
|
|
{
|
|
"name": "",
|
|
"typePath": "",
|
|
"typeName": "A",
|
|
"isTypedef": false,
|
|
"staticSize": 8,
|
|
"dynamicSize": 0,
|
|
"members": [
|
|
{
|
|
"name": "f",
|
|
"typePath": "f",
|
|
"typeName": "int",
|
|
"isTypedef": false,
|
|
"staticSize": 4,
|
|
"dynamicSize": 0
|
|
},
|
|
{
|
|
"name": "g",
|
|
"typePath": "g",
|
|
"typeName": "int",
|
|
"isTypedef": false,
|
|
"staticSize": 4,
|
|
"dynamicSize": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
'''
|