diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-25 16:13:33 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-25 16:13:33 +0000 |
commit | d08786b22e454e177e0642b5f9e4b19a12a891b1 (patch) | |
tree | d30bd28fc88deef201e76ac02619e0636b0abff6 /test_deliverable | |
parent | 42342b2a58c2a9189ac0ef657c766c8632782bc7 (diff) | |
download | Compiler-d08786b22e454e177e0642b5f9e4b19a12a891b1.tar.gz Compiler-d08786b22e454e177e0642b5f9e4b19a12a891b1.zip |
Adding proper support for types
Diffstat (limited to 'test_deliverable')
-rw-r--r-- | test_deliverable/testcases/test_CHAR0.c | 4 | ||||
-rw-r--r-- | test_deliverable/testcases/test_CHAR0_driver.c | 6 | ||||
-rw-r--r-- | test_deliverable/testcases/test_CHARARRAY0.c | 7 | ||||
-rw-r--r-- | test_deliverable/testcases/test_CHARARRAY0_driver.c | 12 |
4 files changed, 29 insertions, 0 deletions
diff --git a/test_deliverable/testcases/test_CHAR0.c b/test_deliverable/testcases/test_CHAR0.c new file mode 100644 index 0000000..c1dd4c6 --- /dev/null +++ b/test_deliverable/testcases/test_CHAR0.c @@ -0,0 +1,4 @@ +char char0(char a, char b) +{ + return a - b; +} diff --git a/test_deliverable/testcases/test_CHAR0_driver.c b/test_deliverable/testcases/test_CHAR0_driver.c new file mode 100644 index 0000000..ae73678 --- /dev/null +++ b/test_deliverable/testcases/test_CHAR0_driver.c @@ -0,0 +1,6 @@ +char char0(char, char); + +int main() +{ + return ( 'b' == char0('a', 1) ); +} diff --git a/test_deliverable/testcases/test_CHARARRAY0.c b/test_deliverable/testcases/test_CHARARRAY0.c new file mode 100644 index 0000000..1accac3 --- /dev/null +++ b/test_deliverable/testcases/test_CHARARRAY0.c @@ -0,0 +1,7 @@ +char *chararray0(char *array, char a, char b, char c) +{ + array[0] = a; + array[1] = b; + array[2] = c; + return array; +} diff --git a/test_deliverable/testcases/test_CHARARRAY0_driver.c b/test_deliverable/testcases/test_CHARARRAY0_driver.c new file mode 100644 index 0000000..0b68aae --- /dev/null +++ b/test_deliverable/testcases/test_CHARARRAY0_driver.c @@ -0,0 +1,12 @@ +#include <string.h> + +char *chararray0(char *, char, char, char); + +int main() +{ + char array[3]; + char *test_array = "abc"; + return !( chararray0(array, 'a', 'b', 'c')[0] == test_array[0] && + chararray0(array, 'a', 'b', 'c')[1] == test_array[1] && + chararray0(array, 'a', 'b', 'c')[2] == test_array[2] ); +} |