tests: Replace returns with exits in the main functions
This will allow us to redefine the exit function.
For example:
```
#define exit(code) { \
fprintf(stderr, "%s:%d: exit(%s) in function ‘%s’\n",
__FILE__, __LINE__, #code, __func__); \
_exit(code); \
}
```
This commit is contained in:
@@ -7,15 +7,15 @@ int main(void) {
|
||||
const char ptr[] = "Hello World!";
|
||||
|
||||
if (fwrite(ptr, 0, 17, f)) {
|
||||
return EXIT_FAILURE;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (fwrite(ptr, 7, 0, f)) {
|
||||
return EXIT_FAILURE;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (fwrite(ptr, 0, 0, f)) {
|
||||
return EXIT_FAILURE;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fwrite(ptr, sizeof(ptr), 1, f);
|
||||
|
||||
Reference in New Issue
Block a user