tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
This commit is contained in:
@@ -38,5 +38,4 @@ int main(void) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
puts("Correct memcmp");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char dest1[12] = "hello";
|
||||
@@ -8,6 +7,4 @@ int main(void) {
|
||||
|
||||
char dest2[12] = "hello";
|
||||
printf("%s\n", strncat(dest2, " world foobar", 6)); // should be hello world
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%s\n", strchr("hello", 'e')); // should be ello
|
||||
printf("%s\n", strchr("world", 'l')); // should be ld
|
||||
printf("%i\n", strchr("world", 0) == NULL); // should be 1
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char *world = "world";
|
||||
printf("%ld\n", strcspn("hello", world)); // should be 2
|
||||
printf("%ld\n", strcspn("banana", world)); // should be 6
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%d\n", strncmp("a", "aa", 2));
|
||||
@@ -9,6 +8,4 @@ int main(void) {
|
||||
printf("%d\n", strncmp("", "\xFF", 1));
|
||||
printf("%d\n", strncmp("a", "c", 1));
|
||||
printf("%d\n", strncmp("a", "a", 2));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char* source = "The quick drawn fix jumps over the lazy bug";
|
||||
@@ -15,7 +14,5 @@ int main(void) {
|
||||
|
||||
// should be "NULL"
|
||||
char* res3 = strpbrk(source, "404");
|
||||
printf("%s\n", (res3) ? res3 : "NULL");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
printf("%s\n", (res3) ? res3 : "NULL");
|
||||
}
|
||||
|
||||
@@ -18,5 +18,4 @@ int main(void) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("strrch PASS, exiting with status code %d\n", 0);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char *hello = "hello";
|
||||
@@ -9,6 +8,4 @@ int main(void) {
|
||||
printf("%lu\n", strspn(hello, "hello")); // should be 5
|
||||
printf("%lu\n", strspn(world, "wendy")); // should be 1
|
||||
printf("%lu\n", strspn(banana, "apple")); // should be 0
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%s\n", strstr("In relibc we trust", "rust"));
|
||||
@@ -8,6 +7,4 @@ int main(void) {
|
||||
printf("%s\n", strstr("In relibc we trust", "bugs"));
|
||||
printf("%s\n", strstr("IN RELIBC WE TRUST", "rust"));
|
||||
printf("%s\n", strcasestr("IN RELIBC WE TRUST", "rust"));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, "
|
||||
@@ -13,6 +12,4 @@ int main(void) {
|
||||
printf("_");
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, "
|
||||
@@ -14,6 +13,4 @@ int main(void) {
|
||||
printf("_");
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user