Integration Tests: Test typedefs

This commit is contained in:
Alastair Robertson 2023-02-14 06:19:47 -08:00 committed by Alastair Robertson
parent 340a5e6803
commit 9dd5c4b4cc
2 changed files with 44 additions and 0 deletions

View File

@ -43,6 +43,7 @@ set(INTEGRATION_TEST_CONFIGS
std_variant.toml std_variant.toml
std_vector.toml std_vector.toml
std_vector_del_allocator.toml std_vector_del_allocator.toml
typedefs.toml
typedefed_parent.toml typedefed_parent.toml
) )

View File

@ -0,0 +1,43 @@
includes = ["vector"]
definitions = '''
typedef uint64_t UInt64;
using IntVector = std::vector<int>;
'''
[cases]
[cases.c_style]
param_types = ["UInt64"]
setup = "return {};"
expect_json = '''[{
"staticSize":8,
"dynamicSize":0,
"isTypedef":true,
"typeName":"UInt64",
"members":[
{
"staticSize":8,
"dynamicSize":0,
"isTypedef":false,
"typeName":"uint64_t",
"NOT":"members"
}
]}]'''
[cases.using]
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":"vector<int, std::allocator<int> >",
"NOT":"members"
}
]}]'''