diff --git a/MiniC/TP03/tests/students/base/test_add_boolean.c b/MiniC/TP03/tests/students/base/test_add_boolean.c new file mode 100644 index 0000000..ada0d2b --- /dev/null +++ b/MiniC/TP03/tests/students/base/test_add_boolean.c @@ -0,0 +1,10 @@ +#include "printlib.h" + +int main() { + println_bool(true + false); + return 0; +} + +// EXITCODE 2 +// EXPECTED +// In function main: Line 4 col 15: invalid type for additive operands: boolean and boolean diff --git a/MiniC/TP03/tests/students/base/test_fibonacci.c b/MiniC/TP03/tests/students/base/test_fibonacci.c new file mode 100644 index 0000000..515f8b3 --- /dev/null +++ b/MiniC/TP03/tests/students/base/test_fibonacci.c @@ -0,0 +1,27 @@ +#include "printlib.h" + +int main() { + int num, result, i; + int prev1, prev2, tmp; + result = -1; + num = 15; + + if (num < 2) { + result = num; + } else { + prev1 = 1; + prev2 = 0; + for i=2 to num { + tmp = prev1; + prev1 = prev1 + prev2; + prev2 = tmp; + } + result = prev1+prev2; + } + println_int(result); + return 0; +} + +// SKIP TEST EXPECTED +// EXPECTED +// 610 diff --git a/MiniC/TP03/tests/students/base/test_imbriqued_for.c b/MiniC/TP03/tests/students/base/test_imbriqued_for.c new file mode 100644 index 0000000..e95ced6 --- /dev/null +++ b/MiniC/TP03/tests/students/base/test_imbriqued_for.c @@ -0,0 +1,18 @@ +#include "printlib.h" + +int main() { + int i, count; + + for i=0 to 6 { + for i=0 to 6 { + count = count + 1; + } + } + println_int(count); + + return 0; +} + +// SKIP TEST EXPECTED +// EXPECTED +// 36