diff options
author | bloodstalker <thabogre@gmail.com> | 2017-01-23 11:57:22 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-01-23 11:57:22 +0000 |
commit | bbe45e2ebb912752a6bd64438973eca73a8406d2 (patch) | |
tree | 04ddef62e2ed7e9fb654f4056b33a68a4d0fe51f /test/testFuncs3.c | |
parent | added an option to run automatic refactorings (diff) | |
download | mutator-bbe45e2ebb912752a6bd64438973eca73a8406d2.tar.gz mutator-bbe45e2ebb912752a6bd64438973eca73a8406d2.zip |
added tdd tests for automatic refactoring
Diffstat (limited to '')
-rw-r--r-- | test/testFuncs3.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/test/testFuncs3.c b/test/testFuncs3.c index baf3f37..24b7ac6 100644 --- a/test/testFuncs3.c +++ b/test/testFuncs3.c @@ -15,10 +15,8 @@ int intarray4[3][2] = MACRO2; int answer = ANSWER; float floatbitaccess; - /*********************************************************************************************************************/ -void tddfunc1 (void) -{ +void tddfunc1(void) { double complex z1 = 10.0 + 10.0 * I; double complex z2 = 1.0 - 4.0 * I; @@ -43,19 +41,17 @@ void tddfunc1 (void) n1 = n2; } -void tddfunc2(void) -{ +void tddfunc2(void) { static int staticint1; unsigned short int port = 0x5aU; unsigned short int result_8; - //uint16_t result_16; - //uint16_t mode; + // uint16_t result_16; + // uint16_t mode; result_8 = (~port) >> 4; } -void tddfunc3(void) -{ +void tddfunc3(void) { int a = 1; READ_TIME_32(); @@ -63,14 +59,12 @@ void tddfunc3(void) READ_TIME_34(); } -int* tddfunc4(void) -{ +int *tddfunc4(void) { int localauto; return (&localauto); } -void tddfunc5(void) -{ +void tddfunc5(void) { int arrint[4]; arrint[0] = 052; arrint[1] = 067; @@ -79,27 +73,29 @@ void tddfunc5(void) } /*12.12 tdd*/ -void tddfunc6(void) -{ +void tddfunc6(void) { float floatbitaccess; - int* pointertofloat; + int *pointertofloat; int apartoffloat; - /*@DEVI-you cannot get away with this since c90 and c99 both specify that operands to & need to both be of integral types.*/ - /*embedded compilers might not necessarily be ISO-C-complete so apparently this might be actually viable in some cases but - if the clang parser won't let this through, i can't analyze it so we can't check for this.*/ + /*@DEVI-you cannot get away with this since c90 and c99 both specify that + * operands to & need to both be of integral types.*/ + /*embedded compilers might not necessarily be ISO-C-complete so apparently this + might be actually viable in some cases but + if the clang parser won't let this through, i can't analyze it so we can't check + for this.*/ #if 0 apartoffloat = floatbitaccess & 0x000000FF; #endif - /*this results in a bticast castexpr which we are already tagging,clang does too, so im not overly concerned with this one + /*this results in a bticast castexpr which we are already tagging,clang does + too, so im not overly concerned with this one though its fairly east to implement.*/ pointertofloat = &floatbitaccess; - /*we could literally just tag all unions having float members as possible violations.*/ - union aunion - { + /*we could literally just tag all unions having float members as possible + * violations.*/ + union aunion { float member1; - union member2 - { + union member2 { unsigned char member3; unsigned char member4; unsigned char member5; @@ -111,13 +107,9 @@ void tddfunc6(void) apartoffloat = aunionproto.member22.member5 & 0x000000FF; } -int externfunc(int arg) -{ - return arg; -} +int externfunc(int arg) { return arg; } -void testfunc7(void) -{ +void testfunc7(void) { unsigned char chararroct[7U]; chararroct[0U] = '\100'; @@ -127,5 +119,9 @@ void testfunc7(void) chararroct[4U] = 125; chararroct[5U] = '\x12'; } + +void tddfunc8(void) { + // asm("add %al, (%rax)"); +} /*********************************************************************************************************************/ /*last line intnetionally left blank.*/ |