aboutsummaryrefslogtreecommitdiffstats
path: root/test/testFuncs2.c
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2016-12-03 10:28:32 +0000
committerbloodstalker <thabogre@gmail.com>2016-12-03 10:28:32 +0000
commit869e0f0abf6ec4f7a224276b21c5153d36dfcbc6 (patch)
tree517abf62883dc415bc3dc33163fc3d4cd5684eab /test/testFuncs2.c
parentadded quite a few more rule checks (diff)
downloadmutator-869e0f0abf6ec4f7a224276b21c5153d36dfcbc6.tar.gz
mutator-869e0f0abf6ec4f7a224276b21c5153d36dfcbc6.zip
added tdd tests
Diffstat (limited to 'test/testFuncs2.c')
-rw-r--r--test/testFuncs2.c179
1 files changed, 107 insertions, 72 deletions
diff --git a/test/testFuncs2.c b/test/testFuncs2.c
index e15085b..c7cbacc 100644
--- a/test/testFuncs2.c
+++ b/test/testFuncs2.c
@@ -25,9 +25,40 @@ typedef const* INTPTR;
#define LOCO2 #LOCO2
#define LOCO3(bubba) printf(#bubba "%d\n", bu##bba)
#define DEFINEVAR(X,Y) int X##Y
+#define PI 3.14
+#define PI2 (a)
+
+#define __FILE__
+#define __DATE__
+#define __TIME__
+#undef __STDC__
+#undef __FILE__
+
+#define int int
+#undef int
+
+#if defined PI2
+#endif
+
+#if 0
+#if defined LOCO2
+#endif
+#endif
+
+#if defined LOCOLUPO
+#endif
+
+#if defined LOCO
+#endif
+
+#if defined LOCOLUPO || LOCO
+#endif
+
#define LOCOLUPO
+#if 1
#undef LOCOLUPO
+#endif
/*********************************************************************************************************************/
/*Globals*/
@@ -36,21 +67,21 @@ typedef const* INTPTR;
static void test33(void)
{
- short int a;
- long int b;
+ short int a;
+ long int b;
- MINUS(a, b);
- //MINUS(a);
+ MINUS(a, b);
+ //MINUS(a);
- b = (int)a;
+ b = (int)a;
}
void testfunc1(void)
{
- unsigned char a;
- unsigned char b;
+ unsigned char a;
+ unsigned char b;
- b = a;
+ b = a;
}
#if CRAZYMACRO < 0
@@ -58,93 +89,97 @@ void testfunc1(void)
testfunc2(void)
{
- int a;
- int b;
- int sum;
+ int a;
+ int b;
+ int sum;
- sum = a + b;
+ sum = a + b;
}
void testfunc3()
{
- int a;
- int b;
- int c;
+ int a;
+ int b;
+ int c;
+
+#define LUPO wolf
- int abcdefghijklmnopqrstuvwxyz1234567890;
- int abcdefghijklmnopqrstuvwxyz12345678902;
+ int abcdefghijklmnopqrstuvwxyz1234567890;
+ int abcdefghijklmnopqrstuvwxyz12345678902;
- /*do stuff*/
+ /*do stuff*/
}
int testfunc6(void)
{
- int a;
- int b;
- //return ();
+ int a;
+ int b;
+ //return ();
}
int testfunc7(void)
{
- int a;
- int b;
- //return;
+ int a;
+ int b;
+ //return;
}
int testfunc8(void)
{
- int a[10];
- int b[10];
-
- int* p;
-
- p = &a[0];
-
- int i;
- int sum;
- int sum2;
- int garbage;
- int garbage2;
-
- for (i = 0; i < 10; ++i)
- {
- sum += *(a + i);
- sum2 += *(p + i);
- //garbage = *(a - b);
- }
-
- for (i = 10; i < 1; i++)
- {
- sum += *(a - i);
- sum2 += *(p - i);
- //garbage2 = *(p - a);
- }
+ int a[10];
+ int b[10];
+
+ int* p;
+
+ p = &a[0];
+
+#undef LUPO
+
+ int i;
+ int sum;
+ int sum2;
+ int garbage;
+ int garbage2;
+
+ for (i = 0; i < 10; ++i)
+ {
+ sum += *(a + i);
+ sum2 += *(p + i);
+ //garbage = *(a - b);
+ }
+
+ for (i = 10; i < 1; i++)
+ {
+ sum += *(a - i);
+ sum2 += *(p - i);
+ //garbage2 = *(p - a);
+ }
}
void testfunc9(void)
{
- int** p1;
- int*** p2;
-
- struct
- {
- int* sp1;
- int** sp2;
- int*** sp3;
- };
-
- struct s* ps1;
- struct s** ps2;
- struct s*** ps3;
-
- INTPTR *const* const fedupp1;
-
- int ** (*pfunc1)();
- int ** (**pfunc2)();
- int ** (***pfunc3)();
- int *** (**pfunc4)();
- int ** (**pfunc5)(int**, int**);
- int ** (**pfunc6)(int**, int***);
+ int** p1;
+ int*** p2;
+
+ struct
+ {
+ int* sp1;
+ int** sp2;
+ int*** sp3;
+ };
+
+ struct s* ps1;
+ struct s** ps2;
+ struct s*** ps3;
+
+ INTPTR *const* const fedupp1;
+
+ int ** (*pfunc1)();
+ int ** (**pfunc2)();
+ int ** (***pfunc3)();
+ int *** (**pfunc4)();
+ int ** (**pfunc5)(int**, int**);
+ int ** (**pfunc6)(int**, int***);
}
void testfunc10 (int ** (**p5)(int**, int**), int ** (**p6)(int**, int***))