From fb4c8a42c6fe9e6d94d07ae95a333aaecb769f84 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Thu, 24 Nov 2016 18:52:37 +0330 Subject: added tdd tests for 12.4 and 12.5 --- test/testFuncs1.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/testFuncs1.h | 1 + 2 files changed, 58 insertions(+) diff --git a/test/testFuncs1.c b/test/testFuncs1.c index 2480afa..8c05582 100644 --- a/test/testFuncs1.c +++ b/test/testFuncs1.c @@ -4,6 +4,7 @@ /*include*/ /**********************************************************************************************************************/ #include "testFuncs1.h" +//#include /**************************************************MACROS & DEFS*******************************************************/ /**********************************************************************************************************************/ @@ -836,5 +837,61 @@ void test17(void) a = sizeof (b = 2000U); } +void test18(void) +{ + int a; + int b; + int c; + unsigned char d; + + if (c && (a = b)) + { + /*yada yada*/ + } + + if ((c = a) || a) + { + /*yada*/ + } + if (c && (a || c)) + { + + } + + d = c && (a = c); + +} + +void test19(void) +{ + const int a = 100; + + unsigned char flag = 1; + + unsigned char flag2; + + unsigned char flag3; + + //char *str = "loco\0"; + + const double pi = 3.54; + + if ((flag) && pi) + {} + + if (flag || flag2 && flag3) + {} + + if (a == 0 && flag) + {} + + if (flag || (a == 0)) + {} + + if (!flag || flag2) + {} + +} + /**********************************************************************************************************************/ /*the last line's been intentionally left blank.*/ diff --git a/test/testFuncs1.h b/test/testFuncs1.h index ea5bb13..8457f87 100644 --- a/test/testFuncs1.h +++ b/test/testFuncs1.h @@ -114,6 +114,7 @@ void test10(void); int test13(void); void test15(void); void test17(void); +void test19(void); /***********************************************************************************************************/ /*ive been intentionally left blank. dont touch me.*/ -- cgit v1.2.3