tests: check renaming enum affects variant prefix
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
5a79d762a5
commit
ccea33ecb4
@@ -129,27 +129,27 @@ typedef struct H {
|
||||
};
|
||||
} H;
|
||||
|
||||
enum I_Tag {
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
enum ExI_Tag {
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
|
||||
typedef struct I_Bar_Body {
|
||||
typedef struct ExI_Bar_Body {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
} I_Bar_Body;
|
||||
} ExI_Bar_Body;
|
||||
|
||||
typedef struct I {
|
||||
I_Tag tag;
|
||||
typedef struct ExI {
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
};
|
||||
} I;
|
||||
} ExI;
|
||||
|
||||
enum P_Tag {
|
||||
P0,
|
||||
@@ -182,7 +182,7 @@ void root(struct Opaque *opaque,
|
||||
F f,
|
||||
union G g,
|
||||
struct H h,
|
||||
struct I i,
|
||||
struct ExI i,
|
||||
struct J j,
|
||||
struct K k,
|
||||
enum L l,
|
||||
|
||||
@@ -183,33 +183,33 @@ typedef struct H {
|
||||
};
|
||||
} H;
|
||||
|
||||
enum I_Tag
|
||||
enum ExI_Tag
|
||||
#ifdef __cplusplus
|
||||
: uint8_t
|
||||
#endif // __cplusplus
|
||||
{
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
#ifndef __cplusplus
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct I_Bar_Body {
|
||||
typedef struct ExI_Bar_Body {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
} I_Bar_Body;
|
||||
} ExI_Bar_Body;
|
||||
|
||||
typedef struct I {
|
||||
I_Tag tag;
|
||||
typedef struct ExI {
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
};
|
||||
} I;
|
||||
} ExI;
|
||||
|
||||
enum P_Tag
|
||||
#ifdef __cplusplus
|
||||
@@ -252,7 +252,7 @@ void root(struct Opaque *opaque,
|
||||
F f,
|
||||
union G g,
|
||||
struct H h,
|
||||
struct I i,
|
||||
struct ExI i,
|
||||
struct J j,
|
||||
struct K k,
|
||||
enum L l,
|
||||
|
||||
+10
-10
@@ -129,27 +129,27 @@ typedef struct {
|
||||
};
|
||||
} H;
|
||||
|
||||
enum I_Tag {
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
enum ExI_Tag {
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
|
||||
typedef struct {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
} I_Bar_Body;
|
||||
} ExI_Bar_Body;
|
||||
|
||||
typedef struct {
|
||||
I_Tag tag;
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
};
|
||||
} I;
|
||||
} ExI;
|
||||
|
||||
enum P_Tag {
|
||||
P0,
|
||||
@@ -182,7 +182,7 @@ void root(Opaque *opaque,
|
||||
F f,
|
||||
G g,
|
||||
H h,
|
||||
I i,
|
||||
ExI i,
|
||||
J j,
|
||||
K k,
|
||||
L l,
|
||||
|
||||
@@ -183,33 +183,33 @@ typedef struct {
|
||||
};
|
||||
} H;
|
||||
|
||||
enum I_Tag
|
||||
enum ExI_Tag
|
||||
#ifdef __cplusplus
|
||||
: uint8_t
|
||||
#endif // __cplusplus
|
||||
{
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
#ifndef __cplusplus
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
} I_Bar_Body;
|
||||
} ExI_Bar_Body;
|
||||
|
||||
typedef struct {
|
||||
I_Tag tag;
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
};
|
||||
} I;
|
||||
} ExI;
|
||||
|
||||
enum P_Tag
|
||||
#ifdef __cplusplus
|
||||
@@ -252,7 +252,7 @@ void root(Opaque *opaque,
|
||||
F f,
|
||||
G g,
|
||||
H h,
|
||||
I i,
|
||||
ExI i,
|
||||
J j,
|
||||
K k,
|
||||
L l,
|
||||
|
||||
@@ -127,26 +127,26 @@ struct H {
|
||||
};
|
||||
};
|
||||
|
||||
struct I {
|
||||
struct ExI {
|
||||
enum class Tag : uint8_t {
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
|
||||
struct I_Foo_Body {
|
||||
struct ExI_Foo_Body {
|
||||
int16_t _0;
|
||||
};
|
||||
|
||||
struct I_Bar_Body {
|
||||
struct ExI_Bar_Body {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
};
|
||||
|
||||
Tag tag;
|
||||
union {
|
||||
I_Foo_Body foo;
|
||||
I_Bar_Body bar;
|
||||
ExI_Foo_Body foo;
|
||||
ExI_Bar_Body bar;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -184,7 +184,7 @@ void root(Opaque *opaque,
|
||||
F f,
|
||||
G g,
|
||||
H h,
|
||||
I i,
|
||||
ExI i,
|
||||
J j,
|
||||
K k,
|
||||
L l,
|
||||
|
||||
@@ -114,19 +114,19 @@ cdef extern from *:
|
||||
H_Bar_Body bar;
|
||||
|
||||
cdef enum:
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ctypedef uint8_t I_Tag;
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
ctypedef uint8_t ExI_Tag;
|
||||
|
||||
ctypedef struct I_Bar_Body:
|
||||
ctypedef struct ExI_Bar_Body:
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
|
||||
ctypedef struct I:
|
||||
I_Tag tag;
|
||||
ctypedef struct ExI:
|
||||
ExI_Tag tag;
|
||||
int16_t foo;
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
|
||||
cdef enum:
|
||||
P0,
|
||||
@@ -152,7 +152,7 @@ cdef extern from *:
|
||||
F f,
|
||||
G g,
|
||||
H h,
|
||||
I i,
|
||||
ExI i,
|
||||
J j,
|
||||
K k,
|
||||
L l,
|
||||
|
||||
@@ -129,25 +129,25 @@ struct H {
|
||||
};
|
||||
};
|
||||
|
||||
enum I_Tag {
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
enum ExI_Tag {
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
|
||||
struct I_Bar_Body {
|
||||
struct ExI_Bar_Body {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
};
|
||||
|
||||
struct I {
|
||||
I_Tag tag;
|
||||
struct ExI {
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
struct I_Bar_Body bar;
|
||||
struct ExI_Bar_Body bar;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ void root(struct Opaque *opaque,
|
||||
F f,
|
||||
union G g,
|
||||
struct H h,
|
||||
struct I i,
|
||||
struct ExI i,
|
||||
struct J j,
|
||||
struct K k,
|
||||
enum L l,
|
||||
|
||||
@@ -183,31 +183,31 @@ struct H {
|
||||
};
|
||||
};
|
||||
|
||||
enum I_Tag
|
||||
enum ExI_Tag
|
||||
#ifdef __cplusplus
|
||||
: uint8_t
|
||||
#endif // __cplusplus
|
||||
{
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
};
|
||||
#ifndef __cplusplus
|
||||
typedef uint8_t I_Tag;
|
||||
typedef uint8_t ExI_Tag;
|
||||
#endif // __cplusplus
|
||||
|
||||
struct I_Bar_Body {
|
||||
struct ExI_Bar_Body {
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
};
|
||||
|
||||
struct I {
|
||||
I_Tag tag;
|
||||
struct ExI {
|
||||
ExI_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
int16_t foo;
|
||||
};
|
||||
struct I_Bar_Body bar;
|
||||
struct ExI_Bar_Body bar;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -252,7 +252,7 @@ void root(struct Opaque *opaque,
|
||||
F f,
|
||||
union G g,
|
||||
struct H h,
|
||||
struct I i,
|
||||
struct ExI i,
|
||||
struct J j,
|
||||
struct K k,
|
||||
enum L l,
|
||||
|
||||
@@ -114,19 +114,19 @@ cdef extern from *:
|
||||
H_Bar_Body bar;
|
||||
|
||||
cdef enum:
|
||||
I_Foo,
|
||||
I_Bar,
|
||||
I_Baz,
|
||||
ctypedef uint8_t I_Tag;
|
||||
ExI_Foo,
|
||||
ExI_Bar,
|
||||
ExI_Baz,
|
||||
ctypedef uint8_t ExI_Tag;
|
||||
|
||||
cdef struct I_Bar_Body:
|
||||
cdef struct ExI_Bar_Body:
|
||||
uint8_t x;
|
||||
int16_t y;
|
||||
|
||||
cdef struct I:
|
||||
I_Tag tag;
|
||||
cdef struct ExI:
|
||||
ExI_Tag tag;
|
||||
int16_t foo;
|
||||
I_Bar_Body bar;
|
||||
ExI_Bar_Body bar;
|
||||
|
||||
cdef enum:
|
||||
P0,
|
||||
@@ -152,7 +152,7 @@ cdef extern from *:
|
||||
F f,
|
||||
G g,
|
||||
H h,
|
||||
I i,
|
||||
ExI i,
|
||||
J j,
|
||||
K k,
|
||||
L l,
|
||||
|
||||
@@ -14,3 +14,6 @@ static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P");
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
|
||||
[export.rename]
|
||||
"I" = "ExI"
|
||||
|
||||
Reference in New Issue
Block a user