aboutsummaryrefslogtreecommitdiffstats
path: root/test/auto-refac-tdd
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-01-28 20:45:44 +0000
committerbloodstalker <thabogre@gmail.com>2017-01-28 20:45:44 +0000
commitff28331ee29ed5277203b277984e6598da7f48be (patch)
tree698d8a1dfd929c06e4bfc37bfc15b84ec39bfd10 /test/auto-refac-tdd
parentadded an announcement regarding chnaging license from LGPLv3 to GPLv2 (diff)
downloadmutator-ff28331ee29ed5277203b277984e6598da7f48be.tar.gz
mutator-ff28331ee29ed5277203b277984e6598da7f48be.zip
added more tdd tests for automatic refactoring facilities
Diffstat (limited to 'test/auto-refac-tdd')
-rw-r--r--test/auto-refac-tdd/auto-refac-tdd01.c100
-rw-r--r--test/auto-refac-tdd/auto-refac-tdd01.h8
2 files changed, 108 insertions, 0 deletions
diff --git a/test/auto-refac-tdd/auto-refac-tdd01.c b/test/auto-refac-tdd/auto-refac-tdd01.c
index 40e60d1..35e0b16 100644
--- a/test/auto-refac-tdd/auto-refac-tdd01.c
+++ b/test/auto-refac-tdd/auto-refac-tdd01.c
@@ -23,6 +23,106 @@ void tdd_forfixer(void)
for (loopcounter = 0; loopcounter < 10; ++loopcounter)
counter-- ;
+
+ for (loopcounter = 0; loopcounter < 10; ++loopcounter)
+ {
+ counter++;
+ }
+}
+
+void tdd_whilefixer(void)
+{
+ int whilecounter;
+
+ while (true)
+ whilecounter;
+
+ while (true)
+ whilecounter++ ;
+
+ while (true)
+ {
+ counter++;
+ }
+}
+
+void tdd_ifelsefixer(void)
+{
+ int a0;
+ int b0;
+
+ if (0 == a0)
+ {
+ /*something*/
+ }
+ else
+ a0++;
+
+ if (0 == a0)
+ {
+ /*something*/
+ }
+ else
+ a0++ ;
+
+ if (0 == a0)
+ {
+ /*something*/
+ }
+ else
+ {
+ a0++;
+ }
+
+ if (0 == a0)
+ {
+ if (0 == b0)
+ {
+
+ }
+ else
+ b0++;
+ }
+ else
+ a0++;
+
+}
+
+void tdd_iffixer(void)
+{
+ int a1;
+ int b1;
+
+ if (a1 > 10)
+ a1++;
+
+ if (b1 < 10)
+ a1++ ;
+ else if (a1 == 0)
+ b1-- ;
+ else
+ {
+
+ }
+
+ if (a1 > 10)
+ a1++;
+
+ if (b1 < 10)
+ a1++ ;
+ else if (a1 == 0)
+ {
+ b1-- ;
+ if (a1 < 10)
+ a1--;
+ else if (b1 > 10)
+ b1++;
+ }
+ else
+ {
+
+ }
+
}
void tdd_ifconstswapper(void)
diff --git a/test/auto-refac-tdd/auto-refac-tdd01.h b/test/auto-refac-tdd/auto-refac-tdd01.h
index 7acdb65..372fc3f 100644
--- a/test/auto-refac-tdd/auto-refac-tdd01.h
+++ b/test/auto-refac-tdd/auto-refac-tdd01.h
@@ -10,7 +10,15 @@
/*********************************************************************************************************************/
/********************************************Function Declarations****************************************************/
+void tdd_forfixer(void);
+void tdd_whilefixer(void);
+
+void ifelsefixer(void);
+
+void iffixer(void);
+
+void tdd_ifconstswapper(void);
/*********************************************************************************************************************/
#endif