mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-13 22:06:55 +00:00
Integration tests: Add simple class and simple union tests
This commit is contained in:
parent
de071e2e38
commit
18e636d68d
@ -18,7 +18,7 @@ set(INTEGRATION_TEST_CONFIGS
|
|||||||
pointers_incomplete.toml
|
pointers_incomplete.toml
|
||||||
primitives.toml
|
primitives.toml
|
||||||
references.toml
|
references.toml
|
||||||
simple_struct.toml
|
simple.toml
|
||||||
sorted_vector_set.toml
|
sorted_vector_set.toml
|
||||||
std_array.toml
|
std_array.toml
|
||||||
std_conditional.toml
|
std_conditional.toml
|
||||||
|
49
test/integration/simple.toml
Normal file
49
test/integration/simple.toml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
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,
|
||||||
|
"NOT":"members"
|
||||||
|
}]'''
|
@ -1,20 +0,0 @@
|
|||||||
definitions = '''
|
|
||||||
struct Foo {
|
|
||||||
int a;
|
|
||||||
int b;
|
|
||||||
int c;
|
|
||||||
};
|
|
||||||
'''
|
|
||||||
|
|
||||||
[cases]
|
|
||||||
[cases.a]
|
|
||||||
param_types = ["const Foo&"]
|
|
||||||
setup = "return {};"
|
|
||||||
expect_json = '''[{
|
|
||||||
"staticSize":12,
|
|
||||||
"dynamicSize":0,
|
|
||||||
"members":[
|
|
||||||
{"name":"a", "staticSize":4, "dynamicSize":0},
|
|
||||||
{"name":"b", "staticSize":4, "dynamicSize":0},
|
|
||||||
{"name":"c", "staticSize":4, "dynamicSize":0}
|
|
||||||
]}]'''
|
|
Loading…
Reference in New Issue
Block a user