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/testFuncs1.c | 35 +++++++++++++++++++++++++++++++++++ test/testFuncs2.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) (limited to 'test') diff --git a/test/testFuncs1.c b/test/testFuncs1.c index 4312c79..20a40f2 100644 --- a/test/testFuncs1.c +++ b/test/testFuncs1.c @@ -730,10 +730,45 @@ void test7(void) { double a[100]; + double b[100]; + + char c[100]; + double *pointer; + double* pointerb; + + char* pointerc; + + pointerb = b; + pointer = a; + pointerc = c; + + if (a - b >= a) + {} + else if (b - a < a) + {} + + if (a < b) + {} + + if (pointer < pointerb) + {} + + if (pointer > pointerb) + {} + + if (pointerb <= pointer) + {} + + if (pointer >= pointerb) + {} + + if (pointer < pointerc) + {} + int i = 0; for (i = 0; i < 50; i++) 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