aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-01-11 15:47:32 +0000
committerbloodstalker <thabogre@gmail.com>2017-01-11 15:47:32 +0000
commitb3bc42fcb4c6e08ec20401a60d7df1482d6932ac (patch)
treec901f89601ca81fa73ad4d470a73275ac73c6ba1 /test
parentadded 10.5 (diff)
downloadmutator-b3bc42fcb4c6e08ec20401a60d7df1482d6932ac.tar.gz
mutator-b3bc42fcb4c6e08ec20401a60d7df1482d6932ac.zip
tdd for 10.5, added a few more.
Diffstat (limited to 'test')
-rw-r--r--test/testFuncs2.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/testFuncs2.c b/test/testFuncs2.c
index ffe8686..4f289a3 100644
--- a/test/testFuncs2.c
+++ b/test/testFuncs2.c
@@ -328,17 +328,26 @@ void testfunc12(void)
{
const char* stringlit = "date should be in the form ??-??-??";
- short int port = 0x5aU;
- short int resultshort;
- int resultlong;
- int mode;
- resultshort = (~port) >> 4;
- resultshort = ((short int)(~port)) >> 4;
+ short unsigned int port = 0x005aU;
+ unsigned char portchar = 0x005aU;
+ short unsigned int resultshort;
+ const unsigned char charconst = 4U;
+ unsigned int resultlong;
+ unsigned int mode;
+ resultshort = (~port) >> 4U;
+ resultshort = port << 4U;
+ resultshort = (short unsigned int)(port << 4U);
+ resultshort = (short signed int)(port << 4U);
+ resultshort = portchar << 4U;
+ resultshort = (unsigned char)(portchar << charconst);
+ resultshort = ((short unsigned int)(~port)) >> 4U;
/*should not be tagged by 10.1\2*/
- resultlong = ((int)(~(int)port)) >> 4;
+ resultlong = ((int)(~(int)port)) >> 4U;
- resultlong = ((port << 4) & mode) >> 6;
- resultlong = ((int)((int)port << 4) & mode) >> 6;
+ /*not comliant*/
+ resultlong = ((port << 4U) & mode) >> 6U;
+ /*compliant*/
+ resultlong = ((unsigned int)((unsigned int)port << 4U) & mode) >> 6U;
}
/*the test are from the misrac doc for 11.5*/