aboutsummaryrefslogtreecommitdiffstats
path: root/test/testFuncs2.c
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2016-12-20 13:16:43 +0000
committerbloodstalker <thabogre@gmail.com>2016-12-20 13:16:43 +0000
commit2dd57a051ea920ee30948e4204be512cf84326fc (patch)
tree2014d7e5f887f9d84ccae38b708b05ebdd76570d /test/testFuncs2.c
parentupdated the sample (diff)
downloadmutator-2dd57a051ea920ee30948e4204be512cf84326fc.tar.gz
mutator-2dd57a051ea920ee30948e4204be512cf84326fc.zip
added tdd tests for 11.1,11.2,11.3,11.4 and 11.5
Diffstat (limited to 'test/testFuncs2.c')
-rw-r--r--test/testFuncs2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/testFuncs2.c b/test/testFuncs2.c
index e65c922..634b737 100644
--- a/test/testFuncs2.c
+++ b/test/testFuncs2.c
@@ -202,6 +202,11 @@ void testfunc9(void)
int** p1;
int*** p2;
+ int* pointer1;
+ double d2;
+
+ pointer1 = &d2;
+
struct
{
int* sp1;
@@ -260,5 +265,24 @@ void testfunc12(void)
resultlong = ((int)(~(int)port)) >> 4;
}
+
+/*the test are from the misrac doc for 11.5*/
+void testfunc13(void)
+{
+ int x;
+ int * const cpi = &x; /* const pointer */
+ int * const * pcpi; /* pointer to const pointer */
+ const int * * ppci; /* pointer to pointer to const */
+ int * * ppi;
+ const int * pci; /* pointer to const */
+ volatile int * pvi; /* pointer to volatile */
+ int * pi;
+ pi = cpi; /* Compliant - no conversion
+no cast required */
+ pi = (int *)pci; /* Not compliant */
+ pi = (int *)pvi; /* Not compliant */
+ ppi = (int * *)pcpi; /* Not compliant */
+ ppi = (int * *)ppci; /* Not compliant */
+}
/*********************************************************************************************************************/
/*last line intentionally left blank.*/