From 9b82c31390060d6bf1d864be176caf445e68bd45 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 29 Nov 2016 20:41:43 +0330 Subject: added tdd tests for 17.1,17.2,17.3 and 17.4 --- test/testFuncs2.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/testFuncs2.c') diff --git a/test/testFuncs2.c b/test/testFuncs2.c index dac8ef0..7784619 100644 --- a/test/testFuncs2.c +++ b/test/testFuncs2.c @@ -47,4 +47,34 @@ int testfunc7(void) int a; int b; //return; +} + +int testfunc8(void) +{ + int a[10]; + int b[10]; + + int* p; + + p = &a[0]; + + int i; + int sum; + int sum2; + int garbage; + int garbage2; + + for (i = 0; i < 10; ++i) + { + sum += *(a + i); + sum2 += *(p + i); + //garbage = *(a - b); + } + + for (i = 10; i < 1; i++) + { + sum += *(a - i); + sum2 += *(p - i); + //garbage2 = *(p - a); + } } \ No newline at end of file -- cgit v1.2.3