Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <check.h>
- #include "s21_string.h"
- START_TEST(s21_strcmp_test)
- {
- char *str1 = "12345";
- char *str2 = "12344";
- ck_assert_int_eq(s21_strcmp(str1, str2), strcmp(str1, str2));
- ck_assert_int_eq(s21_strcmp(str1, str1), strcmp(str1, str1));
- char *str3 = "123456789";
- ck_assert_int_eq(s21_strcmp(str1, str3), strcmp(str1, str3));
- char *str4 = "";
- char *str5 = " ";
- ck_assert_int_eq(s21_strcmp(str4, str4), strcmp(str4, str4));
- ck_assert_int_eq(s21_strcmp(str4, str5), strcmp(str4, str5));
- }
- END_TEST
- START_TEST(s21_strncmp_test)
- {
- }
- END_TEST
- START_TEST(s21_strcpy_test)
- {
- }
- END_TEST
- START_TEST(s21_strncpy_test)
- {
- }
- END_TEST
- int main(void)
- {
- Suite *s1 = suite_create("Core");
- TCase *tc1_1 = tcase_create("Core");
- SRunner *sr = srunner_create(s1);
- int nf;
- suite_add_tcase(s1, tc1_1);
- tcase_add_test(tc1_1, s21_strcmp_test);
- tcase_add_test(tc1_1, s21_strncmp_test);
- tcase_add_test(tc1_1, s21_strcpy_test);
- tcase_add_test(tc1_1, s21_strncpy_test);
- srunner_run_all(sr, CK_ENV);
- nf = srunner_ntests_failed(sr);
- srunner_free(sr);
- return nf == 0 ? 0 : 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement