diff options
author | bloodstalker <thabogre@gmail.com> | 2017-01-29 02:48:26 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-01-29 02:48:26 +0000 |
commit | 25eaafd93cded893e641e25ecebe7e7166eb2ccb (patch) | |
tree | 3073b25f558b99549bf64eefa9096e84e70b19b4 /test | |
parent | added tdd tests for switchfixer and switchdfixer (diff) | |
download | mutator-25eaafd93cded893e641e25ecebe7e7166eb2ccb.tar.gz mutator-25eaafd93cded893e641e25ecebe7e7166eb2ccb.zip |
added tdd tests for switchfixer and switchdfixer
Diffstat (limited to 'test')
-rw-r--r-- | test/auto-refac-tdd/auto-refac-tdd01.c | 78 | ||||
-rw-r--r-- | test/auto-refac-tdd/auto-refac-tdd01.h | 6 |
2 files changed, 82 insertions, 2 deletions
diff --git a/test/auto-refac-tdd/auto-refac-tdd01.c b/test/auto-refac-tdd/auto-refac-tdd01.c index 35e0b16..f4c156a 100644 --- a/test/auto-refac-tdd/auto-refac-tdd01.c +++ b/test/auto-refac-tdd/auto-refac-tdd01.c @@ -125,6 +125,84 @@ void tdd_iffixer(void) } +void tdd_switchfixer_switchdffixer(void) +{ + int level = 10U; + + switch (level) { + case 10U: { + level++; + level--; + break; + } + case 20U: { + level = 10000U; + break; + } + case 30U: { + level++; + break; + } + case 40U: { + level++; + break; + } + case 50U: { + level++; + break; + } + case 60U: { + level = 1000U; + break; + } + case 70U: { + level++; + break; + } + case 80U: { + level++; + break; + } + case 90U: { + level++; + break; + } + default: { + level++; + break; + } + } + + switch (level) { + case 1: { + level++; + break; + } + case 2: + level = 10; + level--; + { + case 3: + level = 10U; + level++; + break; + } + } + + switch (level) { + case 1: + level++; + case 2: + level = 1; + case 3: + level = 2; + default: + level++; + } + + switch (level) {} +} + void tdd_ifconstswapper(void) { int a; diff --git a/test/auto-refac-tdd/auto-refac-tdd01.h b/test/auto-refac-tdd/auto-refac-tdd01.h index 372fc3f..7586fe8 100644 --- a/test/auto-refac-tdd/auto-refac-tdd01.h +++ b/test/auto-refac-tdd/auto-refac-tdd01.h @@ -14,9 +14,11 @@ void tdd_forfixer(void); void tdd_whilefixer(void); -void ifelsefixer(void); +void tdd_ifelsefixer(void); -void iffixer(void); +void tdd_iffixer(void); + +void tdd_switchfixer_switchdffixer(void); void tdd_ifconstswapper(void); |