mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-14 14:26:55 +00:00
33 lines
910 B
TOML
33 lines
910 B
TOML
|
includes = ["vector"]
|
||
|
definitions = '''
|
||
|
namespace MyNS {
|
||
|
enum class ScopedEnum {
|
||
|
Zero = 0,
|
||
|
One = 1,
|
||
|
Two = 2,
|
||
|
};
|
||
|
|
||
|
enum UNSCOPED_ENUM {
|
||
|
ZERO = 0,
|
||
|
ONE = 1,
|
||
|
TWO = 2,
|
||
|
};
|
||
|
} // MyNS
|
||
|
'''
|
||
|
|
||
|
[cases]
|
||
|
[cases.scoped_enum_type]
|
||
|
param_types = ["const std::vector<MyNS::ScopedEnum>&"]
|
||
|
setup = "return {};"
|
||
|
[cases.scoped_enum_val]
|
||
|
param_types = ["const std::array<int, static_cast<size_t>(MyNS::ScopedEnum::Two)>&"]
|
||
|
setup = "return {};"
|
||
|
expect_json = '[{"staticSize":8, "dynamicSize":0, "length":2, "capacity":2, "elementStaticSize":4}]'
|
||
|
[cases.unscoped_enum_type]
|
||
|
param_types = ["const std::vector<MyNS::UNSCOPED_ENUM>&"]
|
||
|
setup = "return {};"
|
||
|
[cases.unscoped_enum_val]
|
||
|
param_types = ["const std::array<int, MyNS::ONE>&"]
|
||
|
setup = "return {};"
|
||
|
expect_json = '[{"staticSize":4, "dynamicSize":0, "length":1, "capacity":1, "elementStaticSize":4}]'
|