From 2dd57a051ea920ee30948e4204be512cf84326fc Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 20 Dec 2016 16:46:43 +0330 Subject: added tdd tests for 11.1,11.2,11.3,11.4 and 11.5 --- test/testFuncs2.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/testFuncs2.c') 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.*/ -- cgit v1.2.3