Adding tests for structs and parameters using typedefs

This commit is contained in:
thk123 2016-12-15 12:29:56 +00:00
parent 99067de178
commit eb7e551c4b
24 changed files with 266 additions and 0 deletions

View File

@ -0,0 +1,11 @@
typedef struct
{
int x;
float y;
} MYSTRUCT;
void fun()
{
MYSTRUCT mystruct_var = {.x = 3, .y = 2.1f};
}

View File

@ -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

View File

@ -0,0 +1,11 @@
typedef struct
{
int x;
float y;
} MYSTRUCT;
void fun(MYSTRUCT mystruct_param)
{
}

View File

@ -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

View File

@ -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)
{
}

View File

@ -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

View File

@ -0,0 +1,7 @@
typedef int MYINT;
void fun(int int_param, MYINT myint_param)
{
}

View File

@ -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

View File

@ -0,0 +1,8 @@
typedef int MYINT;
typedef int ALTINT;
void fun(int int_param, MYINT myint_param, ALTINT altint_param)
{
}

View File

@ -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

View File

@ -0,0 +1,7 @@
typedef int MYINT;
typedef MYINT CHAINEDINT;
void fun(int int_param, MYINT myint_param, CHAINEDINT chainedint_param)
{
}

View File

@ -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

View File

@ -0,0 +1,12 @@
typedef struct
{
int x;
float y;
} MYSTRUCT;
MYSTRUCT fun()
{
MYSTRUCT return_variable = {.x = 1, .y = 3.14f};
return return_variable;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -0,0 +1,12 @@
typedef int MYINT;
int fun()
{
return 4;
}
MYINT fun2()
{
return 5;
}

View File

@ -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

View File

@ -0,0 +1,13 @@
typedef int MYINT;
typedef int ALTINT;
MYINT fun()
{
}
ALTINT fun2()
{
}

View File

@ -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

View File

@ -0,0 +1,12 @@
typedef int MYINT;
typedef MYINT CHAINEDINT;
MYINT fun()
{
}
CHAINEDINT fun2()
{
}

View File

@ -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

View File

@ -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};
}

View File

@ -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