object-introspection/test/integration/typedefs.toml
Alastair Robertson 2060a0491e CodeGen v2: Enable independent running without CodeGen v1
Create DrgnExporter to translate Type Graph "Type" nodes into drgn_type
structs, suitable for use in OICache and TreeBuilder.
2023-12-15 14:57:24 +00:00

98 lines
2.3 KiB
TOML

includes = ["vector"]
definitions = '''
typedef uint64_t TdUInt64;
using UsingUInt64 = uint64_t;
using IntVector = std::vector<int>;
using Anonymous = struct { int n; };
template <typename T>
struct Proxy {
T t;
};
'''
[cases]
[cases.c_style]
oil_disable = "oil can't pick up top level typedefs"
param_types = ["TdUInt64"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"dynamicSize":0,
"isTypedef":true,
"typeName":"TdUInt64",
"members":[
{
"staticSize":8,
"dynamicSize":0,
"isTypedef":false,
"typeName":"uint64_t",
"NOT":"members"
}
]}]'''
[cases.using]
oil_disable = "oil can't pick up top level typedefs"
param_types = ["UsingUInt64"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"dynamicSize":0,
"isTypedef":true,
"typeName":"UsingUInt64",
"members":[
{
"staticSize":8,
"dynamicSize":0,
"isTypedef":false,
"typeName":"uint64_t",
"NOT":"members"
}
]}]'''
[cases.container]
oil_disable = "oil can't pick up top level typedefs"
param_types = ["const IntVector&"]
setup = "return {};"
expect_json = '''[{
"staticSize":24,
"dynamicSize":0,
"isTypedef":true,
"typeName":"IntVector",
"members":[
{
"staticSize":24,
"dynamicSize":0,
"length":0,
"capacity":0,
"elementStaticSize":4,
"isTypedef":false,
"typeName":"std::vector<int32_t, std::allocator<int32_t>>",
"NOT":"members"
}
]}]'''
[cases.anonymous]
oil_disable = "oil can't pick up top level typedefs"
param_types = ["const Anonymous&"]
setup = "return {};"
expect_json = '''[{
"staticSize":4,
"dynamicSize":0,
"exclusiveSize":0,
"isTypedef":true,
"typeName":"Anonymous",
"members":[
{
"staticSize":4,
"dynamicSize":0,
"exclusiveSize":0,
"isTypedef":false,
"members":[
{
"staticSize":4,
"dynamicSize":0,
"exclusiveSize":4,
"isTypedef":false,
"name": "n"
}
]}
]}]'''