Adding tests for structs and parameters using typedefs
This commit is contained in:
parent
99067de178
commit
eb7e551c4b
|
@ -0,0 +1,11 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
void fun()
|
||||
{
|
||||
MYSTRUCT mystruct_var = {.x = 3, .y = 2.1f};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: mystruct_var\nMode\.+: C\nType\.+: MYSTRUCT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
void fun(MYSTRUCT mystruct_param)
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: mystruct_param\nMode\.+: C\nType\.+: MYSTRUCT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
typedef struct tag_struct_name
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
void fun(struct tag_struct_name tag_struct_param, MYSTRUCT mystruct_param)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: tag_struct_param\nMode\.+: C\nType\.+: struct tag_struct_name
|
||||
Base name\.+: mystruct_param\nMode\.+: C\nType\.+: MYSTRUCT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
typedef int MYINT;
|
||||
|
||||
void fun(int int_param, MYINT myint_param)
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: int_param\nMode\.+: C\nType\.+: signed int
|
||||
Base name\.+: myint_param\nMode\.+: C\nType\.+: MYINT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
typedef int MYINT;
|
||||
typedef int ALTINT;
|
||||
|
||||
void fun(int int_param, MYINT myint_param, ALTINT altint_param)
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: int_param\nMode\.+: C\nType\.+: signed int
|
||||
Base name\.+: myint_param\nMode\.+: C\nType\.+: MYINT
|
||||
Base name\.+: altint_param\nMode\.+: C\nType\.+: ALTINT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
typedef int MYINT;
|
||||
typedef MYINT CHAINEDINT;
|
||||
|
||||
void fun(int int_param, MYINT myint_param, CHAINEDINT chainedint_param)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: int_param\nMode\.+: C\nType\.+: signed int
|
||||
Base name\.+: myint_param\nMode\.+: C\nType\.+: MYINT
|
||||
Base name\.+: chainedint_param\nMode\.+: C\nType\.+: CHAINEDINT
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
MYSTRUCT fun()
|
||||
{
|
||||
MYSTRUCT return_variable = {.x = 1, .y = 3.14f};
|
||||
return return_variable;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: return\nMode\.+: C\nType\.+: MYSTRUCT
|
||||
Base name\.+: fun\nMode\.+: C\nType\.+: MYSTRUCT \(\)
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
typedef struct tag_struct_name
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
struct tag_struct_name fun()
|
||||
{
|
||||
struct tag_struct_name return_variable = { .x = 1, .y = 3.14f};
|
||||
return return_variable;
|
||||
}
|
||||
|
||||
MYSTRUCT fun2()
|
||||
{
|
||||
MYSTRUCT return_variable = { .x = 1, .y = 3.14f};
|
||||
return return_variable;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: fun\nMode\.+: C\nType\.+: struct tag_struct_name \(\)
|
||||
Base name\.+: fun2\nMode\.+: C\nType\.+: MYSTRUCT \(\)
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
typedef int MYINT;
|
||||
|
||||
int fun()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
MYINT fun2()
|
||||
{
|
||||
return 5;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: fun\nMode\.+: C\nType\.+: signed int \(\)
|
||||
Base name\.+: fun2\nMode\.+: C\nType\.+: MYINT \(\)
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
typedef int MYINT;
|
||||
typedef int ALTINT;
|
||||
|
||||
MYINT fun()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ALTINT fun2()
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: fun\nMode\.+: C\nType\.+: MYINT \(\)
|
||||
Base name\.+: fun2\nMode\.+: C\nType\.+: ALTINT \(\)
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
typedef int MYINT;
|
||||
typedef MYINT CHAINEDINT;
|
||||
|
||||
MYINT fun()
|
||||
{
|
||||
}
|
||||
|
||||
CHAINEDINT fun2()
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
Base name\.+: fun\nMode\.+: C\nType\.+: MYINT \(\)
|
||||
Base name\.+: fun2\nMode\.+: C\nType\.+: CHAINEDINT \(\)
|
||||
--
|
||||
warning: ignoring
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
typedef struct tag_struct_name
|
||||
{
|
||||
int x;
|
||||
float y;
|
||||
} MYSTRUCT;
|
||||
|
||||
void fun()
|
||||
{
|
||||
struct tag_struct_name tag_struct_var = {.x = 1, .y = 3.14f};
|
||||
MYSTRUCT mystruct_var = {.x = 3, .y = 2.1f};
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
CORE
|
||||
main.c
|
||||
"--show-symbol-table"
|
||||
// Enable multi-line checking
|
||||
activate-multi-line-match
|
||||
EXIT=0
|
||||
SIGNAL=0
|
||||
Base name\.+: tag_struct_var\nMode\.+: C\nType\.+: struct tag_struct_name
|
||||
Base name\.+: mystruct_var\nMode\.+: C\nType\.+: MYSTRUCT
|
||||
--
|
||||
warning: ignoring
|
Loading…
Reference in New Issue