Structural-Test: Improve error message for disallowed/allowed function calls/keywords
Given the following C-code
#include <stdio.h>
#include <stdlib.h>
void fun(void) {
printf("Hello World!\n");
}
int main(void) {
fun();
return EXIT_SUCCESS;
}
and the structural test configuration
main_file: main_o_false_fun_printf_disallowed_present.c
output: false # false -> 0 / null -> * / true -> +; default: null
input: null # false -> 0 / null -> * / true -> +; default: null
insecure: false # false -> 0 / null -> * / true -> +; default: null
recursion: null # false -> 0 / null -> 0 or 1 / true -> 1; default: null
The framework reports the following error:
The structure of your program is not as expected:
Error: You are not supposed to call the function 'printf' in the function 'fun'!
Error: You are not supposed to call the function 'printf' in the function 'main'!
The error is sound but the error message is somehow misleading since main calls printf
indirectly. The error message should be improved. E.g:
The structure of your program is not as expected:
Error: You are not supposed to call the function 'printf' in the function 'fun'!
Error: You are not supposed to call the function 'printf' indirectly in the function 'main'!